Commit graph

1364 commits

Author SHA1 Message Date
Daniel Holbert
4df44a307b Bug 1790665 followup: Add another diagnostic assert to PresShell::MarkFramesInSubtreeApproximatelyVisible. rs=tnikkel
(This assert should be trivially satisfied, but nonetheless we get crash
reports that suggest we have null pointers here, so let's see...)

Differential Revision: https://phabricator.services.mozilla.com/D157293
2022-09-14 06:56:07 +00:00
Daniel Holbert
f817d604e5 Bug 1790665: Add a diagnostic assert to PresShell::MarkFramesInSubtreeApproximatelyVisible. r=tnikkel
This API only should never receive a null frame pointer; but we occasionally
get crash reports in this function where a null frame pointer seems to be
involved. This patch's diagnostic asserts might help us catch these crashes
slightly earlier and more directly, and might help us reason about what's going
on a bit better.

Differential Revision: https://phabricator.services.mozilla.com/D157236
2022-09-14 01:06:52 +00:00
Sandor Molnar
4009825526 Backed out changeset 3a5759eabb42 (bug 1789255) for causing wpt failures in netwerk/protocol/http/Http2Session.cpp CLOSED TREE 2022-09-14 02:01:36 +03:00
Martin Robinson
f48a334b7c Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio
Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.

This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.

In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.

Differential Revision: https://phabricator.services.mozilla.com/D156473
2022-09-13 20:01:35 +00:00
Emilio Cobos Álvarez
52927ddd54 Bug 1787127 - Use used color-scheme (not preferred) to determine canvas background adjustments. r=tnikkel
As per spec, see https://drafts.csswg.org/css-color-adjust/#color-scheme-effect:

> In order to preserve expected color contrasts, in the case of embedded
> documents typically rendered over a transparent canvas (such as
> provided via an HTML iframe element), if the used color scheme of the
> element and the used color scheme of the embedded document’s root
> element do not match, then the UA must use an opaque canvas of the
> Canvas color appropriate to the embedded document’s used color scheme
> instead of a transparent canvas.

After bug 1782596 we were using the preferred rather than used
color-scheme, which is the right thing to do for prefers-color-scheme,
but not for the canvas background.

Differential Revision: https://phabricator.services.mozilla.com/D155831
2022-09-04 23:16:32 +00:00
Emilio Cobos Álvarez
e3d2060438 Bug 1740989 - Implement focus fixup rule. r=smaug
This implements the proposal in the linked spec issue, and makes
it nightly-only pending resolution + edits.

Differential Revision: https://phabricator.services.mozilla.com/D155970
2022-09-01 11:28:47 +00:00
Emilio Cobos Álvarez
f32093456d Bug 1786513 - Make SimpleResizeReflow not flush by default. r=jfkthame,layout-reviewers
Only GeckoMVMContext really needs the flush, to measure scrolled height
afterwards. Do that explicitly.

This shouldn't change behavior, for the most part; there was a preload
test that relied on the flush when changing DPI to start a run really
clean, but other than that this looks green on try.

Should at best be neutral (just code clean-up), or be a performance
improvement.

In a follow-up, we can possibly remove the DelayedResize code from the
view manager, though I need to think how to possibly coalesce the MVM
reflows, so let's not do that yet.

Differential Revision: https://phabricator.services.mozilla.com/D155385
2022-09-01 10:54:24 +00:00
Iulian Moraru
c4572532eb Backed out changeset d8f983951128 (bug 1740989) for causing mochitest-chrome failures on test_modal_prompts.html. CLOSED TREE 2022-09-01 01:03:29 +03:00
Emilio Cobos Álvarez
c5ffe23435 Bug 1740989 - Implement focus fixup rule. r=smaug
This implements the proposal in the linked spec issue, and makes
it nightly-only pending resolution + edits.

Differential Revision: https://phabricator.services.mozilla.com/D155970
2022-08-31 17:10:17 +00:00
Martin Robinson
ff6e1e7e64 Bug 1767262 - Lazily layout content that is hidden via content-visibility: hidden r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D145949
2022-08-29 14:41:36 +00:00
Timothy Nikkel
3849b3a6e4 Bug 1787684. Only return views with widgets from FindFloatingViewContaining. r=emilio
The code that bug 1754436 deleted checked to make sure there was a widget for the returned view, but it looks like it's possible in some edge cases to have an open popup that doesn't have a widget (most likely just for a split second). We need a widget to dispatch the event, and if it doesn't have a widget it's not visible so no point in touching it at all anyways.

Differential Revision: https://phabricator.services.mozilla.com/D155819
2022-08-29 09:58:11 +00:00
Cristian Tuns
24652e5425 Backed out changeset e29b0fbf77f1 (bug 1786513) for causing mochitest failures on /browser_unified_extensions.js CLOSED TREE 2022-08-26 11:11:46 -04:00
Emilio Cobos Álvarez
7c34c8de9a Bug 1786513 - Make SimpleResizeReflow not flush by default. r=jfkthame,layout-reviewers
Only GeckoMVMContext really needs the flush, to measure scrolled height
afterwards. Do that explicitly.

This shouldn't change behavior, for the most part; there was a preload
test that relied on the flush when changing DPI to start a run really
clean, but other than that this looks green on try.

Should at best be neutral (just code clean-up), or be a performance
improvement.

In a follow-up, we can possibly remove the DelayedResize code from the
view manager, though I need to think how to possibly coalesce the MVM
reflows, so let's not do that yet.

Differential Revision: https://phabricator.services.mozilla.com/D155385
2022-08-26 12:58:12 +00:00
Sandor Molnar
a4f3a0f44b Backed out changeset f67c8298a104 (bug 1767262) for causing wpt assertion failures in layout/base/PresShell.cpp CLOSED TREE 2022-08-24 20:39:45 +03:00
Martin Robinson
9d8878f0d0 Bug 1767262 - Lazily layout content that is hidden via content-visibility: hidden r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D145949
2022-08-24 13:30:55 +00:00
Butkovits Atila
5c5ef28ffa Backed out changeset 5a4a5749f8dc (bug 1767262) for causing wpt failures. 2022-08-23 18:33:04 +03:00
Martin Robinson
4d8325d138 Bug 1767262 - Lazily layout content that is hidden via content-visibility: hidden r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D145949
2022-08-23 14:16:10 +00:00
Butkovits Atila
ae6a677e52 Backed out changeset 7538d23ee88e (bug 1767262) for causing failures at content-visibility-081.html. CLOSED TREE 2022-08-15 20:37:49 +03:00
Martin Robinson
1cf715eb0d Bug 1767262 - Lazily layout content that is hidden via content-visibility: hidden r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D145949
2022-08-15 16:18:43 +00:00
Emilio Cobos Álvarez
ef562aae0a Bug 774398 - Hack to make print and viewport media query listeners fire when printing. r=geckoview-reviewers,owlish,dholbert
This still doesn't fire on print settings changes, so it uses the
default page size. Which is probably better than nothing, but...

To make viewport-size media-query listeners work more generally for
printed documents, we would need to re-clone the top document
unconditionally for all print settings changes, which needs front-end
work at least, and is dubious if the page changes dynamically.

Differential Revision: https://phabricator.services.mozilla.com/D150499
2022-08-11 23:11:37 +00:00
Emilio Cobos Álvarez
b1a338428d Bug 1778989 - Add some basic container query interleaving. r=dholbert
This is far from fully perfect (specially when dealing with nested
containers, we need to be smarter when updating there), but it's
incremental progress.

Differential Revision: https://phabricator.services.mozilla.com/D151496
2022-08-10 11:28:08 +00:00
Cosmin Sabou
e5288325d4 Backed out 2 changesets (bug 1764640, bug 1778989) for causing container-queries wpt related failures. CLOSED TREE
Backed out changeset e76569e0c380 (bug 1764640)
Backed out changeset ba5c1d50ce72 (bug 1778989)
2022-08-10 02:00:51 +03:00
Emilio Cobos Álvarez
f5cb2931f9 Bug 1778989 - Add some basic container query interleaving. r=dholbert
This is far from fully perfect (specially when dealing with nested
containers, we need to be smarter when updating there), but it's
incremental progress.

Differential Revision: https://phabricator.services.mozilla.com/D151496
2022-08-09 11:44:39 +00:00
Hiroyuki Ikezoe
507bbaf6f5 Bug 1777649 - Honor scroll snap properties on ScrollFrameRectIntoView call. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D151335
2022-07-31 22:51:56 +00:00
Emilio Cobos Álvarez
eef7f0ff16 Bug 1781034 - Remove layout debugger's visual debugging. r=layout-reviewers,dshin
Differential Revision: https://phabricator.services.mozilla.com/D152628
2022-07-26 15:06:30 +00:00
Marian-Vasile Laza
aa61e2020a Backed out 2 changesets (bug 1781034) for causing bustages on nsImageFrame.cpp. CLOSED TREE
Backed out changeset 6a7a9375987a (bug 1781034)
Backed out changeset 58728270361e (bug 1781034)
2022-07-26 17:45:06 +03:00
Emilio Cobos Álvarez
81b3b99519 Bug 1781034 - Remove layout debugger's visual debugging. r=layout-reviewers,dshin
Differential Revision: https://phabricator.services.mozilla.com/D152628
2022-07-26 14:08:56 +00:00
Edgar Chen
775d68bc7e Bug 1778486 - Use Pointer event to record last user input position; r=smaug
In order to support record the last user input for touch given APZ won't
synthesize mouse event for touch in parent process. Using pointer event could
support pen input nicely, too.

Differential Revision: https://phabricator.services.mozilla.com/D151282
2022-07-22 13:51:47 +00:00
Emilio Cobos Álvarez
bf56ce8562 Bug 1780455 - Fix an assertion to account for imagemap hacks. r=jwatt
I tried to add a crashtest without the video attachment and so on but
that didn't quite make it.

Differential Revision: https://phabricator.services.mozilla.com/D152374
2022-07-21 15:57:14 +00:00
Bogdan Szekely
86a4afe3d3 Backed out changeset 5ffdcd317253 (bug 1778486) for causing mochitest failures on test_getLastOverWindowPointerLocationInCSSPixels.html CLOSED TREE 2022-07-21 16:58:07 +03:00
Edgar Chen
758aaaa824 Bug 1778486 - Use Pointer event to record last user input position; r=smaug
In order to support record the last user input for touch given APZ won't
synthesize mouse event for touch in parent process. Using pointer event could
support pen input nicely, too.

Differential Revision: https://phabricator.services.mozilla.com/D151282
2022-07-21 08:56:48 +00:00
Iulian Moraru
eefea78474 Backed out changeset 9a5d1eaadf39 (bug 1778486) for causing mochitest-crash failures on test_getLastOverWindowPointerLocationInCSSPixels.html. CLOSED TREE 2022-07-20 18:56:03 +03:00
Edgar Chen
4811778c31 Bug 1778486 - Use Pointer event to record last user input position; r=smaug
In order to support record the last user input for touch given APZ won't
synthesize mouse event for touch in parent process. Using pointer event could
support pen input nicely, too.

Differential Revision: https://phabricator.services.mozilla.com/D151282
2022-07-20 15:03:19 +00:00
Emilio Cobos Álvarez
5e23ef2ae0 Bug 1778983 - Remove useless ProcessPendingRestyles call. r=boris
That was about XBL constructors being able to run script. But XBL is
gone and this should just be wasted work.

I want to land this in preparation for container queries substantially
changing the model here.

Differential Revision: https://phabricator.services.mozilla.com/D151495
2022-07-14 12:47:59 +00:00
Cristian Tuns
b39b0d3b9d Backed out changeset ef564358a7e8 (bug 1778983) for causing wpt failures in CSSTransition-canceling.tentative.html CLOSED TREE 2022-07-12 07:48:51 -04:00
Emilio Cobos Álvarez
b8d58c68d0 Bug 1777135 - Part 1: make nsPresContext::DefaultBackgroundColor account for default-background color-scheme. r=dholbert
And remove one unused caller.

This might change behavior of some selection contrast checks and backplating
which will potentially use the right background-color after this patch. The
next patch ensures this is also accounted for for scrollbars.

Unfortunately selection contrast checks are non-trivial to test because we only
do the contrast check with system colors, and we'd need a default selection
color close to the highlight color to do this.

Differential Revision: https://phabricator.services.mozilla.com/D151017
2022-07-12 09:51:47 +00:00
Emilio Cobos Álvarez
c4ef579d53 Bug 1778983 - Remove useless ProcessPendingRestyles call. r=boris
That was about XBL constructors being able to run script. But XBL is
gone and this should just be wasted work.

I want to land this in preparation for container queries substantially
changing the model here.

Differential Revision: https://phabricator.services.mozilla.com/D151495
2022-07-12 09:45:39 +00:00
Julien Wajsberg
f2cc927a5c Bug 1777473 - Rename the frame label for PresShell::Destroy and expose to javascript developers r=emilio
The existing frame label was reusing the function name, but we already
have it when using native stacks. Renaming it to a more understandable
name should make it easier for our javascript developers users without
impairing gecko developers.

Differential Revision: https://phabricator.services.mozilla.com/D150976
2022-07-06 14:02:05 +00:00
Hiroyuki Ikezoe
77f616cdaf Bug 1530253 - Trigger re-snap on reflows and in RecomputePosition. r=botond,emilio
The basic machinery to trigger re-snap is same as what scroll anchoring does,
queueing a triggering request and flush the queued requests after reflows
finished.

Depends on D148862

Differential Revision: https://phabricator.services.mozilla.com/D148863
2022-07-01 01:35:32 +00:00
Nika Layzell
8f236832ff Bug 1758115 - Part 2: Streamline locking, initialization and shutdown for TimelineConsumers, r=smaug
The current implementation of TimelineConsumers contains some unnecessary
complexity due to how it is initialized as a singleton, and the need for it to
be initialized and used in a threadsafe way. This patch attempts to simplify it
by making all members static, and removing the need to explicitly observe
shutdown for cleanup.

In addition, this approach avoids the risk of the type being accessed from
off-main-thread during initialization or shutdown.

Depends on D150442

Differential Revision: https://phabricator.services.mozilla.com/D150443
2022-06-29 15:01:51 +00:00
Emilio Cobos Álvarez
5fd43eaab3 Bug 1776157 - Don't force chrome frames to be opaque. r=dholbert
It causes unnecessary flashes in some cases, like the sidebar which
intentionally loads about:blank.

Differential Revision: https://phabricator.services.mozilla.com/D150096
2022-06-24 00:04:18 +00:00
Jeff Muizelaar
3847a14838 Bug 1774849 - Always use sync decoding during reftests. r=aosmond
nsImageGeometryMixin is used to redraw images with sync decoding.  Without it,
if we paint an image with non-sync decoding, we won't know that it will be
drawn differently with sync decoding and so don't have a mechanism to include
it in the invalid region.

Currently the main situation where we draw images with non-sync decoding and
then with sync decoding is during reftests. If we unconditionally use sync
decoding during reftests we don't have to worry about the situation where we
switch. This will let us resolve the problems associated with nsImageGeometryMixin.

Differential Revision: https://phabricator.services.mozilla.com/D149657
2022-06-22 18:50:35 +00:00
Daniel Holbert
92b1de01bb Bug 1774879 part 3: Add 'const' to local var ComputedStyle pointers that we pass to DetermineBackgroundColor and IsTransparent (which now accept const). r=emilio
This patch does not affect behavior; it's just a const-correctness fix.

Differential Revision: https://phabricator.services.mozilla.com/D149676
2022-06-18 00:45:20 +00:00
Iulian Moraru
b9b91b3bba Backed out changeset ea2c1cabc853 (bug 1774849) for causing crashtest failures on 944353.jpg. 2022-06-17 22:56:46 +03:00
Jeff Muizelaar
e2ab641934 Bug 1774849 - Always use sync decoding during reftests. r=aosmond
nsImageGeometryMixin is used to redraw images with sync decoding.  Without it,
if we paint an image with non-sync decoding, we won't know that it will be
drawn differently with sync decoding and so don't have a mechanism to include
it in the invalid region.

Currently the main situation where we draw images with non-sync decoding and
then with sync decoding is during reftests. If we unconditionally use sync
decoding during reftests we don't have to worry about the situation where we
switch. This will let us resolve the problems associated with nsImageGeometryMixin.

Differential Revision: https://phabricator.services.mozilla.com/D149657
2022-06-17 18:57:07 +00:00
Mirko Brodesser
8d922ea417 Bug 1744524: part 1) Add JS code for the "Paste" menupopup to handle ClipboardReadTextPaste events created from the C++ side. r=edgar,Gijs
Implements showing a "Paste" popup at the last mouse position (which
overlapped the browser window) when a certain custom event is received.
Creating and dispatchting that event is implemented in one of the
following parts.

Differential Revision: https://phabricator.services.mozilla.com/D135333
2022-06-16 14:43:40 +00:00
Hiroyuki Ikezoe
20c48b14ce Bug 1771830 - Apply scroll snap in ScrollToShowRect in PresShell.cpp. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D147708
2022-06-08 02:49:56 +00:00
Emilio Cobos Álvarez
12bd84f0c5 Bug 1773070 - While at it rename ContentStateChanged to ElementStateChanged, and make it take elements. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D148553
2022-06-07 23:09:54 +00:00
Emilio Cobos Álvarez
255763ef57 Bug 1773070 - Unify Gecko and Servo EventState/ElementState bits. r=smaug
Add a dom/base/rust crate called just "dom" where we can share these.

Most of the changes are automatic:

  s/mozilla::EventStates/mozilla::dom::ElementState/
  s/EventStates/ElementState/
  s/NS_EVENT_STATE_/ElementState::/
  s/NS_DOCUMENT_STATE_/DocumentState::/

And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.

Differential Revision: https://phabricator.services.mozilla.com/D148537
2022-06-07 23:09:52 +00:00
Jonathan Kew
f117f58e47 Bug 1771609 - patch 3 - Remove nsAutoLineIterator, as it no longer serves any useful purpose since the iterator is owned by the target frame. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D147579
2022-06-03 22:05:36 +00:00