Commit Graph

3583 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
67372ce7e5 Bug 1856374 - Add a pref to stop forcing details elements to be blocks. r=TYLin
This is probably something we want to move towards, so it doesn't hurt
adding a pref to allow people to experiment with it.

Differential Revision: https://phabricator.services.mozilla.com/D189919
2023-10-05 16:59:33 +00:00
Robert Longson
f81a0dc1a1 Bug 1856213 - remove some queryinterface calls r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D190022
2023-10-04 10:41:41 +00:00
Robert Longson
64704c4dba Bug 1856362 part 2 - introduce and use IsSVGFilterPrimitiveElement r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D189858
2023-10-03 10:40:46 +00:00
Robert Longson
2b397759f3 Bug 1856362 part 1 - rename SVGFE to SVGFilterPrimitiveelement and SVGFEUnstyledElement to SVGFilterPrimitiveChildElement r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D189857
2023-10-03 10:40:45 +00:00
Emilio Cobos Álvarez
a3c886e9ba Bug 1855668 - Trivially fix some orange tests.
MANUAL PUSH: Orange fix CLOSED TREE
2023-10-02 14:27:04 +02:00
Emilio Cobos Álvarez
e7563558ed 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
c9c5b63c97 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
329253be60 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
c650091e27 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
48895feea5 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
642c4e8df4 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
a03065ffcd 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
1965f04370 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
0b366c953e 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
42cc25f02b 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
6fd5ddc656 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
c37791a4a6 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
01b6773528 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
a67155e52a 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
4134763b27 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
a61a50c1e2 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
ec9b2f185b 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
fc6f8616c7 Backed out changeset f3394bd0f554 (bug 1844195) for causing conflicts with another backout. 2023-07-26 04:00:57 +03:00
Emilio Cobos Álvarez
6e3644cb06 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
9a59c751eb Backed out changeset 3a3f2d5937c4 (bug 1844195) for causing mass failures. CLOSED TREE 2023-07-25 23:07:30 +03:00
Emilio Cobos Álvarez
3e03187a1e 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
ff98bfee56 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
54b63f5015 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
f4a1dc2134 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
d553de5f2b 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
201dd58193 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
51809ee5d0 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
335f8dfffc 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
2ac2bc274a 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
3debfe816d 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
0367ff7c44 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
c5c8aee75c 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
3485544236 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
40b6dc20e5 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
55fb652cdd 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
09eaf2464a 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
48e03fbf79 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
3cb807aa01 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
8a25b72558 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
f9e7ddcde4 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
7944d7404c 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
5cf2decf1e 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
eee01bf23a 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
8bf40f7e00 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
8e33c893fa 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