Commit graph

3578 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
202ac16182 Bug 1855668 - Make ::backdrop inherit from the originating element. r=zrhoffman
This is as a result of a spec change (see link in the test), but it
addresses a very long-standing issue with this pseudo-element, see
https://github.com/whatwg/fullscreen/issues/124.

Differential Revision: https://phabricator.services.mozilla.com/D189484
2023-10-02 08:53:54 +00:00
Emily McDonough
bbecda3398 Bug 1855567 - Use nsPageFrame::PageContentFrame() in nsCSSFrameConstructor::ConstructPageFrame() r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D189435
2023-09-29 18:28:15 +00:00
Emily McDonough
c31987274b Bug 1854027 - Remove obsolete comments about page frame construction r=dholbert DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D189434
2023-09-28 19:00:51 +00:00
Emily McDonough
88868de1be Bug 1853455 - Fix nsIFrame::ComputePageValue to check for page style values, rather than checking the start page value. r=dholbert
Because we use NULL to indicate the auto value, once a page contributes a
non-auto page value then that will be all that is seen by ComputePageValue
when a later page doesn't have a page-name at all.

Actually checking for the page-name value will fix page-name values when
an empty/auto page-name follows pages with a non-auto value. It is also
slightly more efficient, as it avoids a frame property lookup and instead
just looks at the computed style.

While we are here, remove an assert that is clearly not possible to occur
anymore, and add a short explanation of the code in ComputePageValue.

Differential Revision: https://phabricator.services.mozilla.com/D188544
2023-09-27 19:06:17 +00:00
Markus Stange
b474c8da56 Bug 1853720 - Add a "hot" variant of AUTO_PROFILER_LABEL, for lower overhead when the profiler is disabled. r=aabh,profiler-reviewers
The overhead is showing up in Speedometer 3, especially in the innerHTML setter
when it calls into the frame constructor.

Full breakdown of callers across sp3 is here: https://share.firefox.dev/3rfckTG

Time spent in AutoProfilerLabel during TodoMVC-jQuery innerHTML:
Before: https://share.firefox.dev/3Znlydp 378 sampes
After: https://share.firefox.dev/45VdVgr 71 samples

Differential Revision: https://phabricator.services.mozilla.com/D188487
2023-09-25 19:36:41 +00:00
CanadaHonk
8826c8dfd7 Bug 1448248 - Implement CSS attr() fallback r=emilio
Implemented support for fallback values in CSS attr():
`attr(<attr-name>, <attr-fallback>)`

Full syntax supported as of this rev:
`[namespace? `|`]? ident [`,` fallback]?`

Spec: https://drafts.csswg.org/css-values-5/#attr-notation

Also added a new WPT reftest for attr fallback without a type,
and some new attr serialization WPTs (namespace and fallback).

Differential Revision: https://phabricator.services.mozilla.com/D176801
2023-09-20 10:50:05 +00:00
Martin Robinson
c97546c110 Bug 1845223 - Destroy ContainStyleScopes before recalculating counters & quotes during frame destruction r=emilio
Instead of recalculating quotes and counter before destroying contain
style scopes, calculate them after. This prevents stale frame pointers
from sticking around during counter and quote recalculation.

Differential Revision: https://phabricator.services.mozilla.com/D188254
2023-09-14 20:41:45 +00:00
Emilio Cobos Álvarez
f7c99bdd12 Bug 1851787 - Reduce the amount of stack space ConstructFrameFromItemInternal takes.
This prevents ASAN from exhausting the stack with deep frame trees.

MANUAL PUSH: Trivial ASAN reftest fix.
2023-09-08 17:36:34 +02:00
Emilio Cobos Álvarez
aefd1ddb30 Bug 1851787 - Plumb a DestroyContext through all functions that can destroy frames. r=dholbert
This prevents anonymous content getting destroyed at weird times
during frame destruction.

Differential Revision: https://phabricator.services.mozilla.com/D187693
2023-09-08 15:11:17 +00:00
Olli Pettay
8a1e1397c4 Bug 1851250, recreate the frame if single char math:mi changes, r=emilio
Depends on D187334

Differential Revision: https://phabricator.services.mozilla.com/D187335
2023-09-03 17:45:41 +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
dbbf7dc0fb Bug 1835864 - Make printing / paged mode deal with multiple canvas backgrounds properly. r=dholbert
The subdocument call when there's no root frame is silly, because we
won't find a canvas frame and we'll end up with transparent.

This needs to tweak the canvas frame construction code to make canvas
anon content show up on the "top" canvas, not on the page content
canvas.

This can be simplified now, because the reason we had to build canvas
anon content before processing kids of the root frame (bug 1558352) no
longer applies since I made popups regular out-of-flow elements
(bug 1799343).

Differential Revision: https://phabricator.services.mozilla.com/D179461
2023-08-10 12:59:00 +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
Frederic Wang
b8ba2c1e4c Bug 1788223 - Remove preferences for maction/semantics. r=emilio
This commit removes the preference
mathml.legacy_maction_and_semantics_implementations.disabled
that controls whether we layout maction/semantics as an mrow +
extra style. It has been set to true since Firefox 106.

Differential Revision: https://phabricator.services.mozilla.com/D184720
2023-07-31 07:46:30 +00:00
Emilio Cobos Álvarez
7bf3b0e527 Bug 1844195 - Avoid duplicating rust and C++ display definitions. r=layout-reviewers,jfkthame
We need to inline Self::new() so cbindgen generates the constants, which
is kinda lame, but seems better than duplicating the values and type
definitions.

Differential Revision: https://phabricator.services.mozilla.com/D183921
2023-07-26 06:46:32 +00:00
Iulian Moraru
0c0945174b Backed out changeset f3394bd0f554 (bug 1844195) for causing conflicts with another backout. 2023-07-26 04:00:57 +03:00
Emilio Cobos Álvarez
e56bda6fd8 Bug 1844195 - Avoid duplicating rust and C++ display definitions. r=layout-reviewers,jfkthame
We need to inline Self::new() so cbindgen generates the constants, which
is kinda lame, but seems better than duplicating the values and type
definitions.

Differential Revision: https://phabricator.services.mozilla.com/D183921
2023-07-25 21:14:39 +00:00
Iulian Moraru
da43d00caa Backed out changeset 3a3f2d5937c4 (bug 1844195) for causing mass failures. CLOSED TREE 2023-07-25 23:07:30 +03:00
Emilio Cobos Álvarez
c70814ab25 Bug 1844195 - Avoid duplicating rust and C++ display definitions. r=layout-reviewers,jfkthame
We need to inline Self::new() so cbindgen generates the constants, which
is kinda lame, but seems better than duplicating the values and type
definitions.

Differential Revision: https://phabricator.services.mozilla.com/D183921
2023-07-25 18:40:30 +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
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
Emily McDonough
f2355a52d5 Bug 1833471 Part 2 - Export @page pseudo-class flags to Gecko style code r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178869
2023-06-21 23:37:46 +00:00
Norisz Fay
9e2d68a917 Backed out 3 changesets (bug 1833471) for causing failures on cssom-ruleTypeAndOrder.html, page-rule-declarations-000.html
Backed out changeset 69c9504ac848 (bug 1833471)
Backed out changeset e76595d749fb (bug 1833471)
Backed out changeset fd4e99d77a6b (bug 1833471)
2023-06-22 01:01:20 +03:00
Emily McDonough
332fa4dc43 Bug 1833471 Part 2 - Export @page pseudo-class flags to Gecko style code r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178869
2023-06-21 19:02:23 +00:00
Narcis Beleuzu
15227435c3 Backed out 3 changesets (bug 1833471) for wpt failure on page-rule-declarations-000.html . CLOSED TREE
Backed out changeset 547eef705668 (bug 1833471)
Backed out changeset e21e18f3f729 (bug 1833471)
Backed out changeset 16164bf63457 (bug 1833471)
2023-06-21 11:24:49 +03:00
Emily McDonough
8d5d46116d Bug 1833471 Part 2 - Export @page pseudo-class flags to Gecko style code r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178869
2023-06-21 02:13:01 +00:00
Emily McDonough
866896112c Bug 1828020 - Remove the layout.css.named-pages.enabled pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175438
2023-05-16 20:32:11 +00:00
Timothy Nikkel
fecba9ccfa Bug 1832685. Make ReparentFrameView(List) calls no-ops. r=emilio
They shouldn't be doing any work. The only views that exist now are
1) root views
2) menupopup frames
3) subdocument frames and the anonymous inner view directly below them.

The typical ReparentFrameView(List) calls happens during reflow moving something between next in flows. Menupopup frames can't have continuation frames so no next in flows. I audited every call site, none of them should be able to move something out of or into a menupopup frame, and of course none of them should be moving frames across a document boundary.

I left them in as debug only code with unreachable asserts; we can remove it after fuzzers verify that it is unused.

Differential Revision: https://phabricator.services.mozilla.com/D177863
2023-05-12 20:14:57 +00:00
Emilio Cobos Álvarez
8b5b7ad998 Bug 1827856 - Remove nativeAnonymousChildList observers. r=smaug,credential-management-reviewers,devtools-reviewers,sgalich,nchevobbe
You let me know if this seems appealing to you :)

Differential Revision: https://phabricator.services.mozilla.com/D175382
2023-04-18 14:58:34 +00:00
Emilio Cobos Álvarez
67c9a0ddff Bug 1825623 - Restore nsFileControlFrame fragmentation behavior. r=TYLin
nsCSSFrameConstructor::CreateContinuingFrame creates a frame based on the
result of nsIFrame::Type(). The regressing bug changed the nsFileControlFrame
type from Block to its own FileControlType type, which meant that we stopped
creating nsBlockFrame continuations for it.

Fix it by restoring the previous behavior: changing the Type() back to return
Block, and using QueryFrame instead to check for the specific
nsFileControlFrame where we need to.

This is all rather messy, see bug 1555477 for related discussion.

Differential Revision: https://phabricator.services.mozilla.com/D175062
2023-04-11 00:16:53 +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
Robert Longson
2f504d0dc0 Bug 1825921 - Remove SVGUtils::GetFirstNonAAncestorFrame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D174352
2023-04-02 05:34:40 +00:00
Emilio Cobos Álvarez
2d0e69f4a1 Bug 1824957 - Remove a bunch of now completely dead XUL layout code. r=layout-reviewers,desktop-theme-reviewers,devtools-reviewers,dao,TYLin
And some related tests.

A bunch of -moz-box* properties are web exposed, so I'll file a
follow-up for hiding them.

Differential Revision: https://phabricator.services.mozilla.com/D173819
2023-03-29 21:23:55 +00:00
Emily McDonough
c0c82e4fc5 Bug 1819468 - Do not propagate page names from subclasses of block frames r=dholbert
Remove some related now-default pref setting in printing crashtests.list
while we're here.

Differential Revision: https://phabricator.services.mozilla.com/D172342
2023-03-28 22:22:59 +00:00
Emilio Cobos Álvarez
58acdee9a2 Bug 1824667 - Remove nsTextBoxFrame. r=jwatt
Use a MiddleCroppingBlockFrame subclass that looks at the value attribute
instead. We don't need accesskey etc for these so we can just reuse it as is.

Differential Revision: https://phabricator.services.mozilla.com/D173669
2023-03-27 23:46:51 +00:00
Emilio Cobos Álvarez
b9d1536d46 Bug 1824489 - Remove nsBoxFrame, nsBoxLayout and related code. r=jwatt
We still have some remnants of XUL layout due to nsBox / nsLeafBoxFrame
which XUL trees / nsTextBoxFrame still use.

However all this code can go away before we get rid of those.
nsSplitterFrame was the last thing inheriting from nsBoxFrame.

Differential Revision: https://phabricator.services.mozilla.com/D173601
2023-03-27 23:25:42 +00:00
Emilio Cobos Álvarez
38b10eafda Bug 1824236 - Stop using XUL layout for scrollbars. r=jwatt
This rewrites scrollbar layout to work with regular reflow rather than
box layout.

Overall it's about the same amount of code (mostly because
nsScrollbarFrame::Reflow is sorta hand-rolled), but it cleans up a bit
and it is progress towards removing XUL layout altogether, without
getting into much deeper refactoring.

This also blocks some other performance improvements and refactorings I
want to make in this code.

We make some assumptions to simplify the code that to some extent were
made already before, both explicitly and by virtue of using XUL layout.

In particular, we assume that scrollbar / slider / thumb has no border or
padding and that the writing-mode is horizontal ltr.

Differential Revision: https://phabricator.services.mozilla.com/D173489
2023-03-27 20:54:53 +00:00
Sandor Molnar
fcbacc6d6c Backed out changeset 7da2469ac949 (bug 1824236) for causing assertion failures in layout/generic/crashtests/369038-1.xhtml CLOSED TREE 2023-03-27 23:20:35 +03:00
Emilio Cobos Álvarez
914393e83e Bug 1824236 - Stop using XUL layout for scrollbars. r=jwatt
This rewrites scrollbar layout to work with regular reflow rather than
box layout.

Overall it's about the same amount of code (mostly because
nsScrollbarFrame::Reflow is sorta hand-rolled), but it cleans up a bit
and it is progress towards removing XUL layout altogether, without
getting into much deeper refactoring.

This also blocks some other performance improvements and refactorings I
want to make in this code.

We make some assumptions to simplify the code that to some extent were
made already before, both explicitly and by virtue of using XUL layout.

In particular, we assume that scrollbar / slider / thumb has no border or
padding and that the writing-mode is horizontal ltr.

Differential Revision: https://phabricator.services.mozilla.com/D173489
2023-03-27 19:12:52 +00:00
Emilio Cobos Álvarez
894fd5d4c3 Bug 1824667 - Factor middle-cropping out of nsFileControlFrame. r=jfkthame,layout-reviewers
Factor a MiddleCroppingBlockFrame that does the double reflow shenanigans.

That should both be faster and easier to reason about. The only thing we need
to be careful about is to use the current inline coord from the line layout if
present to compute the real available isize.

Differential Revision: https://phabricator.services.mozilla.com/D173668
2023-03-27 17:13:50 +00:00
Emily McDonough
8f3d8a7d82 Bug 1822919 - Remove unused declaration from nsCSSFrameConstructor.cpp r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172843
2023-03-20 21:29:01 +00:00
Emilio Cobos Álvarez
82623a74ae Bug 1600542 - Remove nsXULScrollFrame. r=dshin
We no longer have any use of it.

Differential Revision: https://phabricator.services.mozilla.com/D172876
2023-03-20 17:19:29 +00:00
Robert Longson
4264460c99 Bug 367994 - Map all SVG styles to all non-animation SVG elements r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172590
2023-03-15 19:13:51 +00:00
Cosmin Sabou
f87f82e3b9 Backed out changeset 77efe6b04864 (bug 367994) for causing SVGLength animation wpt failures. CLOSED TREE 2023-03-15 17:11:05 +02:00
Robert Longson
23eb98ba93 Bug 367994 - Map all SVG styles to all non-animation SVG elements r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172590
2023-03-15 13:27:02 +00:00
Emilio Cobos Álvarez
6634317253 Bug 1816672 - Deal with async root element insertions in layout. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D171578
2023-03-08 13:55:19 +00:00
Emilio Cobos Álvarez
01a41fb486 Bug 1820280 - Be consistent for which URIs we expose chrome rules. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D171640
2023-03-07 20:22:23 +00:00