Commit graph

1273 commits

Author SHA1 Message Date
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