Commit Graph

421 Commits

Author SHA1 Message Date
Jonathan Kew
81aeec5e3f Bug 1521088 - Make an inner table frame with unconstrained block-size copy the IsBResize flag from its table-wrapper parent. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D247456
2025-05-01 17:52:24 +00:00
Jonathan Kew
23d6472fed Bug 1954866 - Set dependsOnCBBSize during ReflowInput::InitResizeFlags for orthogonal flows. r=layout-reviewers,emilio
This makes resizing work correctly for the examples here; a WPT reftest
version of the reduced testcase is included.

Note that this does *not* address cases where the orthogonal flow depends
more indirectly on the ICB size, as seen in bug 1953570.

Differential Revision: https://phabricator.services.mozilla.com/D247272
2025-05-01 15:23:03 +00:00
Sebastian Hengst
072396dff2 Revert "Bug 1954866 - Set dependsOnCBBSize during ReflowInput::InitResizeFlags for orthogonal flows. r=layout-reviewers,emilio"
This reverts commit b810e275c4.
2025-04-30 19:56:50 +00:00
Jonathan Kew
b810e275c4 Bug 1954866 - Set dependsOnCBBSize during ReflowInput::InitResizeFlags for orthogonal flows. r=layout-reviewers,emilio
This makes resizing work correctly for the examples here; a WPT reftest
version of the reduced testcase is included.

Note that this does *not* address cases where the orthogonal flow depends
more indirectly on the ICB size, as seen in bug 1953570.

Differential Revision: https://phabricator.services.mozilla.com/D247272
2025-04-30 16:51:36 +00:00
Jonathan Kew
7ae452b85e Bug 1961753 - Handle alignment properly in orthogonal table cells without an explicit inline-size. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D246976
2025-04-29 07:32:46 +00:00
Jonathan Kew
a6c27768f7 Bug 1958228 - Respect a fixed block-size of the containing block of an orthogonal flow. r=layout-reviewers,emilio,jwatt
This currently causes test failures on css-writing-modes/available-size-{020,021}.html,
but the new result matches Chrome's and I believe is what the spec now requires.

I'll wait to see Ian's planned test update
(https://github.com/web-platform-tests/wpt/pull/51315#issuecomment-2773908705)
to confirm the behavior before trying to land this.

Differential Revision: https://phabricator.services.mozilla.com/D244307
2025-04-17 17:09:30 +00:00
Jonathan Kew
183c59ae36 Bug 1958022 - For cells that are orthogonal to the table structure, do a final reflow after the cell size is known, to properly align content. r=dshin
We can't get text-align right during the initial table reflow because the
inline-size within which the cell content is to be aligned is not yet known
(it'll come from the block-size we compute for the parent row).

So to deal with this, we record during tableRowFrame reflow whether any
cells with orthogonal writing mode were present; and if so, at the end of
the row reflow, we make another pass over the orthogonal cells and reflow
them to properly align their content within the computed cell size.

Differential Revision: https://phabricator.services.mozilla.com/D245615
2025-04-16 18:40:46 +00:00
Jonathan Kew
8b11a7e748 Bug 1950732 - Avoid spurious shrink-wrapping for descendants of an orthogonal table-cell's inner anonymous-block frame. r=layout-reviewers,AlaskanEmily
The table cell's inner frame itself will be shrink-wrapped, but we don't want to also
shrink-wrap its descendant blocks, as that prevents them being sized or aligned properly
to fit the cell.

So instead of checking whether the frame is orthogonal to mCBReflowInput (which may
still refer to the table-cell frame, whose writing mode does not reflect the writing
mode  of its inner content), check against alignCB (the parent within which this frame
is aligned).

Differential Revision: https://phabricator.services.mozilla.com/D245148
2025-04-11 08:27:48 +00:00
David Shin
85c922b0dd Bug 1923959: Resolve anchor for (max) sizes. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D240864
2025-04-08 02:29:18 +00:00
David Shin
40e6a5c66e Bug 1923959: Resolve anchor for margins. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D240863
2025-04-08 02:29:18 +00:00
David Shin
9dcac8482f Bug 1957747: Remove ResolveWithAnchor. r=firefox-style-system-reviewers,emilio
Since we're replacing anchor functions in calc nodes in advance, we only need
to resolve percentage bases.

Differential Revision: https://phabricator.services.mozilla.com/D244082
2025-04-02 21:30:54 +00:00
Jonathan Kew
958866a401 Bug 1949064 - Improve setup of AvailableISize for orthogonal flows in ReflowInput. r=layout-reviewers,emilio
The old "orthogonal limit" in ReflowInput was a rather ad hoc mechanism created
during the early implementation of writing modes, to avoid reflowing orthogonal
flows with unconstrained inline size. The spec has since been clarified to describe
the expected behavior in more detail, and we can dispense with the orthogonal-limit
concept and instead implement the constraints called for in the spec.

With this, we pass all the css-writing-modes/available-size-* tests (as well as
fixing a couple of other testcases that are dependent on this behavior).

Differential Revision: https://phabricator.services.mozilla.com/D241117
2025-03-12 11:17:29 +00:00
David Shin
6f967ea7c1 Bug 1950903: Fix up anchor resolution for insets in ReflowInput. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D239928
2025-03-03 14:26:17 +00:00
Jonathan Kew
f62e754650 Bug 1769799 - Handle inline-axis directionality correctly in ReflowInput::InitAbsoluteConstraints. r=layout-reviewers,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D239662
2025-02-26 09:13:48 +00:00
David Shin
44a8158034 Bug 1947482: Anchor resolution takes axis, not side. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D238962
2025-02-20 21:22:10 +00:00
Alexandru Marc
3cc336f1e0 Backed out changeset 4d1903e35fc5 (bug 1947482) for causing build bustages @ ServoStyleConstsInlines.h 2025-02-20 21:34:50 +02:00
David Shin
894d84866a Bug 1947482: Anchor resolution takes axis, not side. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D238962
2025-02-20 18:26:22 +00:00
Otto Länd
1850172898 Bug 1942715: apply code formatting via Lando
# ignore-this-changeset
2025-02-12 01:46:16 +00:00
David Shin
d138dbfb8c Bug 1942715: Part 5 - Remove Maybe* optimizations for insets, always working with anchor-resolved insets. r=firefox-style-system-reviewers,emilio
Reasoning with these functions gets confusing, because anchor
functions can become percentage as well as auto.
Defer optimization for now.

Differential Revision: https://phabricator.services.mozilla.com/D237098
2025-02-12 01:31:30 +00:00
David Shin
4dc4e2d920 Bug 1942715: Part 4 - Switch to using a more transparent wrapper. r=firefox-style-system-reviewers,emilio
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.

Differential Revision: https://phabricator.services.mozilla.com/D237097
2025-02-12 01:31:30 +00:00
David Shin
72e65118b1 Bug 1942715: Part 2 - Use the new resolution path for resolving anchor functions in math functions for insets. r=firefox-style-system-reviewers,emilio
Try to resolve math function nodes with percentage basis of zero. Invalid
anchor functions will make the value Invalid-At-Computed-Value-Time (i.e.
`auto`), so that is handled. Otherwise, `CalcNode` existing indicates use
of percentage values and/or anchor functions. If only anchor functions
are used, we can use the resolved value as-is - otherwise, it must be
re-resolved before its value is queried.
This is of course redundant, and may require some optimization down
the line (We don' eagerly get percentage basis since that requires
ancestor traversal that may be wasted).

Differential Revision: https://phabricator.services.mozilla.com/D237095
2025-02-12 01:31:29 +00:00
Butkovits Atila
e51ff081c6 Backed out 6 changesets (bug 1942715) for causing build bustages. CLOSED TREE
Backed out changeset 1433202bd2f3 (bug 1942715)
Backed out changeset d9ce2be09cd0 (bug 1942715)
Backed out changeset 9789581a42a3 (bug 1942715)
Backed out changeset 9a18f1aca5d5 (bug 1942715)
Backed out changeset 46bd0cb031f4 (bug 1942715)
Backed out changeset 73fec8bae045 (bug 1942715)
2025-02-12 01:45:46 +02:00
Otto Länd
49c107da21 Bug 1942715: apply code formatting via Lando
# ignore-this-changeset
2025-02-11 23:20:36 +00:00
David Shin
d2c459be6d Bug 1942715: Part 5 - Remove Maybe* optimizations for insets, always working with anchor-resolved insets. r=firefox-style-system-reviewers,emilio
Reasoning with these functions gets confusing, because anchor
functions can become percentage as well as auto.
Defer optimization for now.

Differential Revision: https://phabricator.services.mozilla.com/D237098
2025-02-11 21:06:24 +00:00
David Shin
c536f3deb5 Bug 1942715: Part 4 - Switch to using a more transparent wrapper. r=firefox-style-system-reviewers,emilio
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.

Differential Revision: https://phabricator.services.mozilla.com/D237097
2025-02-11 21:06:24 +00:00
David Shin
aada1ca6dd Bug 1942715: Part 2 - Use the new resolution path for resolving anchor functions in math functions for insets. r=firefox-style-system-reviewers,emilio
Try to resolve math function nodes with percentage basis of zero. Invalid
anchor functions will make the value Invalid-At-Computed-Value-Time (i.e.
`auto`), so that is handled. Otherwise, `CalcNode` existing indicates use
of percentage values and/or anchor functions. If only anchor functions
are used, we can use the resolved value as-is - otherwise, it must be
re-resolved before its value is queried.
This is of course redundant, and may require some optimization down
the line (We don' eagerly get percentage basis since that requires
ancestor traversal that may be wasted).

Differential Revision: https://phabricator.services.mozilla.com/D237095
2025-02-11 21:06:23 +00:00
Butkovits Atila
fd3125f8e5 Backed out 6 changesets (bug 1942715) for causing build bustages. CLOSED TREE
Backed out changeset 7c5cfe6bbaeb (bug 1942715)
Backed out changeset cc5530b02046 (bug 1942715)
Backed out changeset 5a534f455cc3 (bug 1942715)
Backed out changeset ecdd7307c9f1 (bug 1942715)
Backed out changeset 05a62c484807 (bug 1942715)
Backed out changeset a9825ee69550 (bug 1942715)
2025-02-11 22:17:26 +02:00
Otto Länd
1110401843 Bug 1942715: apply code formatting via Lando
# ignore-this-changeset
2025-02-11 19:39:31 +00:00
David Shin
a3d93f384a Bug 1942715: Part 5 - Remove Maybe* optimizations for insets, always working with anchor-resolved insets. r=firefox-style-system-reviewers,emilio
Reasoning with these functions gets confusing, because anchor
functions can become percentage as well as auto.
Defer optimization for now.

Differential Revision: https://phabricator.services.mozilla.com/D237098
2025-02-11 18:19:56 +00:00
David Shin
96712d3db0 Bug 1942715: Part 4 - Switch to using a more transparent wrapper. r=firefox-style-system-reviewers,emilio
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.

Differential Revision: https://phabricator.services.mozilla.com/D237097
2025-02-11 18:19:56 +00:00
David Shin
c69b19f02a Bug 1942715: Part 2 - Use the new resolution path for resolving anchor functions in math functions for insets. r=firefox-style-system-reviewers,emilio
Try to resolve math function nodes with percentage basis of zero. Invalid
anchor functions will make the value Invalid-At-Computed-Value-Time (i.e.
`auto`), so that is handled. Otherwise, `CalcNode` existing indicates use
of percentage values and/or anchor functions. If only anchor functions
are used, we can use the resolved value as-is - otherwise, it must be
re-resolved before its value is queried.
This is of course redundant, and may require some optimization down
the line (We don' eagerly get percentage basis since that requires
ancestor traversal that may be wasted).

Differential Revision: https://phabricator.services.mozilla.com/D237095
2025-02-11 18:19:55 +00:00
Daniel Holbert
5b16a6571d Bug 1946530: Introduce a utility function to convert a LogicalPoint to a different WritingMode, interpreting it as the origin of some rect. r=jfkthame,TYLin
This patch shouldn't change behavior; it's just refactoring a particular
pattern into a helper method.

Differential Revision: https://phabricator.services.mozilla.com/D237249
2025-02-07 20:45:11 +00:00
David Shin
8224327ca7 Bug 1943591: Remove unused ReflowInput functions. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D235438
2025-01-24 15:46:09 +00:00
Otto Länd
d7c1f9d5eb Bug 1923763: apply code formatting via Lando
# ignore-this-changeset
2025-01-21 15:14:37 +00:00
David Shin
3d615cb7f6 Bug 1923763: Part 5 - Replace inset evaluations with anchor-resolved inset evaluations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231259
2025-01-21 15:11:25 +00:00
Stanca Serban
4a35296e0c Backed out 7 changesets (bug 1923763) for causing build bustages in nsStyleStruct.cpp. CLOSED TREE
Backed out changeset d55070e64ced (bug 1923763)
Backed out changeset a92a0bc6047f (bug 1923763)
Backed out changeset 2203e2c5268e (bug 1923763)
Backed out changeset 0cc5e744c01a (bug 1923763)
Backed out changeset d2139afa933b (bug 1923763)
Backed out changeset 93e59980eac1 (bug 1923763)
Backed out changeset 8018734b5491 (bug 1923763)
2025-01-21 11:10:22 +02:00
Otto Länd
fc4316eae4 Bug 1923763: apply code formatting via Lando
# ignore-this-changeset
2025-01-20 23:58:00 +00:00
David Shin
6b9f17e7ff Bug 1923763: Part 5 - Replace inset evaluations with anchor-resolved inset evaluations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231259
2025-01-20 23:54:50 +00:00
Daniel Holbert
d153465dd3 Bug 1933408 part 1: Implement layout support for 'stretch' as a block-axis size (with '-webkit-fill-available' as an alias). r=TYLin
Note that both keywords are disabled in the CSS parser for now, behind
these about:config prefs:
layout.css.stretch-size-keyword.enabled
layout.css.webkit-fill-available.enabled

Prior to this patch, we handled both keywords as pure aliases for
'-moz-available' (which has the correct 'stretch' behavior in the inline axis
but which just behaves like the initial value in the block axis).

This patch changes that so that 'stretch' and '-webkit-fill-available' will now
actually do the right thing in the block axis (if they're enabled at all, via
their aforementioned about:config prefs).

The relevant spec text here is:
https://drafts.csswg.org/css-sizing-4/#valdef-width-stretch
https://drafts.csswg.org/css-sizing-4/#stretch-fit-sizing

Differential Revision: https://phabricator.services.mozilla.com/D217688
2024-12-14 06:35:06 +00:00
Jonathan Kew
0813b3e111 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 22:58:46 +00:00
Alexandru Marc
ed1511635d Backed out 2 changesets (bug 1887465) for causing build bustages @ WritingModes.h . CLOSED TREE
Backed out changeset 5203c09eceb4 (bug 1887465)
Backed out changeset 0507fcccf575 (bug 1887465)
2024-11-25 18:47:23 +02:00
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
Jonathan Watt
7532be254f Bug 1931736. Add missing braces around if/loop statements in layout/generic/. r=layout-reviewers,emilio
Depends on D229247

Differential Revision: https://phabricator.services.mozilla.com/D229248
2024-11-17 05:03:58 +00:00
David Shin
9acf936b11 Bug 1920160: Part 3 - Don't forcefully stretch size of absolutely-positioned boxes. r=jwatt,firefox-style-system-reviewers,emilio
We no longer always fill the available space, which then may be aligned.

Differential Revision: https://phabricator.services.mozilla.com/D226529
2024-11-07 16:33:41 +00:00
David Shin
06ae6f340c Bug 1920160: Part 2 - Document old inset behaviour vs spec behaviour. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D226528
2024-11-07 16:33:40 +00:00
David Shin
3d33778d3a Bug 1920160: Part 1 - Don't force overconstrained margins to ignore end-side margins. r=jwatt,firefox-style-system-reviewers,emilio
Current alignment spec [1] allows the margin-box of an absolutely
positioned elements to be aligned within the inset-reduced absolute
containing box, so just let the overconstrained margin be.

[1]: https://drafts.csswg.org/css-position-3/#abspos-layout

Differential Revision: https://phabricator.services.mozilla.com/D226527
2024-11-07 16:33:40 +00:00
Stanca Serban
97f84cfe33 Backed out 7 changesets (bug 1920160) for causing mochitests plain failures in test_videocontrols_vtt.html. CLOSED TREE
Backed out changeset 5d57a3a8d6aa (bug 1920160)
Backed out changeset d57f1f6f293b (bug 1920160)
Backed out changeset 8bfb6f9eab80 (bug 1920160)
Backed out changeset 45c61a69b9b8 (bug 1920160)
Backed out changeset b64bfe84e60a (bug 1920160)
Backed out changeset 26f7d594f6e0 (bug 1920160)
Backed out changeset 71d051b7857a (bug 1920160)
2024-11-05 04:11:47 +02:00
David Shin
7a29145287 Bug 1920160: Part 3 - Don't forcefully stretch size of absolutely-positioned boxes. r=jwatt,firefox-style-system-reviewers,emilio
We no longer always fill the available space, which then may be aligned.

Differential Revision: https://phabricator.services.mozilla.com/D226529
2024-11-05 00:44:43 +00:00
David Shin
fc18417145 Bug 1920160: Part 2 - Document old inset behaviour vs spec behaviour. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D226528
2024-11-05 00:44:42 +00:00
David Shin
c1b9f09d81 Bug 1920160: Part 1 - Don't force overconstrained margins to ignore end-side margins. r=jwatt,firefox-style-system-reviewers,emilio
Current alignment spec [1] allows the margin-box of an absolutely
positioned elements to be aligned within the inset-reduced absolute
containing box, so just let the overconstrained margin be.

[1]: https://drafts.csswg.org/css-position-3/#abspos-layout

Differential Revision: https://phabricator.services.mozilla.com/D226527
2024-11-05 00:44:42 +00:00