Commit graph

1531 commits

Author SHA1 Message Date
Cristian Tuns
18e597b504 Backed out 9 changesets (bug 1791777, bug 1791780, bug 1791778, bug 1791782) for causing build bustages on TestCOLRv1.cpp CLOSED TREE
Backed out changeset f145a34cfbc1 (bug 1791782)
Backed out changeset 2f12216fbeda (bug 1791782)
Backed out changeset 61bd2a4496bf (bug 1791780)
Backed out changeset 4e4eb99a7fd9 (bug 1791778)
Backed out changeset 32d171a28810 (bug 1791778)
Backed out changeset e317795cd27a (bug 1791777)
Backed out changeset 5e32d5a01917 (bug 1791777)
Backed out changeset cf87497dbead (bug 1791777)
Backed out changeset 586c735b005e (bug 1791777)
2022-10-07 13:46:43 -04:00
Jonathan Kew
c8bc44d595 Bug 1791782 - Connect CSS font-palette features to rendering via the presContext. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157959
2022-10-07 16:53:36 +00:00
Norisz Fay
30ef428f43 Backed out 9 changesets (bug 1791780, bug 1791782, bug 1791778, bug 1791777) for causing multiple mochitest failures CLOSED TREE
Backed out changeset 6de1ade5a9b6 (bug 1791782)
Backed out changeset ce96452a38a1 (bug 1791782)
Backed out changeset 7cc8e027f5a7 (bug 1791780)
Backed out changeset 8e023280032c (bug 1791778)
Backed out changeset 26d65d76d02a (bug 1791778)
Backed out changeset a98dd552df64 (bug 1791777)
Backed out changeset 766386309ee5 (bug 1791777)
Backed out changeset 7de66a218ba4 (bug 1791777)
Backed out changeset 1d17c257444e (bug 1791777)
2022-10-07 17:36:38 +03:00
Jonathan Kew
03bc9753c5 Bug 1791782 - Connect CSS font-palette features to rendering via the presContext. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157959
2022-10-07 12:16:53 +00:00
Ting-Yu Lin
ce9040c985 Bug 1794035 Part 4 - Use range-based for loops to iterate nsFrameList. r=emilio
After this patch, we still need nsFrameList::Enumerator to iterate
nsFrameList::Slice. We might enhance nsFrameList::Iterator to support Slice, but
I'll leave this for another day.

Differential Revision: https://phabricator.services.mozilla.com/D158809
2022-10-07 01:41:41 +00:00
Emilio Cobos Álvarez
abe0dac72c Bug 1794056 - Use static pref version of scroll distance prefs. r=hiro,TYLin
These were already static prefs for APZ, let's use them everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D158817
2022-10-06 23:56:58 +00:00
Emilio Cobos Álvarez
235b091ad3 Bug 1665476 - Remove nsRootBoxFrame to unify background propagation between XUL and non-XUL documents. r=layout-reviewers,mats
It's unused on mozilla-central, and Thunderbird can just use the canvas
frame as regular (X)HTML documents, so just use a canvas frame instead
of an nsRootBoxFrame for XUL as well.

nsRootBoxFrame was needed because of various XUL-specific things like
tooltips and so on lived there. But with the move away from XUL, that
functionality has been added to nsCanvasFrame already, behind a
principal check instead.

This also allows simplifying our background propagation setup, which was
only half-working for XUL documents (this bug is a consequence of that).

With this, most of the callers of nsCSSRendering::IsCanvasFrame can go.
They're only two of the frames that would return true for that that
actually paint backgrounds (nsCanvasFrame and nsRootBoxFrame), so the
codepaths in display list building and painting can just check
frame->IsCanvasFrame() instead.

The remaining caller to that function is
nsContainerFrame::SyncWindowProperties, and the change is also legit, in
the sense that the only thing SyncWindowProperties() really cares about
is propagating the max/min-width constraints from the root element's
style to the view/widget, and the only frame that would return true from
IsCanvasFrame and have a view is the viewport frame which is the root of
the frame tree.

Differential Revision: https://phabricator.services.mozilla.com/D90846
2022-09-28 02:56:41 +00:00
Butkovits Atila
7b7cfe8e1b Backed out changeset 503c84054f68 (bug 1665476) for causing mochitest mass failures. CLOSED TREE 2022-09-27 13:04:54 +03:00
Emilio Cobos Álvarez
8ed6f78bb0 Bug 1665476 - Remove nsRootBoxFrame to unify background propagation between XUL and non-XUL documents. r=layout-reviewers,mats
It's unused on mozilla-central, and Thunderbird can just use the canvas
frame as regular (X)HTML documents, so just use a canvas frame instead
of an nsRootBoxFrame for XUL as well.

nsRootBoxFrame was needed because of various XUL-specific things like
tooltips and so on lived there. But with the move away from XUL, that
functionality has been added to nsCanvasFrame already, behind a
principal check instead.

This also allows simplifying our background propagation setup, which was
only half-working for XUL documents (this bug is a consequence of that).

With this, most of the callers of nsCSSRendering::IsCanvasFrame can go.
They're only two of the frames that would return true for that that
actually paint backgrounds (nsCanvasFrame and nsRootBoxFrame), so the
codepaths in display list building and painting can just check
frame->IsCanvasFrame() instead.

The remaining caller to that function is
nsContainerFrame::SyncWindowProperties, and the change is also legit, in
the sense that the only thing SyncWindowProperties() really cares about
is propagating the max/min-width constraints from the root element's
style to the view/widget, and the only frame that would return true from
IsCanvasFrame and have a view is the viewport frame which is the root of
the frame tree.

Differential Revision: https://phabricator.services.mozilla.com/D90846
2022-09-27 08:18:58 +00:00
Emilio Cobos Álvarez
4e978b56b5 Bug 1689816 - Implement <tabpanels> and <deck> without XUL layout. r=Gijs,Jamie,morgan,preferences-reviewers,mconley,TYLin
Gijs for front-end bits, layout for the new CSS properties and the
removal of nsDeckFrame / nsStackLayout, Jamie and Morgan for the a11y
changes.

As discussed in the bug, the main tricky part here is handling a11y
correctly. For <deck>, that's trivial (just use `visibility: hidden` to
hide the panels visually, while removing the unselected panels from the
a11y tree).

For <tabpanels> however we need to do something special. We do want to
hide stuff visually, but we want to preserve the contents in the a11y
tree.

For that, the easiest fix is introducing a new privileged CSS property
(-moz-subtree-hidden-only-visually), which takes care of not painting
the frame, but marks stuff offscreen in the accessibility tree. This is
not intended to be a property used widely.

Other than that, the changes are relatively straight-forward, though
some of the accessible/mac changes I could get a sanity-check on.

Differential Revision: https://phabricator.services.mozilla.com/D157875
2022-09-27 04:18:16 +00:00
Marian-Vasile Laza
f54a464c90 Backed out changeset 2f74f8f2ed19 (bug 1689816) for causing reftest failures on skip-ink-multiline-position.html. 2022-09-26 23:24:03 +03:00
Emilio Cobos Álvarez
f875681246 Bug 1689816 - Implement <tabpanels> and <deck> without XUL layout. r=Gijs,Jamie,morgan,preferences-reviewers,mconley,TYLin
Gijs for front-end bits, layout for the new CSS properties and the
removal of nsDeckFrame / nsStackLayout, Jamie and Morgan for the a11y
changes.

As discussed in the bug, the main tricky part here is handling a11y
correctly. For <deck>, that's trivial (just use `visibility: hidden` to
hide the panels visually, while removing the unselected panels from the
a11y tree).

For <tabpanels> however we need to do something special. We do want to
hide stuff visually, but we want to preserve the contents in the a11y
tree.

For that, the easiest fix is introducing a new privileged CSS property
(-moz-subtree-hidden-only-visually), which takes care of not painting
the frame, but marks stuff offscreen in the accessibility tree. This is
not intended to be a property used widely.

Other than that, the changes are relatively straight-forward, though
some of the accessible/mac changes I could get a sanity-check on.

Differential Revision: https://phabricator.services.mozilla.com/D157875
2022-09-26 17:40:30 +00:00
Hiroyuki Ikezoe
386cb32f1a Bug 1713364 - Check whether the presshell is still valid before calling PostRestyleForThrottledAnimations. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D157887
2022-09-22 04:59:44 +00:00
Emilio Cobos Álvarez
441ac8fa3b Bug 1789934 - Make PresShell::ReconstructFrames simpler. r=dholbert
The main issue here is that we have a dynamic change request from the
embed load. That would usually not get honored, because we're printing.
But we call into ReconstructFrames() and flush style _before_ asking to
reconstruct the document, which means that replicated fixed frames that
don't get properly cleaned-up.

This is not a correctness issue because we're about to reconstruct the
whole frame tree anyways, but the intermediate state is invalid and
caught by our assertions.

Differential Revision: https://phabricator.services.mozilla.com/D157674
2022-09-19 21:40:18 +00:00
Martin Robinson
f943c5f18d 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/D157306
2022-09-15 20:32:27 +00:00
Norisz Fay
fd54c095de Backed out changeset c3780baf6f24 (bug 1789255) for causing build bustages CLOSED TREE 2022-09-15 21:14:04 +03:00
Martin Robinson
631f1807ed 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/D157306
2022-09-15 17:56:42 +00:00
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
Emilio Cobos Álvarez
c8ac345ec7 Bug 1769774 - Stop tracking painted PresShells. r=mstange
After bug 1730284 we don't use it for throttling iframes, so the only
remaining use the test-only nsIDOMWindowUtils.paintCount. None of the
tests using it rely on the empty transaction case, so we should be able
to just remove this.

Differential Revision: https://phabricator.services.mozilla.com/D146589
2022-05-27 11:12:19 +00:00
Masayuki Nakano
77df1d2c4c Bug 1680611 - part 10: Mark nsFocusManager::Flush*() and their callers in nsFocusManager r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D147069
2022-05-26 04:37:21 +00:00
Cristian Tuns
a089bcae5b Backed out changeset ad9f67e4e822 (bug 1769774) for causing build bustages after backout of Bug 1730284 CLOSED TREE 2022-05-25 16:10:08 -04:00
Emilio Cobos Álvarez
7789efcab7 Bug 1769774 - Stop tracking painted PresShells. r=mstange
After bug 1730284 we don't use it for throttling iframes, so the only
remaining use the test-only nsIDOMWindowUtils.paintCount. None of the
tests using it rely on the empty transaction case, so we should be able
to just remove this.

Differential Revision: https://phabricator.services.mozilla.com/D146589
2022-05-25 17:55:17 +00:00
Emilio Cobos Álvarez
7184afff2f Bug 1738380 - Draw backgrounds of iframes with mismatched embedder color schemes. r=jwatt
In the future we might want to (also?) propagate the
prefers-color-scheme on the iframe like we do for the content/chrome
boundary / top browsing contexts, see:

 * https://github.com/w3c/csswg-drafts/issues/4772
 * https://github.com/w3c/csswg-drafts/issues/7213

Differential Revision: https://phabricator.services.mozilla.com/D146162
2022-05-20 15:20:34 +00:00
Glenn Watson
cebe610723 Bug 1768983 - Add prim flag for checkerboarding backgrounds r=gfx-reviewers,lsalzman
Although not needed right now (checkerboarding backgrounds get
a slice anyway due to being a different scroll root), this will
be important for the upcoming work to make backdrop filter
roots implicit. This allows WR to know when slicing up a content
slice if the prim is relevant to the backdrop root.

Differential Revision: https://phabricator.services.mozilla.com/D146145
2022-05-15 21:54:25 +00:00
Hiroyuki Ikezoe
a457a5cfbb Bug 1766805 - Introduce intended direction and intended end position concepts. r=botond
The scroll snap spec defines the concepts [1]. There are three type of scroll
operations. 1) intended end position, 2) intended direction and end position
and 3) intended direction.

Basically our existing ScrollUnits types correspond;

1) DEVICE_PIXELS, WHOLE => intended end position
2) PAGES => intended direction and end position
3) LINES => intended direction

There are two exceptions in the `intended direction and end position` case,
scrollBy() and fling gestures (on Linux). They were defined as scroll operations
with DEVICE_PIXELS unit, but the spec cleary says they are `intended direction
and end position` operations.

Note that we will also use this information for scroll-snap-stop property since
the properly will only have effects on both 2) and 3) cases.

[1] https://drafts.csswg.org/css-scroll-snap/#scroll-types

Depends on D145190

Differential Revision: https://phabricator.services.mozilla.com/D145191
2022-05-12 12:25:15 +00:00
Norisz Fay
ce587cb281 Backed out 3 changesets (bug 1766805) for causing build bustage on AsyncPanZoomController.cpp CLOSED TREE
Backed out changeset e35a130f2bce (bug 1766805)
Backed out changeset 9f9e2030fbc1 (bug 1766805)
Backed out changeset 898bd12a5da8 (bug 1766805)
2022-05-12 13:42:36 +03:00
Hiroyuki Ikezoe
098b8bc1a5 Bug 1766805 - Introduce intended direction and intended end position concepts. r=botond
The scroll snap spec defines the concepts [1]. There are three type of scroll
operations. 1) intended end position, 2) intended direction and end position
and 3) intended direction.

Basically our existing ScrollUnits types correspond;

1) DEVICE_PIXELS, WHOLE => intended end position
2) PAGES => intended direction and end position
3) LINES => intended direction

There are two exceptions in the `intended direction and end position` case,
scrollBy() and fling gestures (on Linux). They were defined as scroll operations
with DEVICE_PIXELS unit, but the spec cleary says they are `intended direction
and end position` operations.

Note that we will also use this information for scroll-snap-stop property since
the properly will only have effects on both 2) and 3) cases.

[1] https://drafts.csswg.org/css-scroll-snap/#scroll-types

Depends on D145190

Differential Revision: https://phabricator.services.mozilla.com/D145191
2022-05-12 07:45:59 +00:00
Emilio Cobos Álvarez
c9e3177022 Bug 1768157 - Remove kSelectPopupList. r=jwatt
It's unused since bug 1744009 at least, so no behavior change.

Depends on D145714

Differential Revision: https://phabricator.services.mozilla.com/D145715
2022-05-06 15:46:49 +00:00
Hiroyuki Ikezoe
64bbee7d38 Bug 1765895 - Make presshellId start from 1 rather than 0. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D144351
2022-04-22 02:06:12 +00:00
Emilio Cobos Álvarez
7de4ce1232 Bug 1763743 - Don't bail out from PresShell::DoScrollContentIntoView if there are no in-document scrollable ancestors. r=hiro
There are cases where we want to scroll across documents (like
scrollIntoView), and bailing out for those is incorrect. This
usually can't happen because in HTML documents we always have a root
scroll frame, but for fixed positioned elements it can happen, as those
are not parented to it.

This came up in https://github.com/w3c/csswg-drafts/issues/5492, and
fixes the only case where Firefox and Safari differ (C).

ScrollFrameRectIntoView knows how to deal with non-scroll-frames, and
takes care of jumping across documents if necessary, so passing the root
frame is fine. We only needed to walk out the parent chain to be able to
accumulate all our continuation bounds relative to the same frame.

In practice the bail out code should now be unreachable. Add an
assertion to that effect.

Tests for this are already upstream in WPT, and pass with this patch,
see:

 * https://github.com/web-platform-tests/wpt/pull/33572
 * https://github.com/web-platform-tests/wpt/pull/33633

Differential Revision: https://phabricator.services.mozilla.com/D143250
2022-04-20 08:29:51 +00:00
Daniel Holbert
20ee8c001c Bug 1764902: Add missing ifdef guard around initialization of diagnostic variable 'mAllocatedPointers'. r=jfkthame
Also, remove unnecessary/implied "#ifdef" in code-comment alongside #endif a
few lines below, for consistency with the similar code-comment that I'm adding
in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D143846
2022-04-15 21:42:03 +00:00
Daniel Holbert
c3ca004372 Bug 1759396 part 2: Use fallible allocation when inserting into PresShell::mAllocatedPointers, to avert OOMs in builds with diagnostic assertions. r=emilio
If allocation fails, we'll now just discard the entire contents of
mAllocatedPointers and stop using it going forward.

See the documentation alongside the mAllocatedPointers declaration (in this
patch) for more details.

Differential Revision: https://phabricator.services.mozilla.com/D143416
2022-04-12 23:57:07 +00:00
Daniel Holbert
abcfa0df24 Bug 1759396 part 1: Manage PresShell::mAllocatedPointers using a UniquePtr rather than as a direct member-variable. r=emilio
This patch doesn't change behavior.  As of this patch, this variable gets
instantiated immediately (in the PresShell constructor) and is never null, so
no logic/beheavior has changed.

This lays the groundwork for the next patch, which will add one case where this
variable does get nulled out (and add logic to handle that).

Differential Revision: https://phabricator.services.mozilla.com/D143411
2022-04-12 23:57:06 +00:00
Martin Robinson
2893cfed87 Bug 1762407 - Do not scroll content with content-visibility: hidden ancestors into view r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D142563
2022-04-07 10:38:27 +00:00
Ryan VanderMeulen
b9254aeca4 Bug 1762393 - Fix --disable-accessibility bustage in PresShell.cpp. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D142552
2022-03-31 17:14:53 +00:00
Emilio Cobos Álvarez
ea070a59f9 Bug 277178 - Move focus to a fragment identifier (#fragment) if it's focusable. r=smaug
Co-authored-by: Takeshi Kurosawa <taken.spc@gmail.com>

Differential Revision: https://phabricator.services.mozilla.com/D141824
2022-03-30 18:01:48 +00:00
Matteo Ruello
09684f492a Bug 1756529 - Honor general.smoothScroll.[line|page|other] for keyboard scrolls with MSD physics r=botond,hiro
Differential Revision: https://phabricator.services.mozilla.com/D140090
2022-03-22 04:16:32 +00:00
Julien Wajsberg
830ac30ee4 Bug 1752861 - [profiler] Rename and expose to JS some existing frame labels as well as adding a few r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D140389
2022-03-11 09:18:30 +00:00
Iulian Moraru
6df286bfe3 Backed out changeset 58f10ceb16ba (bug 1756529) for causing mochitest failures on test_group_keyboard.html. CLOSED TREE 2022-03-10 06:25:37 +02:00
Matteo Ruello
44f4c447d2 Bug 1756529 - Honor general.smoothScroll.[line|page|other] for keyboard scrolls with MSD physics r=botond,hiro
Differential Revision: https://phabricator.services.mozilla.com/D140090
2022-03-10 03:13:02 +00:00
Jan Varga
4b0b18b972 Bug 1757577 - Fix non-unified-build bustage in layout/base/PresShell.cpp; r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D139949
2022-03-04 12:40:23 +00:00
Timothy Nikkel
22b5bfa1de Bug 1756762. When the root scroll frame is destroyed, reset the visual viewport offset on it's presshell. r=botond
The regular scroll position restoration code will restore it.

Specifically, in ScrollFrameHelper::SaveState

https://searchfox.org/mozilla-central/rev/44ae61c5eeb150cb77b6b8511ceee7ddd6892cb7/layout/generic/nsGfxScrollFrame.cpp#7376

we store the visual viewport offset. ScrollFrameHelper::ScrollToRestoredPosition will try to restore both the layout scroll offset and the visual viewport offset by calling ScrollToWithOrigin (which leads to ScrollToImpl) and PresShell::ScrollToVisual respectively.

I observed the following sequence of events when running gfx/layers/apz/test/mochitest/browser_test_background_tab_load_scroll.js in one of the cases that it fails for me locally.

-ScrollFrameHelper::NotifyApzTransaction is called after sending a transaction to webrender, this sets mAllowScrollOriginDowngrade = true.
-the scroll frame is destroyed and re-created (I'm not sure why this destroy and re-create happened, I didn't investigate), we call SaveState and RestoreState. So now mLastScrollOrigin == Other, and mAllowScrollOriginDowngrade == true.
-the test calls ScrollBy, so we get a call to ScrollToImpl with aOrigin == Relative
-aOrigin gets changed to Other here https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#2979
-the code just below that determines that it is not a downgrade, so we update mLastScrollOrigin to Other (not a change) and set mAllowScrollOriginDowngrade = false
-ScrollFrameHelper::NotifyApzTransaction is _not_ called (probably because we are in a background tab), so mAllowScrollOriginDowngrade remains false
-the scroll frame is now at position 20000 and the visual viewport offset (stored on the presshell) is also 20000.
-the scroll frame is destroyed and re-created (this one I investigated, it's because the font subsystem has finished loading and asks for a global reconstruct https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/base/PresShell.cpp#9830), we call SaveState and RestoreState. So mLastScrollOrigin == Other, and mAllowScrollOriginDowngrade == true (the same values.
-we get a call to ScrollToRestoredPosition for the newly re-created scroll frame, we are trying to scroll from the current layout scroll position of 0 to the one we had before destruction and re-creation (20000). The visual viewport offset that is stored on the presshell has not been affected, it is still 20000.
-this gets to ScrollToImpl and with aOrigin == Restore
-we arrive at https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#3000 and Restore is a downgrade from Other, and mAllowScrollOriginDowngrade is false so we do not change mLastScrollOrigin (still Other) and mAllowScrollOriginDowngrade remains false
-we arrive at the code in ScrollToImpl that updates the visual viewport offset on the presshell https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#3232
-mLastScrollOrigin is Other, which can clobber apz, so we enter the if and add the difference between the before/after layout scroll position from this ScrollToImpl call (20000-0 = 20000) to the visual viewport offset (20000), getting 40000, which gets clamped to the max ~38000.
-and now the layout scroll position and the visual viewport offset have been detached when they shouldn't be.

If we reset the visual viewport offset when the scroll frame is destroyed we avoid the problem here.

Differential Revision: https://phabricator.services.mozilla.com/D139792
2022-03-01 01:51:27 +00:00
Timothy Nikkel
ed30449176 Bug 1753881. If the visual viewport offset hasn't been set on the presshell return the layout scroll position. r=botond
Because that is the correct value.

Differential Revision: https://phabricator.services.mozilla.com/D139472
2022-02-27 13:09:27 +00:00
Miko Mynttinen
017d02d0ff Bug 1714584 - Part 2: Remove nsDisplayList::RemoveBottom() r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138153
2022-02-22 23:42:18 +00:00
Miko Mynttinen
ddec6eef59 Bug 1714584 - Part 1: Decouple nsDisplayList internal list from nsDisplayItems r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138152
2022-02-22 23:42:18 +00:00
Norisz Fay
2121660ce9 Backed out 2 changesets (bug 1714584) per devs request for causing crashes a=backout
Backed out changeset 3baead3e079b (bug 1714584)
Backed out changeset a2da895a58ce (bug 1714584)
2022-02-22 16:41:57 +02:00
Miko Mynttinen
0bd7fc8c56 Bug 1714584 - Part 2: Remove nsDisplayList::RemoveBottom() r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138153
2022-02-22 00:44:25 +00:00
Miko Mynttinen
28474c7ad2 Bug 1714584 - Part 1: Decouple nsDisplayList internal list from nsDisplayItems r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138152
2022-02-22 00:44:25 +00:00
Miko Mynttinen
ad4c9a454d Bug 1722346 - Only append to the end/top of the display list r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D137894
2022-02-21 16:50:22 +00:00
Timothy Nikkel
d8a1ca407e Bug 1754437. Optimize FindViewContaining to avoid calling IsVisibleConsideringAncestors more often. r=emilio
Calling IsActive is quick, IsVisibleConsideringAncestors is not so quick.

If IsActive is false then that almost certainly means we'd hit the "not in the selected box of a deck frame" case in IsVisibleConsideringAncestors at

https://searchfox.org/mozilla-central/rev/b697834e78a3ef7613e2fa57c07624b1d9d1c909/layout/generic/nsIFrame.cpp#412

Differential Revision: https://phabricator.services.mozilla.com/D138291
2022-02-15 08:34:14 +00:00
Timothy Nikkel
d06a79ae14 Bug 1754436. Use nsXULPopupManager's list of visible popups to greatly speed up FindFloatingViewContaining. r=emilio
We only have to iterate over the open popups list (which is usually 0 or single digits) instead of every view.

Now that comboboxes definitely cannot create views, only xul menu popups can be floating popups.

Differential Revision: https://phabricator.services.mozilla.com/D138290
2022-02-13 08:18:45 +00:00
Nicklas Boman
ff6b6326b3 Bug 1725363 - Replace PL_strcasecmp with nsCRT::strcasecmp layout/ r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D129075
2022-01-26 09:57:46 +00:00
Noemi Erli
d795783f6e Backed out changeset 8739b71b8bd9 (bug 1740499) as requested by smaug 2022-01-20 22:21:32 +02:00
Emilio Cobos Álvarez
9db1237953 Bug 1750330 - Move global LookAndFeel changes to mozilla::LookAndFeel. r=mstange
So that the changes don't get lost when there's no PresShell in the
process.

Differential Revision: https://phabricator.services.mozilla.com/D136155
2022-01-17 16:34:11 +00:00
Olli Pettay
7751829b62 Bug 1740499, don't unsuppress so aggressively r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D134915
2022-01-17 11:16:26 +00:00
Timothy Nikkel
97ff865eba Bug 1749004. Call CancelManagedPostRefreshObservers after frame tree is destroyed. r=emilio
nsPresContest::RegisterManagedPostRefreshObserver still lets us add a managed post refresh observer until the mPresShell pointer on the prescontent is nulled out. That means that between the call to CancelManagedPostRefreshObservers and mPresContext->DetachPresShell() (which nulls out the mPresShell pointer on the prescontext) in PresShell::Destroy we can add a managed post refresh observer that will never get removed. Notably, destroying the frame tree happens between these two calls.

So move the CancelManagedPostRefreshObservers call to happen right after we null out the mPresShell pointer on the prescontext.

In bug 1737503 I want to add a managed post refresh observer when we destroy a subdocument frame (it's only interested in the recreate frames case not the destruction case, but not an easy way to tell them apart afaik), so it triggers this bug. The patch and test I have for that bug exercise this scenario.

Differential Revision: https://phabricator.services.mozilla.com/D135340
2022-01-12 12:59:44 +00:00
Emilio Cobos Álvarez
66f45bff6a Bug 1747927 - Minor ImageTracker cleanup. r=tnikkel
Don't bother going through the approximately visible image frames if the
locking state doesn't change.

Differential Revision: https://phabricator.services.mozilla.com/D134961
2022-01-04 13:30:18 +00:00
Emilio Cobos Álvarez
fac07284a9 Bug 1745869 - Grant 1s of activity to hidden OOPIF iframes. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D134804
2022-01-02 12:39:38 +00:00
Narcis Beleuzu
5125801679 Backed out 2 changesets (bug 1745869) for bc failures on browser_hidden_iframe.js . CLOSED TREE
Backed out changeset e2dd2ff842fa (bug 1745869)
Backed out changeset 0d2bf1bbda4f (bug 1745869)
2021-12-31 00:27:32 +02:00
Emilio Cobos Álvarez
340752fa3d Bug 1745869 - Undo a change that unintentionally subtly changes behavior (makes one test fuzzy).
MANUAL PUSH: Trivial orange fix CLOSED TREE.
2021-12-30 19:28:16 +01:00
Emilio Cobos Álvarez
918836b8f6 Bug 1745869 - Grant 1s of activity to hidden OOPIF iframes. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D134804
2021-12-30 15:14:22 +00:00
Kagami Sascha Rosylight
c5662e876e Bug 1539884 - Part 37: Add strong references for arguments in callers r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D134475
2021-12-23 16:27:26 +00:00
Emilio Cobos Álvarez
a6fb6742a0 Bug 1744749 - Add an API to get the real canvas background color. r=jwatt
Extensions are using getComputedStyle(body).backgroundColor, which is
wrong at multiple levels.

The one that matters for this bug is that it is not color-scheme aware.

Depends on D133770

Differential Revision: https://phabricator.services.mozilla.com/D133771
2021-12-16 14:56:32 +00:00
Markus Stange
73365a9d4a Bug 987030 - Remove unused mDelayedPaintTimer. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D134001
2021-12-16 11:40:28 +00:00
Emilio Cobos Álvarez
66891aabb4 Bug 1744749 - Clean-up IsTransparentContainerElement. r=layout-reviewers,boris
No behavior change (you can't have an in-process frame container and a
BrowserChild at the same time), but avoids some needless refcounting
overhead and makes it simpler to follow.

Differential Revision: https://phabricator.services.mozilla.com/D133770
2021-12-16 11:09:09 +00:00
Timothy Nikkel
ff409060a7 Bug 1707983. Refresh zoom constraints from UIResolutionChanged notification because it gets called when we swap docshells and get a new APZC tree manager. r=botond
I guess we need to do this every time we get a new APZC tree manager (because that is where the zoom constraints map/cache is stored). I'm not sure how to detect that or if there are other cases we haven't covered.

Differential Revision: https://phabricator.services.mozilla.com/D113608
2021-12-09 10:06:57 +00:00
Masayuki Nakano
82e2013683 Bug 1735446 - part 4: Make Selection::GetRangeAt() take uint32_t instead of int32_t r=smaug
It's an internal API corresponding to `Selection.getRangeAt` DOM API.
I think that it should use `uint32_t` rather than `size_t` because of the
consistency with the DOM API and `Selection::RangeCount()`.

This patch fixes all callers of `GetRangeAt()`, and rewrites it with ranged-
loops unless original ones do not refer `RangeCount()` every time and may run
script in the loop.

Differential Revision: https://phabricator.services.mozilla.com/D128848
2021-12-09 07:35:09 +00:00
Mike Hommey
8e411675ac Bug 1744877 - Remove --disable-xul. r=Gijs
Building with --disable-xul has been busted since _at least_ bug
1082579, for more than 7 years (I didn't try to track that down
further). It's time to recognize that the option serves no purpose.

Differential Revision: https://phabricator.services.mozilla.com/D133161
2021-12-08 21:37:11 +00:00
Emilio Cobos Álvarez
c2c592e87f Bug 1741089 - Make attachShadow() not reframe the shadow host unconditionally. r=smaug
We only need to clean up the frames for its flat tree children which are
about to go away from the flat tree, but we don't need to do anything
else. This avoids issues with the following patches because menupopups
depend a lot on their frame tree state.

Differential Revision: https://phabricator.services.mozilla.com/D131083
2021-11-16 16:34:51 +00:00
Andi-Bogdan Postelnicu
c8e0f87391 Bug 1519636 - First reformat with clang-format 13.0.0. r=firefox-build-system-reviewers,sylvestre,mhentges
Updated with clang-format version 13.0.0 (taskcluster-OgjH5lasS5K_fvefdRcJVg)

Depends on D131114

Differential Revision: https://phabricator.services.mozilla.com/D129119
2021-11-16 08:07:30 +00:00
Emilio Cobos Álvarez
1d22fb4ae5 Bug 1732674 - Assert on tree mutations. r=jfkthame
This should hopefully help catch misuse. Fix an iterator that was living
for too long in ScrollIntoView.

Differential Revision: https://phabricator.services.mozilla.com/D128855
2021-11-09 15:55:55 +00:00
Hiroyuki Ikezoe
33d1f8ef64 Bug 1739541 - Set TriggerByScript::Yes for Element.scrollIntoView. r=botond
We'd want to differentiate Element.scrollIntoView call as `triggeredByScript`.

Differential Revision: https://phabricator.services.mozilla.com/D130419
2021-11-09 09:19:25 +00:00
Hiroyuki Ikezoe
e5085ada71 Bug 1738839 - Drop layout.css.scroll-behavior.enabled. r=dholbert
It's been enabled by default for years since bug 1087559.

Differential Revision: https://phabricator.services.mozilla.com/D130147
2021-11-02 06:58:47 +00:00
Emilio Cobos Álvarez
4c732f8b08 Bug 1719150 - Push delayed mouse event to the right pres shell. r=smaug
Otherwise if we get an event targeting a different suppressed pres shell
while we're unsuppressing we might get stuck delaying the event over and
over, see the links in comment 33.

Not sure how to get a repro for this, the patch is written based on the
pernosco session, but suggestions welcome.

Differential Revision: https://phabricator.services.mozilla.com/D130100
2021-11-01 19:29:01 +00:00
Emilio Cobos Álvarez
1421e7f545 Bug 1525107 - Make Canvas/CanvasText and Link colors color-scheme-aware. r=dholbert
For that, add `.dark` version of the browser.display* prefs that control
the light version of these colors.

The default for background/foreground colors are taken from the
GenericDarkColors used in LookAndFeel.

The defaults for links are based on this discussion:

  https://github.com/whatwg/html/issues/5426#issuecomment-904021675

(So they effectively match Chrome).

Whether the dark colors should be exposed in about:preferences (like the
light colors are) is TBD.

With this patch, we pass all the tests in:

  /html/semantics/document-metadata/the-meta-element/color-scheme/

Use the colors to paint the default canvas background and the default
colors.

There are three "regressions", though they are really progressions: we
now render the reference as the test expects (before we rendered a light
canvas background even for the reference).

Apart of these iframe tests (which we should look into, I filed
https://bugzilla.mozilla.org/show_bug.cgi?id=1738380), there are three
remaining test failures.

Two of them are due to `color: initial` not changing based on the
color-scheme. Safari also fails these tests, and the thing they're
really testing is whether system colors are preserved at computed-value
time:

  https://github.com/w3c/csswg-drafts/issues/3847

Regarding that change, I'm not so sure the trade-offs there are worth
it, as that not only complicates interpolation (we wouldn't be able to
use system colors in color-mix among others, see
https://github.com/w3c/csswg-drafts/issues/5780) plus it changes
inheritance behavior in sorta unexpected ways, see:

  https://github.com/w3c/csswg-drafts/issues/6773

Which I just filed because apparently no browser implements this
correctly. So for now will punt on those (keep matching Safari).

There's an svg-as-image test:

  https://searchfox.org/mozilla-central/rev/f8576fec48d866c5f988baaf1fa8d2f8cce2a82f/testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/svg-as-image.html

Which isn't using the feature at all and I'm not sure why is it supposed
to pass (why prefers-color-scheme: dark is supposed to match that SVG
image). This test fails in all browsers apparently:

  https://wpt.fyi/results/css/css-color-adjust/rendering/dark-color-scheme/svg-as-image.html?label=master&label=experimental&aligned

I sent https://github.com/web-platform-tests/wpt/pull/31407 to remove
it and hopefully get it reviewed by some Chromium folks.

Differential Revision: https://phabricator.services.mozilla.com/D129746
2021-10-29 19:58:25 +00:00
Norisz Fay
489e82dcc1 Backed out 2 changesets (bug 1732674) for line iterator crashes (bug 1733047) a=backout
Backed out changeset 730555699380 (bug 1732674)
Backed out changeset f529288a6dde (bug 1732674)
2021-10-20 12:24:14 +03:00
Emilio Cobos Álvarez
cfc9af581b Bug 1732674 - Assert on tree mutations. r=jfkthame
This should hopefully help catch misuse. Fix an iterator that was living
for too long in ScrollIntoView.

Differential Revision: https://phabricator.services.mozilla.com/D128855
2021-10-19 09:29:13 +00:00
Jeff Muizelaar
f76f41feb4 Bug 1736236 - Remove obsolete LayerManager.h. r=gfx-reviewers,lsalzman
This adds a bunch of #include "WindowRenderer.h" in places
that were getting it implicitly before.

Differential Revision: https://phabricator.services.mozilla.com/D128687
2021-10-17 23:00:47 +00:00
Emilio Cobos Álvarez
fb8e2b5796 Bug 1736038 - Simplify some color-scheme handling in core. r=mstange
Remove the follow-firefox-theme pref as now that's default everywhere,
and document better the behavior of the color-scheme property by
reworking and commenting the logic on it a bit.

Differential Revision: https://phabricator.services.mozilla.com/D128610
2021-10-15 16:53:08 +00:00
Emilio Cobos Álvarez
b2699f72ee Bug 1670480 - Ensure look-and-feel-changed listeners can rely on LookAndFeel values returning updated styles. r=jwatt
We have JS listeners that are expected to run once the LookAndFeel
caches have been cleared and such, so split the look-and-feel-changed
notification into an internal and external notification.

Differential Revision: https://phabricator.services.mozilla.com/D128097
2021-10-12 09:22:49 +00:00
Morgan Reschenberg
8ec999d32d Bug 1726227: Cache parent-relative accessible bounds, resolution in parent process r=Jamie,eeejay
Differential Revision: https://phabricator.services.mozilla.com/D123399
2021-10-05 20:44:46 +00:00
Butkovits Atila
0db4640a28 Backed out 2 changesets (bug 1732154, bug 1726227) for causing build bustages complaining about RemoteAccessible. CLOSED TREE
Backed out changeset 4fd72f9ca327 (bug 1732154)
Backed out changeset 6591f14bbc71 (bug 1726227)
2021-10-05 00:19:09 +03:00
Morgan Reschenberg
c2cac47ff1 Bug 1726227: Cache parent-relative accessible bounds, resolution in parent process r=Jamie,eeejay
Differential Revision: https://phabricator.services.mozilla.com/D123399
2021-10-04 19:46:54 +00:00
Daniel Holbert
ed93bd5007 Bug 1733465 part 2: Modernize nsViewManager::GetRootWidget() to use already_AddRefed return value, instead of requiring getter_AddRefs at callsite. r=tnikkel
This patch shouldn't change behavior at all.

This patch replaces a manual NS_ADDREF call with typesafe code that manages the
reference count for us.  This reduces repeated boilerplate code, in the
implementation as well as the callsites.

Differential Revision: https://phabricator.services.mozilla.com/D127179
2021-10-01 20:38:09 +00:00
Sandor Molnar
325902a5b7 Backed out 5 changesets (bug 1733465) for causing android build bustages in android/SessionAccessibility.cpp. CLOSED TREE
Backed out changeset 4c5b28b66740 (bug 1733465)
Backed out changeset 3db0452b185c (bug 1733465)
Backed out changeset d7460c9c6acb (bug 1733465)
Backed out changeset 3cee3f595e45 (bug 1733465)
Backed out changeset 267d5fc92f12 (bug 1733465)
2021-10-01 19:13:59 +03:00
Daniel Holbert
5b203843bc Bug 1733465 part 2: Modernize nsViewManager::GetWidget() to use already_AddRefed return value, instead of requiring getter_AddRefs at callsite. r=tnikkel
This patch shouldn't change behavior at all.

This patch replaces a manual NS_ADDREF call with typesafe code that manages the
reference count for us.  This reduces repeated boilerplate code, in the
implementation as well as the callsites.

Differential Revision: https://phabricator.services.mozilla.com/D127179
2021-10-01 14:37:05 +00:00
Emilio Cobos Álvarez
b2c03de0cc Bug 1730351 - Fix reflow root handling in presence of inherited changes in FrameNeedsReflow. r=layout-reviewers,jfkthame
The issue here is that we don't clear the cached intrinsic size of the
flex item, but this reproduces without flex at all.

The main issue is that we choose whether to clear the intrinsic sizes
from a reflow root (the outer svg in this case) based on whether the
reflow changes size or position:

  https://searchfox.org/mozilla-central/rev/3fa5cc437a4937c621ea068ba5dc246f75831633/layout/base/RestyleManager.cpp#1224-1229

This is ~fine, except the nsChangeHint_ReflowChangesSizeOfPosition hint
can be "inherited" (and thus be cleared if already subsumed by a
parent):

  https://searchfox.org/mozilla-central/rev/3fa5cc437a4937c621ea068ba5dc246f75831633/layout/base/nsChangeHint.h#465-469

This is ~fine, as we'll already start the reflow further up the tree (so
we don't need to start go past the reflow root), but we still need to
clear the ancestor intrinsics. We still get to StyleChangeReflow with
the ClearAncestorIntrinsics hint. We could pass that information down,
but the information is really already in via the IntrinsicChange.

I think it's just not correct to stop clearing intrinsic sizes if the
target is a reflow root and we get a TreeChange/StyleChange, regardless
of whether it changes size/position. It should also be a few less
instructions, though not that it matters.

Depends on D126812

Differential Revision: https://phabricator.services.mozilla.com/D126813
2021-09-29 10:16:10 +00:00
Olli Pettay
a20bf5465f Bug 1731132, unsuppress painting on top level content presshells sooner, r=emilio
Unsuppressing is done only if the page can use stylesheet cache. That should mean the
load isn't a cold load and also some other resources may be cached and thus
painting could happen sooner.

There is currently a regression around dom.ipc.processCount.webIsolated handling, but the
testing has been done with dom.ipc.processCount.webIsolated==1, and the patch for bug 1731792
should give back similar behavior as what process count 1 has.

Differential Revision: https://phabricator.services.mozilla.com/D125878
2021-09-28 12:04:42 +00:00
Matt Woodrow
2572ff38a4 Bug 1725267 - Split Paint entry points to make them easier to understand. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D125800
2021-09-22 03:36:52 +00:00
Matt Woodrow
5d982b06d4 Bug 1725267 - Remove paint compression. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D125799
2021-09-22 03:36:51 +00:00
Matt Woodrow
997a59ac07 Bug 1725267 - Remove unused NO_COMPOSITE. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D125798
2021-09-22 03:36:51 +00:00
Matt Woodrow
74122b5d9d Bug 1725267 - Remove PresShell::Composite. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D125797
2021-09-22 03:36:50 +00:00
Matt Woodrow
9773c606a4 Bug 1725267 - Remove unused region from PresShell::Paint. r=tnikkel
PaintFrame only uses the input region if !WidgetLayers, which Paint always passes.

Differential Revision: https://phabricator.services.mozilla.com/D125795
2021-09-22 03:36:50 +00:00
Hiroyuki Ikezoe
5dd44bf2b5 Bug 1727674 - Track frame visibility in OOP iframes. r=tnikkel
One caveat is that this change doesn't mean we handle frame visibility in
iframes in a same manner regardless whether the iframe is out-of-process or not.
In fact, we handle OOP iframe cases in a slightly different way since in OOP
iframes if the iframe is invisible because it's scrolled out or some such, then
we can't tell how far the iframe is from the visible scroll port. For example;

```
<div style="height: 100px; overflow: scroll;">
  <div id="spacer" style="width: 100%; height: 200px;"></div>
  <iframe style="height: 100px;"></iframe>
</div>
```

In this case, we consider all frames inside the iframe are invisible because
the iframe position is out of our frame visibility tracking margins. But if
the #spacer element's height is 100px, we consider all frames inside the iframe
viewport are visible if the iframe is in-process iframe, whereas we consider
all frames are invisible if the iframe is out-of-process iframe.

So in short, the frame visibilityn inside OOP iframes is depending on whether
the iframe gets painted in the parent document, i.e. depending on display port
and other factors controlling the paint stuff, the visibility inside in-process
iframes is depending on same factors for normal scrollable frames.

Differential Revision: https://phabricator.services.mozilla.com/D125125
2021-09-22 00:57:14 +00:00
Butkovits Atila
4b46b9b45b Backed out 3 changesets (bug 1719939, bug 1726437, bug 1730262) for causing failures on test_browserGlue_migration_ctrltab_recently_used_order.js.
Backed out changeset ea1653e9644f (bug 1719939)
Backed out changeset 01f90db715a7 (bug 1726437)
Backed out changeset c0e23b2acfbb (bug 1730262)
2021-09-21 05:15:31 +03:00
Junjie Ying
9b3839d3ba Bug 1719939 - Remove last fragments of code manually checking the browser.proton.enabled pref. r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D125345
2021-09-21 00:03:49 +00:00
Daniel Holbert
4aad1df71f Bug 1730741 part 1: Export MobileViewportManager's LazyLogModule in a more structured way. r=botond
Before this patch, PresShell.cpp tries to reuse a LazyLogModule that's defined
in MobileViewportManager.cpp, which isn't actually declared in any header.  This
prevents the build from linking, unless we're lucky enough to have these two
source files concatenated together via our unified build.

This patch promotes this LazyLogModule to be an actual static member-var on the
MobileViewportManager class, so that it can be exported and used externally in
a more structured way.  This makes it consistent with the very-similar
"PresShell::gLog" member-variable.

Differential Revision: https://phabricator.services.mozilla.com/D125600
2021-09-15 18:48:16 +00:00
Emilio Cobos Álvarez
580e65503f Bug 1729292 - Honor scroll margin of host when we're scrolling to a chrome-only-access element. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124691
2021-09-07 08:24:59 +00:00
Matt Woodrow
d41e38aec0 Bug 1727682 - Make WebRenderLayerManager not inherit LayerManager. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D124433
2021-09-05 22:36:45 +00:00
Matt Woodrow
de15de8fe8 Bug 1728914 - Convert painting entrance points to use WebRenderLayerManager directly. r=gfx-reviewers,aosmond
Depends on D124417

Differential Revision: https://phabricator.services.mozilla.com/D124418
2021-09-05 02:16:37 +00:00
Andrew Creskey
46162554f6 Bug 1717920 - Add scrolling metrics to history metadata r=mossop,botond,edgar
Disabled by default, browser.places.interactions.enabled, this adds scrolling metrics (time spent scrolling and distance scrolled) to the history metadata.

Differential Revision: https://phabricator.services.mozilla.com/D120656
2021-09-02 14:11:56 +00:00
Timothy Nikkel
1e3e2b9d7c Bug 1728682. Use IsRootContentDocumentCrossProcess in PresShell::EventHandler::GetFrameToHandleNonTouchEvent. r=botond
Decisions about visual or layout viewport type coordinates are made based on cross process root content docoument (not in process).

Differential Revision: https://phabricator.services.mozilla.com/D124271
2021-09-02 00:11:37 +00:00
Timothy Nikkel
811a40dcf5 Bug 1728674. Use IsRootContentDocumentInProcess in frame visibility code. r=hiro
Bug 1649367 missed this one call site.

Differential Revision: https://phabricator.services.mozilla.com/D124262
2021-09-01 23:24:08 +00:00
Jonathan Kew
c7fdc790cc Bug 1725297 - Remove expiring font telemetry probes. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D124051
2021-08-31 13:48:51 +00:00
Matt Woodrow
5c99a19709 Bug 1727683 - Remove LayerTreeInvalidation. r=jrmuizel
Depends on D123881

Differential Revision: https://phabricator.services.mozilla.com/D123882
2021-08-28 03:54:23 +00:00
Emilio Cobos Álvarez
cfca657d9c Bug 1722487 - Avoid some work for font list updates. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D123363
2021-08-26 23:17:54 +00:00
Jeff Muizelaar
2937dbb0e1 Bug 1727395 - Remove unused ClientLayerManager.h includes. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D123518
2021-08-24 19:27:26 +00:00
Matt Woodrow
0ee96e3fa5 Bug 1726291 - Remove FrameLayerBuilder. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D122930
2021-08-23 03:07:31 +00:00
Emilio Cobos Álvarez
8d2808b5c9 Bug 1722487 - Improve preference change handling code to be faster. r=jfkthame
Remove the need to post a runnable to coalesce them (we still coalesce
theme changes because those do non-trivial work).

What can go on is that on cold load we load the font list async, and
that goes through this code via a faked font.internaluseonly.changed
pref change, which stores a reframe change hint in
mChangeHintForPrefChange.

If the page flushes after this code runs, but before the next refresh
driver tick, we will be just wasting work. So instead do the
RebuildAllStyleData call synchronously. It just schedules a flush and
posts a hint, so it doesn't do the work right there, but makes the next
flush do the work as needed, so it should be faster and also more
correct.

Also improve handling of preference sheet prefs and such to avoid more
wasted work when we go through this code, as the assumption their
handling was doing was that it gets called infrequently, but it's not
the case due to the font list updates.

Differential Revision: https://phabricator.services.mozilla.com/D123103
2021-08-20 13:03:40 +00:00
Cosmin Sabou
b53abb88e7 Backed out changeset e111894317cc (bug 1726291) for causing assertion failures on WebRenderCommandBuilder.cpp. CLOSED TREE 2021-08-20 06:22:40 +03:00
Matt Woodrow
94015526e1 Bug 1726291 - Remove FrameLayerBuilder. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D122930
2021-08-20 02:20:39 +00:00
Nicklas Boman
ec22be8442 Bug 1724526 - Remove uses of PL_strchr in layout code r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D122060
2021-08-18 08:28:49 +00:00
Jonathan Kew
f1d0b4bbe4 Bug 1725940 - patch 2 - Move nsFontCache from the device context to the prescontext. r=emilio
To look up/instantiate platform fonts based on CSS font properties, we create a gfxFontGroup from an nsFont and other attributes; this is currently cached in an nsFontCache attached to the nsDeviceContext.

However, this assumes that the mapping to platform fonts will be the same for all documents using the given device context. In a world where visibility of platform fonts to the page may be restricted, and may depend on the individual document (e.g. if the user disables tracking protection for a particular site), the mapping represented by nsFontCache may vary, and determining how to resolve a given font request will need access to the requesting document in order to know what visibility it is allowed.

To support this, this patch moves the nsFontCache from nsDeviceContext to nsPresContext. In itself, this should cause no visible change in behavior, but it provides a basis for the patches that will follow in bug 1715501.

It's likely that this will have some effects on individual performance tests, depending on the exact content and sequencing of page loads, because of changed caching behavior. E.g. having a per-presContext cache may sometimes mean that we no longer take advantage of a cached gfxFontGroup that a previously-loaded page created; but on the other hand the caches will tend to be smaller and have faster lookups.

My testing so far suggests that we will see some apparent regressions, alongside some improvements, but that overall there should be little change. I'd like to get this change landed separately, before any of the actual font-visibility behavior changes, so that we can more clearly see and isolate any unexpected effects.

Differential Revision: https://phabricator.services.mozilla.com/D122715
2021-08-16 13:58:03 +00:00
Matt Woodrow
9b4a2add9f Bug 1724848 - Make sure we unconditionally invalidate the widget and request a composite when the refresh driver tries to paint a fallback renderer. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D122391
2021-08-11 23:45:32 +00:00
Jan Henning
6a54fe3b58 Bug 1685756 - Part 3: Take default scale into account when disabling font inflation. r=hiro
Font inflation isn't required for pages whose viewport is narrow enough that we
don't have to zoom *out* when doing zoom-to-fit.

As the viewport scale is given as a CSSToScreenScale, this means that what we're
actually doing at the moment, though, is comparing the width of the viewport in
CSS pixels to the width of the screen in physical pixels, *without* taking the
default scale on a high-DPI device into account.

This issue affects neither pages using a "width=device-width" viewport (the
IsAutoSizeEnabled() check handles those), nor pages without an explicitly
specified viewport at all (the viewport info returns the minimum zoom level in
that case, i.e. 25 %, which would therefore require a device scale of > 4 in
order for us to erroneously turn off font inflation - even modern phones don't
seem to quite reach *that* sort of pixel density, e.g. a Pixel 5 only reports a
default scale of ~2.73.

For pages with an explicitly sized viewport this can however mean that we turn
off font inflation too early: Slashdot e.g. uses "width=1000", which means that
on a phone with a 720 px screen font inflation is correctly enabled, but on a
different phone squeezing 1080 px into the same physical screen width (i.e.
higher DPI, but *not* a physically larger screen), font inflation is suddenly
and incorrectly turned off.

Differential Revision: https://phabricator.services.mozilla.com/D122059
2021-08-10 19:36:24 +00:00
Jan Henning
030f9901f0 Bug 1685756 - Part 1: Use content viewer size for determining font inflation state. r=hiro
For pages with an explicitly sized viewport, whether or not we enable font
inflation depends on whether the viewport is larger than content viewer size (so
it will be displayed zoomed out) or not.

For historical reasons, so far we've used the screen size as a proxy for the
content viewer size. On a phone this is a reasonable approximation (albeit a bit
less so now that Android also offers split-screen and picture-in-picture modes),
but when testing/debugging on a desktop computer, this means that the results
will depend on the screen size of the machine in question, which makes it rather
hard writing sensible test cases for that scenario.

Therefore, we're finally following up with that TODO comment in the existing
code and start using the content viewer size of the top-level document instead.
Fission means that approach won't easily work for cross-process iframes, but
given that the current calculations don't make much sense for frames anyway, we
just accept that limitation, since a proper solution as per bug 1724311 would
obsolete any work done here anyway.

Differential Revision: https://phabricator.services.mozilla.com/D122057
2021-08-10 19:36:23 +00:00
Boris Chiou
f5ebaf749a Bug 1689099 - Schedule resize observers for the whole browsing context tree. r=emilio
It's possible to observe an element in the iframe while the
ResizeObserver object lives in the outer document, so we have to make
sure we also schedule the observer for all documents in the same
BrowsingContext tree.

Differential Revision: https://phabricator.services.mozilla.com/D119843
2021-08-09 19:48:13 +00:00
Kagami Sascha Rosylight
0b5d4cebd4 Bug 1635018 - Part 1: Limit dragexit event to chrome on Nightly r=edgar,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D121189
2021-08-05 14:33:38 +00:00
Matt Woodrow
9558b10a83 Bug 1722258 - Add FallbackRenderer to replace BasicLayerManager usage. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D120921
2021-08-05 06:48:34 +00:00
Matt Woodrow
4b6db2ad05 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D120920
2021-08-05 06:48:34 +00:00
Matt Woodrow
9b81728dc2 Bug 1722258 - Split out fallible composite-only path of PresShell::Paint. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D120919
2021-08-05 06:48:33 +00:00
Hiroyuki Ikezoe
a7abbb66f2 Bug 1718012 - Call UpdateSizesBeforeReflow only for resize reflow cases and set MobileViewportManager::mMobileViewportSize even if mDisplaySize hasn't been changed in UpdateSizesBeforeReflow. r=tnikkel
In the case of reflowing caused by full zoom changes, the mDisplaySize isn't
changed, whereas mMobileViewportSize should be changed.

Differential Revision: https://phabricator.services.mozilla.com/D120190
2021-08-02 21:27:19 +00:00
Alexandru Michis
326297bd47 Backed out changeset e41bfdf79fb8 (bug 1665476) for causing windows mochitest failures in test_windowminmaxsize.xhtml
CLOSED TREE
2021-08-02 02:14:52 +03:00
Emilio Cobos Álvarez
275707a51b Bug 1665476 - Remove nsRootBoxFrame to unify background propagation between XUL and non-XUL documents. r=layout-reviewers,mats
It's unused on mozilla-central, and Thunderbird can just use the canvas
frame as regular (X)HTML documents, so just use a canvas frame instead
of an nsRootBoxFrame for XUL as well.

nsRootBoxFrame was needed because of various XUL-specific things like
tooltips and so on lived there. But with the move away from XUL, that
functionality has been added to nsCanvasFrame already, behind a
principal check instead.

This also allows simplifying our background propagation setup, which was
only half-working for XUL documents (this bug is a consequence of that).

With this, most of the callers of nsCSSRendering::IsCanvasFrame can go.
They're only two of the frames that would return true for that that
actually paint backgrounds (nsCanvasFrame and nsRootBoxFrame), so the
codepaths in display list building and painting can just check
frame->IsCanvasFrame() instead.

The remaining caller to that function is
nsContainerFrame::SyncWindowProperties, and the change is also legit, in
the sense that the only thing SyncWindowProperties() really cares about
is propagating the max/min-width constraints from the root element's
style to the view/widget, and the only frame that would return true from
IsCanvasFrame and have a view is the viewport frame which is the root of
the frame tree.

Differential Revision: https://phabricator.services.mozilla.com/D90846
2021-08-01 21:57:28 +00:00
Emilio Cobos Álvarez
edad6cfc6f Bug 1677324 - Keep painting the of the old remote frame when going into the bfcache until the child unsuppresses painting. r=nika
This should pretty much match our non-fission behavior. I found the
original approach of keeping the frameloader from nsSubDocumentFrame
quite hard to get green on try unfortunately, because among other
things, the new frameloader wouldn't get the right viewport sizes /
position / etc.

Differential Revision: https://phabricator.services.mozilla.com/D121198
2021-08-01 21:45:56 +00:00
Csoregi Natalia
bc4c680c8d Backed out 3 changesets (bug 1722258) for causing Bug 1722935. a=backout
Backed out changeset cf8a1175abd1 (bug 1722258)
Backed out changeset 41176d476eb7 (bug 1722258)
Backed out changeset 4149d596d03d (bug 1722258)
2021-07-29 20:19:48 +03:00
Dorel Luca
a2153c3bb7 Backed out changeset 21ac9225dd4b (bug 1718012) for WPT failures in css/css-values/viewport-units-css2-001.html. CLOSED TREE 2021-07-29 01:00:39 +03:00
Hiroyuki Ikezoe
3dc9a18f9b Bug 1718012 - Call UpdateSizesBeforeReflow only for resize reflow cases and set MobileViewportManager::mMobileViewportSize even if mDisplaySize hasn't been changed in UpdateSizesBeforeReflow. r=tnikkel
In the case of reflowing caused by full zoom changes, the mDisplaySize isn't
changed, whereas mMobileViewportSize should be changed.

Differential Revision: https://phabricator.services.mozilla.com/D120190
2021-07-28 21:04:31 +00:00
Matt Woodrow
0c782c8447 Bug 1722258 - Add FallbackRenderer to replace BasicLayerManager usage. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D120921
2021-07-28 20:58:23 +00:00
Matt Woodrow
7cd494afba Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D120920
2021-07-28 20:58:22 +00:00
Matt Woodrow
d3dadfe348 Bug 1722258 - Split out fallible composite-only path of PresShell::Paint. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D120919
2021-07-28 20:58:22 +00:00
Sandor Molnar
307d5a322a Backed out changeset 1b29d7a6d15c (bug 1718012) for causing crashtest failures. CLOSED TREE 2021-07-28 09:24:58 +03:00
Hiroyuki Ikezoe
d1f9b6d6e9 Bug 1718012 - Call UpdateSizesBeforeReflow only for resize reflow cases and set MobileViewportManager::mMobileViewportSize even if mDisplaySize hasn't been changed in UpdateSizesBeforeReflow. r=tnikkel
In the case of reflowing caused by full zoom changes, the mDisplaySize isn't
changed, whereas mMobileViewportSize should be changed.

Differential Revision: https://phabricator.services.mozilla.com/D120190
2021-07-28 05:02:30 +00:00
Aaron Klotz
022c804b33 Bug 1690296: Add callback to notify app to fully display its dynamic toolbar; r=agi,owlish,hiro
* Per advice from Emilio on Matrix, I consolidated overflow checks into `ScrollFrameHelper::GetOverflowState()`.
* In `ScrollFrameHelper::ReflowFinished` we detect the condition requring the app to expand the toolbar.
  (Hiro, I know that you suggested a second place to detect this. If you feel that it is important enough to add that,
   we'd prefer filing a follow-up bug in Layout for that case that your team can follow up on.)
* We then propagate the notification through `PresShell`, up through `PBrowser`, through the `nsWindow`, then into the `GeckoSession`
* We invoke a new method on the `ContentDelegate`. This seemed like the reasonable delegate to use given other existing
  callbacks in the similar vein (such as going fullscreen), but let me know if this should go elsewhere.
* We update GVE and JUnit tests to test this.

Differential Revision: https://phabricator.services.mozilla.com/D120499
2021-07-27 21:50:03 +00:00
Matt Woodrow
912b7f8ef1 Bug 1721537 - Split out WindowRenderer base class from LayerManager. r=miko
Depends on D120439

Differential Revision: https://phabricator.services.mozilla.com/D120440
2021-07-22 22:58:57 +00:00
Miko Mynttinen
746fe9865a Bug 1720711 - Remove most nsDisplayItem::GetAbove() calls r=mattwoodrow
Replaces direct linked list traversals with iterators.

Differential Revision: https://phabricator.services.mozilla.com/D119985
2021-07-16 10:55:03 +00:00
Botond Ballo
b63b45d2f9 Bug 1712400 - Account for the resolution in the enclosing document when positioning and sizing the drag preview image when dragging content in a nested content process. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D119358
2021-07-10 17:23:20 +00:00
Timothy Nikkel
66292dac3b Bug 1681692. In FindViewContaining we are only crossingZoomBoundary if we start in visual coordinates. r=botond
In the most common case the first call to FindViewContaining has aRelativeToView = aView = the root view of the root content document, and we start in visual coords. Then we convert to layout coords and call FindViewContaining recusively with aRelativeToView = the root view again, aView = a child of the root view and working in layout coords. And we still satisfy the conditions to set crossingZoomBoundary to true, which is incorrect because we already crossed. We need to check that we are also in visual coords.

Differential Revision: https://phabricator.services.mozilla.com/D105438
2021-07-09 10:06:00 +00:00
Emilio Cobos Álvarez
7ee0e2d6e4 Bug 1719375 - Consider documents used-as-an-image always active. r=tnikkel
These are ticked when painted, so it is fine and it's effectively what
happened before bug 1717983 (because we didn't get into this condition:
https://hg.mozilla.org/mozilla-central/rev/cb704553fc64#l3.73).

Differential Revision: https://phabricator.services.mozilla.com/D119314
2021-07-08 12:54:48 +00:00
Emilio Cobos Álvarez
a381488865 Bug 1719571 - Don't use null as a fallback when there's no doc uri.
Differential Revision: https://phabricator.services.mozilla.com/D119387
2021-07-08 11:14:57 +00:00
Emilio Cobos Álvarez
6fc3e06d85 Bug 1719440 - Add some logging for PresShell activeness. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D119262
2021-07-07 10:30:11 +00:00
Hiroyuki Ikezoe
ba5ded4486 Bug 1700245 - Use IsAncestorFrameCrossDocInProcess in PresShell::ClearMouseCapture(nsIFrame*). r=tnikkel
Since bug 1717726 we've disallowed having remote <browser> or remote <iframe>
inside nsDeckFrame which means `captureingFrame` in ClearMouseCapture(nsIFrame*)
function will never be called in an out-of-process thus we can use
IsAncestorFrameCrossDocInProcess there.

Also add an assertions that the function gets called only with a child frame of
nsDeckFrame since this function is used only inside nsDeckFrame.

Depends on D119068

Differential Revision: https://phabricator.services.mozilla.com/D119069
2021-07-06 08:58:56 +00:00
Hiroyuki Ikezoe
1fa23c1c89 Bug 1700245 - Split PresShell::ClearMouseCapture into two functions, one takes nsIFrame, the other takes no argument. r=tnikkel
Depends on D119067

Differential Revision: https://phabricator.services.mozilla.com/D119068
2021-07-06 08:58:55 +00:00
Emilio Cobos Álvarez
0c7b4c828a Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
GeckoView always calls preserveLayers(true) on all <browser> elements,
which causes the puppet widget to always be considered visible.

Given how the code worked before, aBrowsingContext.isActive = false
after that call would deactivate the pres shell, but after my patch it
stops doing so.

We don't really want to un-throttle the refresh driver etc just because
we're preserving layers, so propagate the state to the child process and
account for that in the logic to determine PresShell activeness.

Depends on D118703

Differential Revision: https://phabricator.services.mozilla.com/D118884
2021-07-05 17:31:49 +00:00
Emilio Cobos Álvarez
a5f4c42f89 Bug 1717983 - Improve PresShell active flag handling. r=nika
This moves the logic of whether a pres shell should be active to a
single place to make it sane to reason about, and fixes the
subdocument propagation when a BrowserChild becomes visible.

Differential Revision: https://phabricator.services.mozilla.com/D118703
2021-07-05 17:31:48 +00:00
Florian Quèze
cd399a71a2 Bug 1717991 - Remove ifdefs around code that adds profiler markers with custom marker schemas, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D118680
2021-06-25 13:28:01 +00:00
Sandor Molnar
d5946f0a7e Backed out changeset b46a490223a1 (bug 1717983) for causing android failures. CLOSED TREE 2021-06-25 03:29:08 +03:00
Emilio Cobos Álvarez
72c62d51c7 Bug 1717983 - Improve PresShell active flag handling. r=nika
This moves the logic of whether a pres shell should be active to a
single place to make it sane to reason about, and fixes the
subdocument propagation when a BrowserChild becomes visible.

Differential Revision: https://phabricator.services.mozilla.com/D118703
2021-06-24 20:50:10 +00:00
Botond Ballo
cdcdf984e4 Bug 1698693 - Convert audited calls to GetCrossDocParentFrame() to GetCrossDocParentFrameInProcess(). r=tnikkel
See bug 1698693 comment 6 and subsequent comments for the audit.

Depends on D117388

Differential Revision: https://phabricator.services.mozilla.com/D117389
2021-06-23 22:05:31 +00:00
Botond Ballo
c20a537ecd Bug 1698693 - Make the GetNearestScrollableFrame() call in GetCurrentItemAndPositionForElement() stop at the root scroll frame. r=tnikkel
See rationale in bug 1698693 comment 9.

The added flags ensure we stop at the RSF even if it's overflow:hidden,
or if the starting frame is in fixed content.

Depends on D117387

Differential Revision: https://phabricator.services.mozilla.com/D117388
2021-06-23 22:05:31 +00:00
Florian Quèze
dfeb53e219 Bug 1715257 - Remove Task Tracer code from the profiler, r=gerald,necko-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D117996
2021-06-17 09:33:00 +00:00