Граф коммитов

22216 Коммитов

Автор SHA1 Сообщение Дата
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
Botond Ballo 39b5581175 Bug 1685146 - Avoid emitting a deferred transform at the wrong level of the WebRenderLayerScrollData tree. r=tnikkel
Since WebRenderLayerScrollData nodes are emitted on the way out
of the recursion over the display list, we need to be careful
that a deferred transform doesn't end up on a deeper node than
it should be.

Differential Revision: https://phabricator.services.mozilla.com/D123397
2021-08-26 04:39:49 +00:00
Daniel Holbert 1f76d3eab9 Bug 1727604: clang-format the layout directory. r=layout-reviewers,TYLin
This patch's changes were automatically generated by this command:
./mach clang-format -p layout/

Differential Revision: https://phabricator.services.mozilla.com/D123662
2021-08-25 19:46:48 +00:00
Andi-Bogdan Postelnicu 2fc4f70e9b Bug 1725145 - Preparation for the hybrid build env. r=necko-reviewers,firefox-build-system-reviewers,valentin,glandium
Automatically generated path that adds flag `REQUIRES_UNIFIED_BUILD = True` to `moz.build`
when the module governed by the build config file is not buildable outside on the unified environment.

This needs to be done in order to have a hybrid build system that adds the possibility of combing
unified build components with ones that are built outside of the unified eco system.

Differential Revision: https://phabricator.services.mozilla.com/D122345
2021-08-25 10:46:17 +00:00
Hiroyuki Ikezoe 584b11a7b9 Bug 1727229 - Replace GetCrossDocParentFrame in nsLayoutUtils::GetReferenceFrame with GetCrossDocParentFrameInProcess. r=boris,tnikkel
There are three call sites of nsLayoutUtils::GetReferenceFrame;

1) In CreateAnimationData [1]
2) In nsImageFrame::MaybeDecodeForPredictedSize [2]
3) In ScrollFrameHelper::GetScrolledRect [3]

1) is a piece of code for the layers backend and only used in the case of
   disabling retained-display-list, so it's not a problem at all for Fission.
2) is used for predecting image frame size, since bug 1724808 we properly handle
   cases where ancestor documents get scaled, so it's fine now.
3) was introduced to avoid redundant paints due to a pixel snapping issue in bug
   1012752 (I am thinking it's not only for fixing the redundant paints though),
   the reference frame is used for obtaining the offset from the reference to
   the scroll frame, that's fine on Fission, there's another problem in the pixel
   snapping code in GetPaintedLayerScaleForFrame which will be handled in bug
   1727228.

[1] https://searchfox.org/mozilla-central/rev/912ff8d38996365e8b843cd82ddce348d8b7f78b/gfx/layers/AnimationInfo.cpp#809
[2] https://searchfox.org/mozilla-central/rev/912ff8d38996365e8b843cd82ddce348d8b7f78b/layout/generic/nsImageFrame.cpp#1076
[3] https://searchfox.org/mozilla-central/rev/912ff8d38996365e8b843cd82ddce348d8b7f78b/layout/generic/nsGfxScrollFrame.cpp#7090

Differential Revision: https://phabricator.services.mozilla.com/D123412
2021-08-24 23:06:44 +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
Jeff Muizelaar 4e0c60c99c Bug 1727324 - Remove WindowRenderer::AsClientLayerManager. r=aosmond
A step down the path of removing ClientLayerManager.

Differential Revision: https://phabricator.services.mozilla.com/D123451
2021-08-24 15:07:56 +00:00
Emilio Cobos Álvarez 4a28778f52 Bug 1724237 - Fix optimization from bug 1722968 to account for when we may dig out of the target subtree for SVG. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D122964
2021-08-23 23:10:15 +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
Botond Ballo baa2926fdf Bug 1723200 - Add crashtest. r=tnikkel
Depends on D123037

Differential Revision: https://phabricator.services.mozilla.com/D123038
2021-08-19 18:31:08 +00:00
Gijs Kruitbosch d90c0bb57f Bug 1724718 - skip some XUL-y tests on android, r=emilio,agi
Depends on D122663

Differential Revision: https://phabricator.services.mozilla.com/D122664
2021-08-19 12:13:01 +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
Patrick f3d0961cb2 Bug 1723224 - Remove layout.css.DOMPoint.enabled, layout.css.DOMMatrix.enabled, and layout.css.DOMQuad.enabled. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D122531
2021-08-17 09:06:29 +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
Hiroyuki Ikezoe 12bf7decdb Bug 1678089 - Trigger the test function after the child document received the load event. r=dholbert
Though the test funtion is called twice since the parent document reloads the
iframe document, but the test will not run for the second call since it's
prevented by `testRunning` flag in test_bug851485.html.

Differential Revision: https://phabricator.services.mozilla.com/D122662
2021-08-14 22:55:17 +00:00
Emily McDonough e71325b8e1 Bug 1722890 Part 2 - Add disabled print preview test for scaled content on the edge of the clipping rect r=dholbert
Scaling currently doesn't work in print preview tests. This adds a test that
will begin to fail if scaling gets fixed, to tell us to enable the actual
scaled content test instead.

See bug 1725486 for the scaling issue.

Differential Revision: https://phabricator.services.mozilla.com/D122292
2021-08-12 23:31:20 +00:00
Daniel Holbert 5d858134b3 Bug 1459682: Reenable test_after_paint_pref.html on Windows ASAN builds. (no review; just a metadata tweak to reenable a test that's now been fixed)
This test was disabled for some sort of failure on Windows ASAN configurations,
several years ago.

The bug doesn't have details on the failure, but it's likely the failure was a
version of the same race condition that turned up (and was recently fixed) in
bug 1720485.  So, let's see if we can reenable this test on Windows ASAN now.

Differential Revision: https://phabricator.services.mozilla.com/D122314
2021-08-12 17:10:27 +00:00
Olli Pettay 325a2c101d Bug 1725133 - Consider to not run a catch-up tick before a normal tick, r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D122332
2021-08-12 08:50:56 +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
Mats Palmgren 05d79d0404 Bug 1724880 - Add a layout-debugger menu item that dumps CounterManager data. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D122210
2021-08-10 23:15:31 +00:00
Gijs Kruitbosch 3355c934ef Bug 1724718 - forget AddTask.js ever existed as bug 1544051 already removed it, r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D122166
2021-08-10 22:33:06 +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
Emilio Cobos Álvarez 624584c368 Bug 1724405 - Make ui.caretBlinkCount a proper widget int, and make it respect GTK settings. r=stransky
And make sure the caret ends up being visible, rather than _not_
visible.

This should be implementable on windows as well. It seems macOS doesn't
have a timeout thing.

Differential Revision: https://phabricator.services.mozilla.com/D122132
2021-08-10 14:39:27 +00:00
Daniel Holbert a1d0abeb81 Bug 1720485: Adjust test_after_paint_pref.html to use a double-rAF instead of a timeout, to give its pref-adjustment a better chance to take effect. r=mattwoodrow
nsPresContext has a flag that caches the value of this pref, and the flag gets
updated in the next refresh driver tick after a pref-change occurs.  Right now
we don't have a strong guarantee that the flag will have been updated by the
time the test assumes that it has, which is why we're seeing intermittent
failures.

This patch adjusts the test so that it waits for a double-rAF before proceeding
from its pref adjustment.  I believe this is the recommended way of forcing &
waiting-out at least one refresh driver tick; and this should let the test
reliably assume the pref-adjustment has taken effect.

Differential Revision: https://phabricator.services.mozilla.com/D122169
2021-08-10 03:21:41 +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
Ben Hearsum aecb82dbfc Bug 1714200: skip failing mochitest-browser-chrome tests on M1 machines r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D121221
2021-08-06 19:16:54 +00:00
Geoff Brown 3f55d9180c Bug 1724296 - Remove many skip-if(verify) test annotations (crashtests); r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D121914
2021-08-06 13:25:49 +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
Florian Quèze d589982ead Bug 1723181 - Add an 'Image Animation' profiler marker, and rename the tick reason 'HasImageRequests' into 'HasImageAnimations' for clarity, r=mstange.
Differential Revision: https://phabricator.services.mozilla.com/D121397
2021-08-03 19:48:24 +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
Emilio Cobos Álvarez 9a783438a6 Bug 1722968 - Add an optimization for GetAllInFlowRects to avoid expensive ancestor lookups in DOMIntersectionObserver. r=jwatt
Part of the issue with the profile in the blocked bug is that 30% of the
time is spent in nsLayoutUtils::FindNearestCommonAncestorFrame from
DOMIntersectionObserver::Update. That shouldn't be needed since in most
cases we know we're an ancestor.

We have an optimization for the root frame but DOMIntersectionObserver
keeps its rects relative to `target`. So we only need to do the
expensive transform for IB splits / fragmented flows.

Differential Revision: https://phabricator.services.mozilla.com/D121214
2021-07-30 12:34:00 +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