Commit graph

825 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
5730ee0ca5 Bug 1364813 - Remove IsFrameOfType, use non-virtual checks. r=jwatt
Extend the per-frame-class bit we have to devirtualize IsLeaf to also
devirtualize IsFrameOfType. That is, move this data to FrameClasses.py.

This was done by going through all the frame classes, trying to preserve
behavior.

The only quirky thing is that I had to add two more trivial frame
classes, `nsAudioFrame` for audio elements, and
`nsFloatingFirstLetterFrame`. That's because these frame classes were
returning different answers at runtime, but they do this only on
conditions that trigger frame reconstruction (floating, and being an
audio element, respectively).

Differential Revision: https://phabricator.services.mozilla.com/D194703
2023-11-26 22:17:28 +00:00
Adam Brouwers-Harries
a26eafe5c3 Bug 1421651 - Remove obseleted timeline and TimelineMarker code r=canaltinova,webidl,devtools-reviewers,saschanaz,smaug,ochameau
This patch removes the old docshell timeline and timeline markers codebase and replaces them with equivalent Gecko profiler marker. This patch also fixes Bug 1834143, which is a subset of 1421651.

Differential Revision: https://phabricator.services.mozilla.com/D184217
2023-10-24 15:18:12 +00:00
Narcis Beleuzu
948c7279ee Backed out changeset 714aaf6484fb (bug 1421651) for causing Bug 1860719. CLOSED TREE 2023-10-24 17:31:02 +03:00
Adam Brouwers-Harries
4cdf967b4e Bug 1421651 - Remove obseleted timeline and TimelineMarker code r=canaltinova,webidl,devtools-reviewers,saschanaz,smaug,ochameau
This patch removes the old docshell timeline and timeline markers codebase and replaces them with equivalent Gecko profiler marker. This patch also fixes Bug 1834143, which is a subset of 1421651.

Differential Revision: https://phabricator.services.mozilla.com/D184217
2023-10-23 13:55:50 +00:00
David Shin
faa0e1c8ea Bug 1858720: Prevent :has over-invalidation with sibling DOM mutations. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D190817
2023-10-17 13:17:31 +00:00
Robert Longson
a21d68d939 Bug 1402013 - stop calculating position for SVG elements that aren't governed by the CSS box model r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D190222
2023-10-06 12:04:14 +00:00
David Shin
1cf5b6bf16 Bug 1852965: :has invalidation for inner selectors. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D188339
2023-09-28 19:48:19 +00:00
David Shin
815cbb0387 Bug 1792501: Part 7 - :has invalidation inside :nth-child(of). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185680
2023-09-14 22:21:26 +00:00
David Shin
f19bb58ede Bug 1792501: Part 6 - :has invalidation for :empty and :nth (Without of). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185679
2023-09-14 22:21:26 +00:00
David Shin
ff3b1194eb Bug 1792501: Part 5 - :has DOM mutation invalidation. r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D185678
2023-09-14 22:21:25 +00:00
David Shin
018c4ad794 Bug 1792501: Part 4 - Basic :has invalidation. r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D185677
2023-09-14 22:21:25 +00:00
David Shin
612ec06c74 Bug 1792501: Part 1.5 - Take snapshots for unstyled elements if they're in relative selector search path. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185833
2023-09-14 22:21:24 +00:00
Sandor Molnar
4bd577fefa Backed out 8 changesets (bug 1792501) for causing wpt failures on /css/selectors/...
Backed out changeset 993b0e6567e6 (bug 1792501)
Backed out changeset 7686c9df9ad4 (bug 1792501)
Backed out changeset cf9f855ad80c (bug 1792501)
Backed out changeset 27abe13a5a48 (bug 1792501)
Backed out changeset f708f940e907 (bug 1792501)
Backed out changeset 2a7c57a69803 (bug 1792501)
Backed out changeset 69f1155100f5 (bug 1792501)
Backed out changeset 3f5f59b76a56 (bug 1792501)
2023-09-14 20:08:41 +03:00
David Shin
85c6ffe7ac Bug 1792501: Part 7 - :has invalidation inside :nth-child(of). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185680
2023-09-14 12:30:57 +00:00
David Shin
a1ec796191 Bug 1792501: Part 6 - :has invalidation for :empty and :nth (Without of). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185679
2023-09-14 12:30:56 +00:00
David Shin
b2734528a4 Bug 1792501: Part 5 - :has DOM mutation invalidation. r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D185678
2023-09-14 12:30:56 +00:00
David Shin
a53ddf9908 Bug 1792501: Part 4 - Basic :has invalidation. r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D185677
2023-09-14 12:30:56 +00:00
David Shin
0897d682f3 Bug 1792501: Part 1.5 - Take snapshots for unstyled elements if they're in relative selector search path. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185833
2023-09-14 12:30:55 +00:00
Emilio Cobos Álvarez
1258d560fb Bug 1850238 - Make BROKEN state non-intrinsic. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D187108
2023-08-31 09:20:40 +00:00
Cristina Horotan
4487727b74 Backed out 3 changesets (bug 1850238, bug 1850161) for causing multiple failures at Element.cpp CLOSED TREE
Backed out changeset 30526c800ca7 (bug 1850161)
Backed out changeset ebc81e5e7750 (bug 1850161)
Backed out changeset e66a62c2f8c5 (bug 1850238)
2023-08-31 12:12:05 +03:00
Emilio Cobos Álvarez
cbfc2b9552 Bug 1850238 - Make BROKEN state non-intrinsic. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D187108
2023-08-31 07:46:24 +00:00
Emilio Cobos Álvarez
6070e00f0a Bug 1850342 - Remove non-standard, un-tested :-moz-loading pseudo-class. r=layout-reviewers,jfkthame
This is technically web-exposed, but if we needed to introduce it for
compat we could always re-introduce it matching false.

Differential Revision: https://phabricator.services.mozilla.com/D186938
2023-08-30 10:38:52 +00:00
Iulian Moraru
9a9b90c906 Backed out changeset f0edb489e577 (bug 1850342) for causing dt failures on browser_rules_inactive_css_visited.js. CLOSED TREE 2023-08-30 01:24:44 +03:00
Emilio Cobos Álvarez
afdec6f2a3 Bug 1850342 - Remove non-standard, un-tested :-moz-loading pseudo-class. r=layout-reviewers,jfkthame
This is technically web-exposed, but if we needed to introduce it for
compat we could always re-introduce it matching false.

Differential Revision: https://phabricator.services.mozilla.com/D186938
2023-08-29 20:57:30 +00:00
Cosmin Sabou
5b129b77c5 Backed out changeset f14569b8319b (bug 1850342) for causing dt failures on browser_rules_inactive_css_visited.js. CLOSED TREE 2023-08-29 21:14:42 +03:00
Emilio Cobos Álvarez
286082f4f1 Bug 1850342 - Remove non-standard, un-tested :-moz-loading pseudo-class. r=layout-reviewers,jfkthame
This is technically web-exposed, but if we needed to introduce it for
compat we could always re-introduce it matching false.

Differential Revision: https://phabricator.services.mozilla.com/D186938
2023-08-29 16:56:37 +00:00
Adam Brouwers-Harries
bb2a5252e2 Bug 1421651 - Add counter API for animation triggered restyles r=emilio
This patch adds an API to count the number of restyles triggered by animations. This API will replace the existing timeline marker based testing of the animation/restyle system.

Differential Revision: https://phabricator.services.mozilla.com/D186714
2023-08-25 13:19:28 +00:00
David Shin
ec30a6eea6 Bug 1845744: Move selector-specific node flags to a separate field. r=emilio
Upcoming :has invalidation (Bug 1792501) requires 4 more flags, and we're out of space.
This change consumes the remaining 32-bit hole in `nsINode` to migrate selector-specific
node flags.
This has implications on 32-bit platforms, specifically on text nodes.

Differential Revision: https://phabricator.services.mozilla.com/D184718
2023-08-01 00:29:56 +00:00
Jan-Niklas Jaeschke
c84288a36d Bug 1838262, part 2: Implemented getComputedStyle() for custom highlight api. r=emilio
This patch introduces functional pseudo parameters, i.e. `::highlight(foo)`,
for `getComputedStyle()`. This required adapting the parse algorithm (`nsCSSPseudoElements::ParsePseudoElement()`) and forwarding the functional pseudo parameter into the style engine.

Differential Revision: https://phabricator.services.mozilla.com/D183773
2023-07-31 13:47:54 +00:00
Hiroyuki Ikezoe
55989de784 Bug 1845631 - Integrate two separete if (hint & nsChangeHint_AddOrRemoveTransform) blocks in RestyleManager::ProcessRestyledFrames. r=emilio
Depends on D184535

Differential Revision: https://phabricator.services.mozilla.com/D184650
2023-07-27 02:36:57 +00:00
Hiroyuki Ikezoe
8a1787d827 Bug 1841306 - Try re-snap on the previous snapped target changed its position by transform(-like) properties. r=emilio
Surprisingly Chromes does handle properly cases where the transform change by
CSS transitions/animations, but Safari doesn't. So we'd just match our behavior
Safari's behavior for now.

Differential Revision: https://phabricator.services.mozilla.com/D184535
2023-07-26 23:02:05 +00:00
Emilio Cobos Álvarez
0d753c2a94 Bug 1841128 - Simplify first-line reparenting a bit. r=TYLin
The TLDR is that our first-line implementation is complete madness, but
I'm not fixing bug 1465474 yet.

The guarantee that first-line style reparenting relies on is that
reparenting shouldn't change reset properties (that's why we had all
this "style to inherit ignoring first-line" to inherit reset
properties). Bug 1839223 broke this guarantee in the case the mapped
attribute declarations are reused / mutated (which is something we want
to do for performance).

What's going on in the test-case is that the old style's rule-node
declarations are mutated by the mapped attributes code. Re-cascading the
old styles yields a different `float` property value.

When a style change that causes a reframe like this one happens, we
don't update the frame tree styles with the new styles: it'd be wrong
and also useless work.

First-line reparenting happens after we've recomputed the styles, but
before we've reframed as needed. In this intermediate state, the frame
remains with the old (floated) style, but the ::first-line reparenting
code isn't aware that this frame is going away, so it happily
re-cascades and updates the style anyways, creating a floated
frame that has float: none in its computed style information.

This causes the frame destruction code to crash.

This patch restores that guarantee that ::first-line doesn't change
reset properties by re-using the "reset properties cache" code-path.
This is also simpler since it avoids us having to compute the "parent
ignoring ::first-line" style.

The code is also more explicit with the new enum rather than just an
Option.

Differential Revision: https://phabricator.services.mozilla.com/D182769
2023-07-07 16:46:52 +00:00
Emilio Cobos Álvarez
040bbdb18d Bug 1841128 - Minor clean-ups to first-line reparenting code. r=TYLin
This doesn't change behavior, but avoids some useless work when
reparenting frames that used to be in display: none subtrees.

Also fixes a clang-tidy warning.

Depends on D182767

Differential Revision: https://phabricator.services.mozilla.com/D182768
2023-07-07 16:43:07 +00:00
Emilio Cobos Álvarez
a88cb1c044 Bug 1841128 - Clean-up Servo_TakeChangeHint. r=TYLin
This is drive-by. We already rely on was_restyled not being null so make
that explicit.

Differential Revision: https://phabricator.services.mozilla.com/D182767
2023-07-07 16:43:07 +00:00
Noemi Erli
1b3921b744 Backed out 3 changesets (bug 1841128) for causing failures in 1385656.html
Backed out changeset 423c48eae15e (bug 1841128)
Backed out changeset 67e3d9e33912 (bug 1841128)
Backed out changeset cb94d6c0916d (bug 1841128)
2023-07-07 16:16:26 +03:00
Emilio Cobos Álvarez
51d0003074 Bug 1841128 - Simplify first-line reparenting a bit. r=TYLin
The TLDR is that our first-line implementation is complete madness, but
I'm not fixing bug 1465474 yet.

The guarantee that first-line style reparenting relies on is that
reparenting shouldn't change reset properties (that's why we had all
this "style to inherit ignoring first-line" to inherit reset
properties). Bug 1839223 broke this guarantee in the case the mapped
attribute declarations are reused / mutated (which is something we want
to do for performance).

What's going on in the test-case is that the old style's rule-node
declarations are mutated by the mapped attributes code. Re-cascading the
old styles yields a different `float` property value.

When a style change that causes a reframe like this one happens, we
don't update the frame tree styles with the new styles: it'd be wrong
and also useless work.

First-line reparenting happens after we've recomputed the styles, but
before we've reframed as needed. In this intermediate state, the frame
remains with the old (floated) style, but the ::first-line reparenting
code isn't aware that this frame is going away, so it happily
re-cascades and updates the style anyways, creating a floated
frame that has float: none in its computed style information.

This causes the frame destruction code to crash.

This patch restores that guarantee that ::first-line doesn't change
reset properties by re-using the "reset properties cache" code-path.
This is also simpler since it avoids us having to compute the "parent
ignoring ::first-line" style.

The code is also more explicit with the new enum rather than just an
Option.

Depends on D182768

Differential Revision: https://phabricator.services.mozilla.com/D182769
2023-07-07 12:01:30 +00:00
Emilio Cobos Álvarez
06085244e4 Bug 1841128 - Minor clean-ups to first-line reparenting code. r=TYLin
This doesn't change behavior, but avoids some useless work when
reparenting frames that used to be in display: none subtrees.

Also fixes a clang-tidy warning.

Depends on D182767

Differential Revision: https://phabricator.services.mozilla.com/D182768
2023-07-07 12:01:29 +00:00
Emilio Cobos Álvarez
b26a997395 Bug 1841128 - Clean-up Servo_TakeChangeHint. r=TYLin
This is drive-by. We already rely on was_restyled not being null so make
that explicit.

Differential Revision: https://phabricator.services.mozilla.com/D182767
2023-07-07 12:01:29 +00:00
Emilio Cobos Álvarez
7bddcf9e5a Bug 1839223 - Remove nsMappedAttributes. r=smaug
Instead, lazily schedule evaluation of them before styling, much like we
were doing for SVG.

A subtle tweak is that we only remain scheduled while in the document.
This allows us to use the "in document" bit plus the "mapped attributes
dirty" bit to know our scheduled status. It also prevents doing silly
work for disconnected elements, and having to do hashmap lookups on
adoption and node destruction.

Differential Revision: https://phabricator.services.mozilla.com/D181549
2023-06-22 17:22:03 +00:00
Cristian Tuns
6957543e5e Backed out changeset a3e55d5f9f13 (bug 1839223) for causing multiple failures in Document.cpp CLOSED TREE 2023-06-22 11:34:15 -04:00
Emilio Cobos Álvarez
c3a1b1a608 Bug 1839223 - Move table cellpadding handling to HTMLTableElement. r=smaug
As per discussion.

Differential Revision: https://phabricator.services.mozilla.com/D181781
2023-06-22 14:45:14 +00:00
Emilio Cobos Álvarez
2c6de5f038 Bug 1839223 - Remove nsMappedAttributes. r=smaug
Instead, lazily schedule evaluation of them before styling, much like we
were doing for SVG.

A subtle tweak is that we only remain scheduled while in the document.
This allows us to use the "in document" bit plus the "mapped attributes
dirty" bit to know our scheduled status. It also prevents doing silly
work for disconnected elements, and having to do hashmap lookups on
adoption and node destruction.

Differential Revision: https://phabricator.services.mozilla.com/D181549
2023-06-22 14:31:16 +00:00
David Shin
b551599c99 Bug 1793012: Correct style sharing handling for any element that considered :has() in selector matching. r=emilio
For any element that anchors a `:has()` selector (i.e. Matches a selector that
contains a `:has()` on its rightmost side), we prevent style sharing altogether,
as evaluation of the `:has()` selector is required in the first place to
determine style sharing.

On the other hand, any element matching a rule containing `:has()` without
anchoring it can do style sharing for siblings, but not cousins.

Differential Revision: https://phabricator.services.mozilla.com/D176836
2023-05-25 14:35:18 +00:00
Daniel Holbert
06aa3fba93 Bug 1834133 part 1: Remove about:config prefs layout.css.notify-of-unvisited and layout.css.always-repaint-on-unvisited. r=emilio
Update all of their usages to assume that they're true (which they have been, by-default, for several years).

Differential Revision: https://phabricator.services.mozilla.com/D178569
2023-05-20 06:07:48 +00:00
Emilio Cobos Álvarez
1c967006ab Bug 1831539 - Remove HasBoxFFI. r=boris
HasBoxFFI and HasArcFFI aren't great, see bug 1831242 as for examples of
why.

HasArcFFI requires a bit more care, but HasBoxFFI doesn't give us much
benefit. Instead use the same type in the FFI boundary.

Differential Revision: https://phabricator.services.mozilla.com/D177252
2023-05-09 11:07:26 +00:00
Robert Longson
7e65e06613 Bug 1826001 - Change SVGUtils::IsInSVGTextSubtree into a member function on nsIFrame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D174375
2023-04-02 21:17:07 +00:00
Emilio Cobos Álvarez
c661ccc586 Bug 1822432 - Restyle pseudo-elements as well on part attribute changes. r=jwatt
Refactor a bit the code to unify how we deal with this conditional
restyling (we had similar code for
MustCascadeChildrenIfInheritResetStyle).

Differential Revision: https://phabricator.services.mozilla.com/D172890
2023-03-27 18:17:56 +00:00
Emilio Cobos Álvarez
5dfcee19a5 Bug 1600542 - Remove a few other no longer reachable XUL box special-cases. r=TYLin
The only XUL frames that remain are either scrollbars, or leafs. These are uses
that I'm pretty sure are no longer needed. There are a few others that will go
in the future.

Depends on D172874

Differential Revision: https://phabricator.services.mozilla.com/D172875
2023-03-20 23:56:03 +00:00
Robert Longson
93304f6d11 Bug 1823290 - Check for NS_FRAME_SVG_LAYOUT directly rather than checking for an SVG frame that isn't an outer SVG frame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172960
2023-03-20 12:30:45 +00:00
Zach Hoffman
4f5c70443d Bug 1818151 - Record attribute dependencies within the selector list of :nth-child(... of <selector list>) r=emilio
There are separate filters for IDs, classes, attribute local names, and
element state.

Also, we invalidate siblings of elements matched against the selector
list of :nth-child(... of <selector list>) by marking matched elements
with NODE_HAS_SLOW_SELECTOR_NTH_OF.

The only remaining invalidation case invalidation case is
`:nth-child(An+B of :has())` (bug 1818155), which should not block
shipping `layout.css.nth-child-of.enabled`, because :has(...) is still
being implemented (bug 418039).

Depends on D172352

Differential Revision: https://phabricator.services.mozilla.com/D171936
2023-03-15 06:56:21 +00:00