Commit Graph

880 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
a0e72ad398 Bug 1935785 - Don't invalidate for nth-of without style data. r=jwatt
We don't need to, and it trips assertions down the line when we try to
mark stuff as dirty.

Differential Revision: https://phabricator.services.mozilla.com/D238482
2025-02-18 13:24:10 +00:00
Boris Chiou
3c99c06def Bug 1921116 - Make sure we stop animations when destroying the frames of view transition pseudo-elements. r=view-transitions-reviewers,emilio
This also destroys the AnimationCollection we don't need, and it's especially
necessary when we make the `document.documentElement.style.display` be `none`.

The test will be added when we support getAnimations() for view transition
pseudo-elements (i.e. Bug 1921109).

Differential Revision: https://phabricator.services.mozilla.com/D231535
2025-01-21 22:17:29 +00:00
Emilio Cobos Álvarez
a47d6a0e2c Bug 1940405 - Avoid quadratic behavior on some kinds of style invalidation on DOM mutations. r=dshin
This seems simple enough and should prevent the issue.

Differential Revision: https://phabricator.services.mozilla.com/D234734
2025-01-20 17:30:17 +00:00
Ting-Yu Lin
7dedca0f5e Bug 1936476 - Remove a comment regarding GetParentComputedStyle in RestyleManager. r=layout-reviewers,tlouw DONTBUILD
`nsIFrame::GetParentComputedStyle()` has multiple callers, and is implemented
and overridden by several frame classes. It is not worth trying to remove it.

Differential Revision: https://phabricator.services.mozilla.com/D231771
2024-12-11 22:47:49 +00:00
David Shin
055e8eca9e Bug 1931432: Fix up how :empty, :first-child and :last-child invalidation are skipped. r=firefox-style-system-reviewers,emilio
Previous go at optimizing in Bug 1896380 was not quite correct.
For example, given `.anchor:has(:first-child)`, when `.anchor`
has a new child inserted, we need to be able to invalidate (Which
we did not).
Thankfully, we can reason that the previously-optimized pseudo-
classes, i.e. :empty, :first-child, :last-child, can be trivially
rejected from activating the invalidation machinery by by examining
its descendants/siblings - e.g. `:has(:first-child)` is irrelevant
to elements we know aren't in the first sibling position.

Differential Revision: https://phabricator.services.mozilla.com/D229670
2024-11-26 18:14:43 +00:00
Emilio Cobos Álvarez
539611ead9 Bug 1931301 - Notify of removals on a stable state, not mid-remove. r=smaug,masayuki,dshin
This simplifies some observers, and makes others a bit more subtle, but I think
over-all it is an improvement.

Differential Revision: https://phabricator.services.mozilla.com/D229008
2024-11-26 09:39:52 +00:00
Boris Chiou
2cacb75b9a Bug 1921553 - Use PseudoStyleRequest in AnimationCollection and TimelineCollection. r=view-transitions-reviewers,layout-reviewers,emilio
Just like what we do for EffectSet. Also, we will update
ElementAnimationData later, so for now only change the APIs of
AnimationCollection and TimelineCollection (and their callers).

Differential Revision: https://phabricator.services.mozilla.com/D228227
2024-11-25 23:46:33 +00:00
Boris Chiou
dac5d98343 Bug 1921553 - Use PseudoStyleRequest in EffectSet. r=view-transitions-reviewers,layout-reviewers,emilio
Use `PseudoStyleRequest` in the APIs of EffectSet. We would like to
store the animation in the originating element, so need to use
`PseudoStyleRequest`.

Differential Revision: https://phabricator.services.mozilla.com/D228226
2024-11-25 23:46:32 +00:00
Boris Chiou
30af2312c9 Bug 1921553 - Use PseudoStyleRequest in AnimationUtils and EffectCompositor. r=view-transitions-reviewers,layout-reviewers,emilio
Basically, we'd like to separate the originating element and its pseudo
element request in Animation code (for better compatibility with Web
Animations APIs and other pseudo types), and store the animations and
keyframe effects in the origninating element as well.

In this patch, we reuse `Element::GetPseudoElement()`, and update the
function signatures in EffectCompositor and RestyleManager.

All the following patches will replace more places with
`PseudoStyleRequest`.

Differential Revision: https://phabricator.services.mozilla.com/D228223
2024-11-25 23:46:31 +00:00
Sandor Molnar
4edbb82211 Backed out changeset 3d4472548fb9 (bug 1931301) for causing assertion failures @ Document.cpp 2024-11-25 23:06:55 +02:00
Emilio Cobos Álvarez
0651582f86 Bug 1931301 - Notify of removals on a stable state, not mid-remove. r=smaug,masayuki,dshin
This simplifies some observers, and makes others a bit more subtle, but I think
over-all it is an improvement.

Differential Revision: https://phabricator.services.mozilla.com/D229008
2024-11-25 17:58:40 +00:00
Jonathan Watt
c986a5098a Bug 1931736. Add missing braces around if/loop statements in layout/base/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D229245
2024-11-17 05:03:57 +00:00
Emilio Cobos Álvarez
11a8b7baf2 Bug 1914321 - Build view transition pseudo-element tree. r=view-transitions-reviewers,boris
Reuse the editor's manual NAC machinery for now, and hook it into
StyleChildrenIterator and co.

We might need to slightly tweak the setup for selector-matching, not
sure yet, but that should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D228255
2024-11-14 10:17:52 +00:00
Butkovits Atila
3616798bb1 Backed out changeset cb8acf4c8893 (bug 1914321) for causing failures at browser_markup_search_01.js. CLOSED TREE 2024-11-14 02:42:39 +02:00
Emilio Cobos Álvarez
f475361154 Bug 1914321 - Build view transition pseudo-element tree. r=view-transitions-reviewers,boris
Reuse the editor's manual NAC machinery for now, and hook it into
StyleChildrenIterator and co.

We might need to slightly tweak the setup for selector-matching, not
sure yet, but that should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D228255
2024-11-13 22:11:58 +00:00
Butkovits Atila
6ae954d86e Backed out changeset 4fc43467210b (bug 1914321) for causing failures at PresShell.cpp. CLOSED TREE 2024-11-13 21:24:29 +02:00
Emilio Cobos Álvarez
3f41e0c52d Bug 1914321 - Build view transition pseudo-element tree. r=view-transitions-reviewers,boris
Reuse the editor's manual NAC machinery for now, and hook it into
StyleChildrenIterator and co.

We might need to slightly tweak the setup for selector-matching, not
sure yet, but that should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D228255
2024-11-13 18:06:34 +00:00
Connor Pearson
c2ce7dcc85 Bug 1841456 - Part 1: Use auto instead of top in -moz-top-layer to match overlay. r=emilio,desktop-theme-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D228525
2024-11-09 15:41:25 +00:00
serge-sans-paille
262f78c07f Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Alexandru Marc
a5eb905bf4 Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille
07101ac24d Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00
Alexandru Marc
004e704b22 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille
2c916d4973 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
Emilio Cobos Álvarez
3e829bc2f0 Bug 1918762 - Simplify theme attribute/state change invalidation. r=jwatt
We had the same list of attributes in multiple places, put it in
Theme.cpp.

Only a few states can change widget state. Just hardcode them in
RestyleManager.cpp (where there was already some of it) instead of
reusing a weird API.

Shouldn't have any behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D222160
2024-09-16 22:02:05 +00:00
Iulian Moraru
39f742bf8e Backed out changeset 62cb18f600a3 (bug 1918762) for causing build bustages related to nsITheme. CLOSED TREE 2024-09-16 22:10:00 +03:00
Emilio Cobos Álvarez
5498f47c8e Bug 1918762 - Simplify theme attribute/state change invalidation. r=jwatt
We had the same list of attributes in multiple places, put it in
Theme.cpp.

Only a few states can change widget state. Just hardcode them in
RestyleManager.cpp (where there was already some of it) instead of
reusing a weird API.

Shouldn't have any behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D222160
2024-09-16 17:38:52 +00:00
Timothy Nikkel
b48f48d3c1 Bug 1910297. Handle repaint propagation to the root if the root is a table. r=layout-reviewers,emilio
The background image is associate to the table frame, but the table wrapper frame is the primary frame, thus IsPrimaryFrameOfRootOrBodyElement returns false and we don't propagate to the root when we should. So I changed IsPrimaryFrameOfRootOrBodyElement to handle this case and renamed it. I checked the other root element frame types, only table frames had this issue.

Differential Revision: https://phabricator.services.mozilla.com/D217923
2024-08-09 10:25:21 +00:00
Nazım Can Altınova
9ad49b5a8a Bug 1904183 - Add a profiler label frame for the element state changed code path r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D214669
2024-06-24 10:22:10 +00:00
Emilio Cobos Álvarez
5a4b819356 Bug 1903671 - Check for namespace properly when looking for class / id attributes for invalidation. r=zrhoffman,dshin,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D214420
2024-06-21 22:29:51 +00:00
Emilio Cobos Álvarez
d82e90cc8c Bug 1899597 - Avoid double walk over siblings in style invalidation. r=dshin
This fixes a regression with :has() on the test-case of bug 1480477 (but
we should still aim to make that faster).

While at it, avoid synchronization in some really hot paths, and add
tests.

Differential Revision: https://phabricator.services.mozilla.com/D212039
2024-05-31 13:14:36 +00:00
Ting-Yu Lin
5cdee429ce Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211498
2024-05-30 06:32:22 +00:00
Ting-Yu Lin
9ff564d485 Bug 1896516 Part 7 - Remove PresShell::GetRootScrollFrameAsScrollable(). r=layout-reviewers,emilio
`PresShell::GetRootScrollFrameAsScrollable()` is equivalent to
`PresShell::GetRootScrollContainerFrame()`.

In ScrollContainerFrame.h, `DecideScrollableLayer()` has two versions, one has
four parameters, and the other has five parameters with the fifth parameter
`aDirtyRectHasBeenOverriden` having a default value `nullptr`. When we switch
the caller from `nsIScrollableFrame` to `ScrollContainerFrame`, we need to
remove the default value for the fifth parameter to avoid ambiguity.

Differential Revision: https://phabricator.services.mozilla.com/D211494
2024-05-30 06:32:20 +00:00
Sebastian Hengst
bf4dfe53f8 Backed out 15 changesets (bug 1896516) for causing scrolling crashes on macOS. a=backout
Backed out changeset fd6904338812 (bug 1896516)
Backed out changeset 2977ff81a23e (bug 1896516)
Backed out changeset c8a6b0e526d6 (bug 1896516)
Backed out changeset 3c06f22da72b (bug 1896516)
Backed out changeset f63b0c4335fe (bug 1896516)
Backed out changeset 6f7ab8adfa6e (bug 1896516)
Backed out changeset 997c9249dbed (bug 1896516)
Backed out changeset c964fccd5180 (bug 1896516)
Backed out changeset 7b481b747b7a (bug 1896516)
Backed out changeset 42e1bbe0ecb6 (bug 1896516)
Backed out changeset 717dac08b607 (bug 1896516)
Backed out changeset 2f0817331dbe (bug 1896516)
Backed out changeset b765169a7a8f (bug 1896516)
Backed out changeset a2d37b98273c (bug 1896516)
Backed out changeset ea9ecb543e66 (bug 1896516)
2024-05-29 11:22:52 +02:00
Ting-Yu Lin
37e9b779f9 Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211498
2024-05-28 04:46:20 +00:00
Ting-Yu Lin
5ac7609fac Bug 1896516 Part 7 - Remove PresShell::GetRootScrollFrameAsScrollable(). r=layout-reviewers,emilio
`PresShell::GetRootScrollFrameAsScrollable()` is equivalent to
`PresShell::GetRootScrollContainerFrame()`.

In ScrollContainerFrame.h, `DecideScrollableLayer()` has two versions, one has
four parameters, and the other has five parameters with the fifth parameter
`aDirtyRectHasBeenOverriden` having a default value `nullptr`. When we switch
the caller from `nsIScrollableFrame` to `ScrollContainerFrame`, we need to
remove the default value for the fifth parameter to avoid ambiguity.

Differential Revision: https://phabricator.services.mozilla.com/D211494
2024-05-28 04:46:19 +00:00
Emilio Cobos Álvarez
f0909e022f Bug 1897827 - Remove FrameChildListID::Popup. r=dholbert
It's no longer used. I made popups regular absolutely-positioned frames
a long time ago.

Differential Revision: https://phabricator.services.mozilla.com/D210949
2024-05-20 22:00:08 +00:00
Ting-Yu Lin
b4a0842882 Bug 1824877 Part 3 - Change ScrollContainerFrame's type from Scroll to ScrollContainer. r=dholbert
This effectively changes the `IsScrollFrame()` helper to
`IsScrollContainerFrame()`.

Differential Revision: https://phabricator.services.mozilla.com/D210357
2024-05-15 17:50:49 +00:00
Ting-Yu Lin
27bb908f13 Bug 1824877 Part 2 - Rename nsHTMLScrollFrame to mozilla::ScrollContainerFrame. r=dholbert
Also, change the ScrollContainerFrame::GetFrameName() to return
"ScrollContainer" instead of "HTMLScroll".

Differential Revision: https://phabricator.services.mozilla.com/D210233
2024-05-15 17:50:48 +00:00
Emilio Cobos Álvarez
d5870a6a17 Bug 1893731 - Allow posting restyles from DidSetComputedStyle / the post-traversal. r=longsonr
This doesn't change behavior as is but prevents an assertion with the
other proposed patch.

Differential Revision: https://phabricator.services.mozilla.com/D208913
2024-04-29 20:50:42 +00:00
keithamus
9d776293f2 Bug 1888098 - optimize nth-of dependency tracking for custom state r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D205804
2024-03-27 21:43:01 +00:00
Emilio Cobos Álvarez
191c066aca Bug 1870380 - Don't use handled hints for table captions. r=tnikkel,layout-reviewers
Table captions have a similar issue as column spanners, where their
parent might not be the in the subtree of the style frame of its
ancestors. In particular, a repaint posted to a table that
doesn't cause a repaint in the table wrapper might not cause a repaint
of its captions.

Handle table captions like we treat out of flows and spanners, and add
more comments around this set-up.

Differential Revision: https://phabricator.services.mozilla.com/D205504
2024-03-26 09:17:06 +00:00
keithamus
390ef8eb0d Bug 1865589 - Notify PresShell of CustomState changes, so Restyle can invalidate. r=emilio,dshin
Differential Revision: https://phabricator.services.mozilla.com/D202460
2024-03-22 22:18:05 +00:00
Artur Iunusov
69470f6b4e Bug 1770944 - Remove nsGkAtoms::mozbrowser. r=smaug
Depends on D175898

Differential Revision: https://phabricator.services.mozilla.com/D183229
2024-03-07 13:04:22 +00:00
Ryan VanderMeulen
0c5b3042d3 Bug 1883927 - Add ifdefs around functions only used when accessibility is enabled. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D203792
2024-03-06 17:55:33 +00:00
Narcis Beleuzu
197b39f007 Backed out 16 changesets (bug 1770944) as req by asuth.
Backed out changeset 61af32f40777 (bug 1770944)
Backed out changeset 4ff0c45db93b (bug 1770944)
Backed out changeset 8a217eff7bcd (bug 1770944)
Backed out changeset 6435f48c96bf (bug 1770944)
Backed out changeset 0d2432765ca0 (bug 1770944)
Backed out changeset 58e02566db85 (bug 1770944)
Backed out changeset 0a8c4c2460ee (bug 1770944)
Backed out changeset 9416bafd9982 (bug 1770944)
Backed out changeset 79de4f83fe2e (bug 1770944)
Backed out changeset 63ac518aceb0 (bug 1770944)
Backed out changeset 14952f872b77 (bug 1770944)
Backed out changeset f65e0967ad75 (bug 1770944)
Backed out changeset bd53c42038f7 (bug 1770944)
Backed out changeset 36c378ba8212 (bug 1770944)
Backed out changeset 9ba54ab06348 (bug 1770944)
Backed out changeset fb5a54b3cbe9 (bug 1770944)
2024-02-23 21:11:08 +02:00
Artur Iunusov
c37653d8b7 Bug 1770944 - Remove nsGkAtoms::mozbrowser. r=smaug
Depends on D175898

Differential Revision: https://phabricator.services.mozilla.com/D183229
2024-02-22 10:13:14 +00:00
Sandor Molnar
6699491437 Backed out 16 changesets (bug 1770944) for causing asan failures @ dom/base/InProcessBrowserChildMessageManager.cpp
Backed out changeset b73885731e73 (bug 1770944)
Backed out changeset 23d0dc98eb51 (bug 1770944)
Backed out changeset 15661e24d8e1 (bug 1770944)
Backed out changeset 97aa839dc200 (bug 1770944)
Backed out changeset 0d4318bf3239 (bug 1770944)
Backed out changeset be28bb62e9f3 (bug 1770944)
Backed out changeset 708b2671410e (bug 1770944)
Backed out changeset 0a138f3b56b9 (bug 1770944)
Backed out changeset 3a149ef794c2 (bug 1770944)
Backed out changeset 4b6ae7dd0e69 (bug 1770944)
Backed out changeset e3960ad85182 (bug 1770944)
Backed out changeset 9ea253525227 (bug 1770944)
Backed out changeset 1828b66c2f7c (bug 1770944)
Backed out changeset 55b0886f9025 (bug 1770944)
Backed out changeset a4197071d10a (bug 1770944)
Backed out changeset 9b18524f541e (bug 1770944)
2024-02-20 20:34:55 +02:00
Artur Iunusov
a79d7549bc Bug 1770944 - Remove nsGkAtoms::mozbrowser. r=smaug
Depends on D175898

Differential Revision: https://phabricator.services.mozilla.com/D183229
2024-02-20 16:53:23 +00:00
Frédéric Wang
5029677c27 Bug 1874826 - Avoid reconstruction due to change to block formatting context. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D198931
2024-01-23 10:09:57 +00:00
Emilio Cobos Álvarez
ad6545edc0 Bug 1875137 - Don't ignore state changes in display: none subtrees if needed for :has(). r=dshin
Just like we do for attribute invalidation.

Differential Revision: https://phabricator.services.mozilla.com/D198929
2024-01-18 13:18:51 +00:00