Commit Graph

2317 Commits

Author SHA1 Message Date
Jonathan Kew
64fa9b6bb6 Bug 1887465 - Use the containing block's writing mode to resolve logical values for CSS float and clear properties. r=layout-reviewers,emilio
And don't resolve them prematurely; the computed value should remain
logical, and only be mapped to physical sides at use time.

Differential Revision: https://phabricator.services.mozilla.com/D229998
2024-11-25 14:02:26 +00:00
Emilio Cobos Álvarez
074210e88e Bug 1932800 - Use ShouldHaveLineIfEmpty() to guarantee buttons have at least one line of height. r=dshin
This is similar to how we treat <div contenteditable>, and allows us to
remove the specialness about anon boxes.

Differential Revision: https://phabricator.services.mozilla.com/D229939
2024-11-24 14:46:16 +00:00
Emilio Cobos Álvarez
b1269ccea6 Bug 1932800 - Fix caret baseline of empty inline and text frames. r=dshin
Added Gecko reftests because I don't know what the best place to put
them in WPT is, and caret rendering is kind of undefined, but...

Differential Revision: https://phabricator.services.mozilla.com/D229926
2024-11-24 14:46:16 +00:00
Goloman Adrian
caa559759f Backed out 3 changesets (bug 1932800) for causing marionette failures @test_accessiblecaret_cursor_mode.py. CLOSED TREE
Backed out changeset f40a44add850 (bug 1932800)
Backed out changeset 7cda61151052 (bug 1932800)
Backed out changeset 4974ccf274fa (bug 1932800)
2024-11-24 15:16:48 +02:00
Emilio Cobos Álvarez
33d4e05e42 Bug 1932800 - Use ShouldHaveLineIfEmpty() to guarantee buttons have at least one line of height. r=dshin
This is similar to how we treat <div contenteditable>, and allows us to
remove the specialness about anon boxes.

Differential Revision: https://phabricator.services.mozilla.com/D229939
2024-11-23 12:46:49 +00:00
Emilio Cobos Álvarez
b121dde1da Bug 1932800 - Fix caret baseline of empty inline and text frames. r=dshin
Added Gecko reftests because I don't know what the best place to put
them in WPT is, and caret rendering is kind of undefined, but...

Differential Revision: https://phabricator.services.mozilla.com/D229926
2024-11-23 12:46:48 +00:00
Sandor Molnar
e7348a5625 Backed out 3 changesets (bug 1932800) for causing reftest failures. CLOSED TREE
Backed out changeset c06b939ca2f2 (bug 1932800)
Backed out changeset 048956318eb0 (bug 1932800)
Backed out changeset 333442d03d1a (bug 1932800)
2024-11-23 12:40:11 +02:00
Otto Länd
fa07b89619 Bug 1932800: apply code formatting via Lando
# ignore-this-changeset
2024-11-23 09:03:14 +00:00
Emilio Cobos Álvarez
775a22ff40 Bug 1932800 - Use ShouldHaveLineIfEmpty() to guarantee buttons have at least one line of height. r=dshin
This is similar to how we treat <div contenteditable>, and allows us to
remove the specialness about anon boxes.

Differential Revision: https://phabricator.services.mozilla.com/D229939
2024-11-23 09:00:29 +00:00
Emilio Cobos Álvarez
8121200d6a Bug 1932800 - Fix caret baseline of empty inline and text frames. r=dshin
Added Gecko reftests because I don't know what the best place to put
them in WPT is, and caret rendering is kind of undefined, but...

Differential Revision: https://phabricator.services.mozilla.com/D229926
2024-11-23 09:00:29 +00:00
Emilio Cobos Álvarez
a5184c1852 Bug 1926015 - Percentage-basis aware intrinsic cache. r=TYLin,dholbert
This avoids returning wrong intrinsic values with different calls into
intrinsic size computation, which is wrong by definition.

We shouldn't be wallpapering over it by clearing intrinsic sizes
mid-layout as the original patch was doing.

Differential Revision: https://phabricator.services.mozilla.com/D229621
2024-11-21 19:55:31 +00:00
Adi
b34823b0fe Backed out 5 changesets (bug 1926015) for causing crashtest failures @1730506.html. CLOSED TREE
Backed out changeset 7df628ab162c (bug 1926015)
Backed out changeset a3524c96da73 (bug 1926015)
Backed out changeset cfbf0fa7bf8d (bug 1926015)
Backed out changeset 2c2f56268bd7 (bug 1926015)
Backed out changeset 55175ed82058 (bug 1926015)
2024-11-21 21:28:08 +02:00
Emilio Cobos Álvarez
2e6b4fa1dc Bug 1926015 - Percentage-basis aware intrinsic cache. r=TYLin,dholbert
This avoids returning wrong intrinsic values with different calls into
intrinsic size computation, which is wrong by definition.

We shouldn't be wallpapering over it by clearing intrinsic sizes
mid-layout as the original patch was doing.

Differential Revision: https://phabricator.services.mozilla.com/D229621
2024-11-21 17:04:14 +00:00
David Shin
134b10245b Bug 1931466: Ensure inline elements inside an empty line has zero block-size and no baseline in scrolled block frames. r=layout-reviewers,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D229709
2024-11-21 14:10:17 +00:00
David Shin
1497e3303d Bug 1931466: Ensure inline elements in an empty linebox as having zero BSize and no baseline. r=layout-reviewers,dholbert,jfkthame
Also add meta viewport tag to the setup of `/FileAPI/url/url-in-tags.window.js`
WPT - This test passes now, but without this change, the test's viewport gets
automatically zoomed out when run on Android; and that zoom factor can lead to
off-by-one test failures from pixel-rounding discrepancies.

Differential Revision: https://phabricator.services.mozilla.com/D229191
2024-11-20 13:45:16 +00:00
Stanca Serban
404392423a Backed out changeset 0ca96ab68717 (bug 1931466) for causing wpt failures in url-in-tags.window.html. CLOSED TREE 2024-11-20 04:26:23 +02:00
David Shin
8b2797e2bb Bug 1931466: Ensure inline elements in an empty linebox as having zero BSize and no baseline. r=layout-reviewers,dholbert,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D229191
2024-11-19 19:39:21 +00:00
Jonathan Kew
2f12a74934 Bug 1930225 - Update nsBlockFrame marker-property callsites to avoid redundant property lookups. r=layout-reviewers,emilio
No change in observable behavior.

Differential Revision: https://phabricator.services.mozilla.com/D229111
2024-11-15 17:57:18 +00:00
Jonathan Kew
209c03cc6c Bug 1930225 - Ensure nsBlockFrame::Has{Inside,Outside}Marker methods return the correct value even if style has changed since the marker was created. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D229027
2024-11-15 17:57:17 +00:00
Jonathan Kew
fbc42986c1 Bug 1928724 - Ensure we always have a float manager during block-frame reflow. r=layout-reviewers,emilio
Normally we shouldn't be starting reflow from a block that is not a BFC,
and so BlockNeedsFloatManager would return true for the reflow root.

What happens in the testcase here, though, is that we call PresShell::FrameNeedsReflow
for the <article> block (because we've just added a child to it), which is fine:
it's a BFC at that moment.

Then we restyle, and during restyling we remove the NS_BLOCK_BFC flag because the
newly-added element means that the <article> no longer matches ::only-child, and
so we lose the `contain` property that was previously set. So <article> is no longer
a BFC, but we've already recorded it in the PresShell's mDirtyRoots.

We then call PresShell::FrameNeedsReflow for the foreignObject, which adds that
to mDirtyRoots as well.

And then we flush layout, reflowing first the foreignObject (because it is the
shallower of the two dirty-roots) and then the <article> block. We might expect
that the reflow of the SVGForeignObject would fix things, because it would reflow
all its descendants (including <article>) safely, but there's an early-return in
SVGForeignObjectFrame::Reflow in the case where it is zero-sized (which it is here).

So the <article> block remains dirty, and PresShell::ProcessReflowCommands tries
to reflow it directly even though it is no longer a BFC, and that's when we crash
due to not having a float manager.

Removing that early-return from SVGForeignObjectFrame::Reflow would avoid the crash,
but in any case I think we should make nsBlockFrame::Reflow handle this situation
as there may be other code-paths that potentially set up a similar scenario of
attempting to reflow from a root that has lost its BFC-ness.

Differential Revision: https://phabricator.services.mozilla.com/D228778
2024-11-14 10:44:48 +00:00
David Shin
c35c146cbd Bug 1768921 - Ensure that padding inflated bounds of in-flow children are included in the scrollable element's overflow area. r=dholbert
This means that when users scroll to the inline-end of a scroller, they will
see that the inline-end padding of that scroller is added in.

This is achieved by unioning an additional rect into the scrollable element's
overflow area (Which is an accumulation of the recursive overflow-area
contributions from its subtree).

This additional rect is calculated as follows:
- In-flow children and float's margin boxes are unioned (including zero-size boxes)
- The unioned rect is then inflated by the scrollable element's padding

Note: The bounds of zero-area in-flow-child rects are included in this rect,
in both block- and inline- directions. This is a change in behavior; Divs of
huge inline size and zero block size used to not affect the scrollable overflow,
where divs with huge block size and zero inline size did, as a side effect of now
removed `nsBlockFrame::ConsiderBlockEndEdgeOfChildren`.

Note on WPT change sizing-orthog-(vlr|vrl)-in-htb-(008|020)-ref.xht - the padding existed
to force empty space below `p#sentence-after`. However, this only applies to previous
Firefox. Any combination of browser + default font (+ its default size) causing a scroll
would cause the test to fail as false positive (According to wpt.fyi, this is what happens
with sizing-orthog-(vlr|vrl)-008.xht tests). This change brings Firefox's scroll behaviour
inline with other browsers.

Differential Revision: https://phabricator.services.mozilla.com/D151310
2024-11-13 20:29:13 +00:00
Jonathan Kew
fd6b390c9b Bug 1926732 - Relax assertion in FindLineClampTarget because line-clamp may already have been evaluated by a descendant block. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D228579
2024-11-11 14:37:59 +00:00
Jonathan Kew
22d083baba Bug 1926732 - Return a pair of <frame, line> from FindLineClampTarget, to make its API clearer. r=layout-reviewers,emilio
No change in behavior.

Differential Revision: https://phabricator.services.mozilla.com/D228578
2024-11-11 14:37:58 +00:00
Norisz Fay
07ccada8ce Backed out changeset 1445e1cfc71f (bug 1768921) for causing multiple failures CLOSED TREE 2024-11-08 00:09:56 +02:00
David Shin
361dd30414 Bug 1768921 - Ensure that padding inflated bounds of in-flow children are included in the scrollable element's overflow area. r=dholbert
This means that when users scroll to the inline-end of a scroller, they will
see that the inline-end padding of that scroller is added in.

This is achieved by unioning an additional rect into the scrollable element's
overflow area (Which is an accumulation of the recursive overflow-area
contributions from its subtree).

This additional rect is calculated as follows:
- In-flow children and float's margin boxes are unioned (including zero-size boxes)
- The unioned rect is then inflated by the scrollable element's padding

Note: The bounds of zero-area in-flow-child rects are included in this rect,
in both block- and inline- directions. This is a change in behavior; Divs of
huge inline size and zero block size used to not affect the scrollable overflow,
where divs with huge block size and zero inline size did, as a side effect of now
removed `nsBlockFrame::ConsiderBlockEndEdgeOfChildren`.

Note on WPT change sizing-orthog-(vlr|vrl)-in-htb-(008|020)-ref.xht - the padding existed
to force empty space below `p#sentence-after`. However, this only applies to previous
Firefox. Any combination of browser + default font (+ its default size) causing a scroll
would cause the test to fail as false positive (According to wpt.fyi, this is what happens
with sizing-orthog-(vlr|vrl)-008.xht tests). This change brings Firefox's scroll behaviour
inline with other browsers.

Differential Revision: https://phabricator.services.mozilla.com/D151310
2024-11-07 21:03:05 +00:00
longsonr
e3fe0b34a2 Bug 1734476 - Don't run on compositor when content may contain non-scaling-stroke r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D227400
2024-11-07 17:48:55 +00:00
Stanca Serban
439e06e7b2 Backed out changeset c0519f58181d (bug 1734476) for causing build bustages in SVGUtils.cpp. CLOSED TREE 2024-11-07 14:11:10 +02:00
longsonr
e1526d9b0e Bug 1734476 - Don't run on compositor when content may contain non-scaling-stroke r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D227400
2024-11-07 11:03:46 +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
Jonathan Kew
fe3fe5ed30 Bug 1927114 - Rename nsLineBox::RIndexOf to RLIndexOf and make it search from both ends of the line. r=dshin
This does not change the result, only the performance characteristics:
the search will be fast if the target frame is near either edge of the line,
not only if it's at the end.

Also includes a bit of trivial cleanup that I noticed in the surrounding
nsLineBox code. (No changes to behavior.)

Differential Revision: https://phabricator.services.mozilla.com/D226916
2024-10-28 08:03:20 +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
c3d7719c2c Bug 1791226 - Don't paint line-clamped lines. r=layout-reviewers,dshin
This matches the proposal in
https://github.com/w3c/csswg-drafts/pull/10816, and creates much better
behavior.

Differential Revision: https://phabricator.services.mozilla.com/D157578
2024-10-21 10:41:26 +00:00
Cristina Horotan
86102c2240 Backed out changeset c6ce92301ca1 (bug 1791226) for causing assertion failures at nsBlockFrame.cpp on a CLOSED TREE 2024-10-19 04:50:37 +03:00
Emilio Cobos Álvarez
90631bc35d Bug 1791226 - Don't paint line-clamped lines. r=layout-reviewers,dshin
This matches the proposal in
https://github.com/w3c/csswg-drafts/pull/10816, and creates much better
behavior.

Differential Revision: https://phabricator.services.mozilla.com/D157578
2024-10-18 23:03:13 +00:00
Emilio Cobos Álvarez
9381d7e414 Bug 1791226 - Improve line-clamp behavior with padding / nested blocks. r=layout-reviewers,dshin
This matches Blink with border / padding in nested blocks, and seems
worth doing even if we paint the nested lines. Follow-up patch will
prevent painting the nested lines.

Differential Revision: https://phabricator.services.mozilla.com/D157572
2024-10-18 19:21:22 +00:00
Tamas Szentpeteri
3c21e7547c Backed out changeset 8396d1845d92 (bug 1791226) for causing wr failures on webkit-line-clamp-050.html. CLOSED TREE 2024-10-18 20:08:05 +03:00
Emilio Cobos Álvarez
f38521a63a Bug 1791226 - Harvest a block frame state bit. r=layout-reviewers,jfkthame
This will be useful.

Differential Revision: https://phabricator.services.mozilla.com/D223433
2024-10-18 13:10:54 +00:00
Emilio Cobos Álvarez
5d2e26f710 Bug 1791226 - Improve line-clamp behavior with padding / nested blocks. r=layout-reviewers,dshin
This matches Blink with border / padding in nested blocks, and seems
worth doing even if we paint the nested lines. Follow-up patch will
prevent painting the nested lines.

Differential Revision: https://phabricator.services.mozilla.com/D157572
2024-10-18 12:15:15 +00:00
Timothy Nikkel
4f863bbf4d Bug 1924698. Avoid a few blockframe queryframes. r=jwatt
Saw these in the long tail of a profile of an sp3 test.

Differential Revision: https://phabricator.services.mozilla.com/D225633
2024-10-17 12:05:27 +00:00
Emilio Cobos Álvarez
cb41273547 Bug 1922900 - container-type should stablish a BFC, but not layout containment. r=layout-reviewers,firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D224764
2024-10-08 06:49:14 +00:00
Emilio Cobos Álvarez
130cfff85c Bug 1920603 - Templatize line-list iterators. r=layout-reviewers,jfkthame
No behavior change, but this removes a bunch of duplicated code.

Differential Revision: https://phabricator.services.mozilla.com/D223235
2024-09-24 11:22:02 +00:00
Ting-Yu Lin
aa389ab830 Bug 1917144 Part 2 - Add IntrinsicSizeInput::mContainingBlockSize. r=dholbert
Currently, only the grid container needs the containing block size to resolve
the transferred min and max sizes for `repeat()` function in
`nsGridContainerFrame::ComputeIntrinsicISize()`.

This patch is a preparation for Bug 1865438. `mContainingBlockSize` will be used
there, so it does not change any behavior yet.

Differential Revision: https://phabricator.services.mozilla.com/D221333
2024-09-11 18:01:40 +00:00
Ting-Yu Lin
07296da4c0 Bug 1917144 Part 1 - Rename mPercentageBasis to mPercentageBasisForChildren in IntrinsicSizeInput. r=dholbert
Rename `mPercentageBasis` to `mPercentageBasisForChildren` to clarify that the
percentage basis is intended for resolving the percentage sizes for child
frames.

Differential Revision: https://phabricator.services.mozilla.com/D221332
2024-09-11 18:01:39 +00:00
Ting-Yu Lin
0a5e62e315 Bug 1909761 Part 4 - Construct a percentage basis when computing children's intrinsic inline size contributions. r=dholbert
A percentage basis is needed to resolve percentage block size when computing
children's intrinsic inline size contributions. This is necessary for a child or
descendants with a preferred aspect-ratio so that the block size can transfer
through the aspect-ratio to become an intrinsic inline size.

The change in `nsFlexContainerFrame::ComputeIntrinsicISize()` is necessary to
keep us passing
`testing/web-platform/tests/css/css-flexbox/image-nested-within-definite-column-flexbox.html`.

The change in `nsPlaceholderFrame::AddFloatToIntrinsicISizeData()` is necessary
to keep us passing
`testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-010.html`.

`GetISizeInfo()` in BasicTableLayoutStrategy.cpp is modified to pass table cell
frame's bsize as percentage basis. Otherwise,
`layout/reftests/bugs/522632-1.html` fails. This is our current behavior, but it
is bug 1461852.

Differential Revision: https://phabricator.services.mozilla.com/D219523
2024-09-03 04:25:42 +00:00
Ting-Yu Lin
116ca76700 Bug 1909761 Part 3 - Use IntrinsicSizeInput for AddInlineMinISize() and AddInlinePrefISize(). r=dholbert
Another preparation patch in order to pass down a percentage basis when
computing intrinsic size.

Differential Revision: https://phabricator.services.mozilla.com/D219522
2024-09-03 04:25:42 +00:00
Ting-Yu Lin
6af05a0977 Bug 1909761 Part 2 - Create a helper struct IntrinsicSizeInput to aggregate needed data when computing intrinsic inline size. r=dholbert
This patch changes the signature to `GetMinISize()`, `GetPrefISize()`,
`IntrinsicISize` by adding a helper struct as a preparation. Then we can just
add more data such as a percentage basis to the struct without altering the
signature in the future.

When passing `IntrinsicSizeInput` struct down to another helper method, we
generally just pass the original one if the method is computing the intrinsic
size of our own or our anonymous children. If the method is computing our
children's intrinsic contribution, we'll need to create a brand new
`IntrinsicSizeInput` for our children.

Differential Revision: https://phabricator.services.mozilla.com/D219521
2024-09-03 04:25:41 +00:00
Butkovits Atila
4d06404349 Backed out 6 changesets (bug 1909761) for causing failures at test_contextmenu_rtl.xhtml. CLOSED TREE
Backed out changeset 1e9f47784a54 (bug 1909761)
Backed out changeset d2dcf159185b (bug 1909761)
Backed out changeset 3f48c106bff9 (bug 1909761)
Backed out changeset 38d1e5eda09d (bug 1909761)
Backed out changeset 8de556490289 (bug 1909761)
Backed out changeset 4e7f22f43bb4 (bug 1909761)
2024-08-28 10:44:09 +03:00