Commit Graph

2197 Commits

Author SHA1 Message Date
Emily McDonough
ddcdb3c978 Bug 1819335 Part 1 - Do not create a forced break for CSS named page change immediately before an nsPageBreakFrame. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D191710
2023-10-30 20:06:19 +00:00
Jonathan Kew
6a6166267d Bug 1860932 - Check for empty line list in the prev-in-flow. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D191872
2023-10-25 19:03:57 +00:00
Jonathan Kew
68d208c793 Bug 784648 - Implement the 'hanging' and 'each-line' options for CSS text-indent. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D191522
2023-10-23 15:12:23 +00:00
Jonathan Kew
36707c7664 Bug 1858421 - Don't attempt text-wrap:balance if there are block line-boxes. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D190778
2023-10-12 12:38:33 +00:00
Jonathan Kew
feb321780c Bug 1856629 - More careful null-checking in nsBlockFrame::Reflow. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D189963
2023-10-04 07:28:54 +00:00
Jonathan Kew
538421eb0c Bug 1731541 - When line-clamp is in effect, make text-wrap:balance consider only the lines up to the clamp limit. r=emilio
This corresponds to how Chrome behaves, and passes the test they included in WPT.

It's unclear to me whether this behavior actually follows from the current spec
(see https://github.com/w3c/csswg-drafts/issues/9310), but it seems to be the desired
result.

(I've put it behind a (default-enabled) pref for now, so that it's possible to
experiment with the two possible interpretations, but we can remove the pref once
the spec question is clarified/confirmed.)

This patch also disables balancing for fragmented/overflowing blocks, as that will
not currently work well. We may want to address that as a followup issue (though it
won't matter to the primary balance use-cases such as titles).

Depends on D188139

Differential Revision: https://phabricator.services.mozilla.com/D188220
2023-09-30 15:53:13 +00:00
Jonathan Kew
2f9632a6a3 Bug 1731541 - Implement text-wrap: balance for nsBlockFrame reflow. r=emilio
A simple form of balance for short blocks, implemented by incrementally reducing
the effective inline-size used during line-breaking, up to the point where an
extra line would be created.

This fails the test text-wrap-balance-line-clamp-001.html, but it's unclear to me
if that test is correct (see https://github.com/w3c/csswg-drafts/issues/9310).
If we do want the behavior expected by that test, an additional patch to handle
the interaction with line-clamp will be required.

Depends on D187543

Differential Revision: https://phabricator.services.mozilla.com/D187544
2023-09-30 15:53:12 +00:00
Sandor Molnar
53fea6e6ed Backed out 5 changesets (bug 1731541) for causing multiple wpt failures. CLOSED TREE
Backed out changeset c185a38fb335 (bug 1731541)
Backed out changeset 16a3de29e4e6 (bug 1731541)
Backed out changeset 225642ff1de8 (bug 1731541)
Backed out changeset eb0b125d3214 (bug 1731541)
Backed out changeset af42a433722a (bug 1731541)
2023-09-28 23:49:24 +03:00
Jonathan Kew
f6eda27ec4 Bug 1731541 - When line-clamp is in effect, make text-wrap:balance consider only the lines up to the clamp limit. r=emilio
This corresponds to how Chrome behaves, and passes the test they included in WPT.

It's unclear to me whether this behavior actually follows from the current spec
(see https://github.com/w3c/csswg-drafts/issues/9310), but it seems to be the desired
result.

(I've put it behind a (default-enabled) pref for now, so that it's possible to
experiment with the two possible interpretations, but we can remove the pref once
the spec question is clarified/confirmed.)

This patch also disables balancing for fragmented/overflowing blocks, as that will
not currently work well. We may want to address that as a followup issue (though it
won't matter to the primary balance use-cases such as titles).

Depends on D188139

Differential Revision: https://phabricator.services.mozilla.com/D188220
2023-09-28 17:28:20 +00:00
Jonathan Kew
fa67514884 Bug 1731541 - Implement text-wrap: balance for nsBlockFrame reflow. r=emilio
A simple form of balance for short blocks, implemented by incrementally reducing
the effective inline-size used during line-breaking, up to the point where an
extra line would be created.

This fails the test text-wrap-balance-line-clamp-001.html, but it's unclear to me
if that test is correct (see https://github.com/w3c/csswg-drafts/issues/9310).
If we do want the behavior expected by that test, an additional patch to handle
the interaction with line-clamp will be required.

Depends on D187543

Differential Revision: https://phabricator.services.mozilla.com/D187544
2023-09-28 17:28:19 +00:00
Natalia Csoregi
4a88c0e9b1 Backed out 4 changesets (bug 1731541) for causing bustage on nsBlockFrame.cpp. CLOSED TREE
Backed out changeset 7ce2b41bb730 (bug 1731541)
Backed out changeset 71d889de8d97 (bug 1731541)
Backed out changeset 0fd4431f5279 (bug 1731541)
Backed out changeset 5926241957b4 (bug 1731541)
2023-09-28 12:09:30 +03:00
Jonathan Kew
5035b5fdcf Bug 1731541 - When line-clamp is in effect, make text-wrap:balance consider only the lines up to the clamp limit. r=emilio
This corresponds to how Chrome behaves, and passes the test they included in WPT.

It's unclear to me whether this behavior actually follows from the current spec
(see https://github.com/w3c/csswg-drafts/issues/9310), but it seems to be the desired
result.

(I've put it behind a (default-enabled) pref for now, so that it's possible to
experiment with the two possible interpretations, but we can remove the pref once
the spec question is clarified/confirmed.)

This patch also disables balancing for fragmented/overflowing blocks, as that will
not currently work well. We may want to address that as a followup issue (though it
won't matter to the primary balance use-cases such as titles).

Depends on D188139

Differential Revision: https://phabricator.services.mozilla.com/D188220
2023-09-28 08:31:21 +00:00
Jonathan Kew
807cb41315 Bug 1731541 - Implement text-wrap: balance for nsBlockFrame reflow. r=emilio
A simple form of balance for short blocks, implemented by incrementally reducing
the effective inline-size used during line-breaking, up to the point where an
extra line would be created.

This fails the test text-wrap-balance-line-clamp-001.html, but it's unclear to me
if that test is correct (see https://github.com/w3c/csswg-drafts/issues/9310).
If we do want the behavior expected by that test, an additional patch to handle
the interaction with line-clamp will be required.

Depends on D187543

Differential Revision: https://phabricator.services.mozilla.com/D187544
2023-09-28 08:31:20 +00:00
fantasai
2ac823adb9 Bug 1854634 - cleaner casting for mutable aReflowInput in nsBlockFrame::Reflow. r=layout-reviewers,jfkthame
This is the first patch of bug 1684236 tweaked as per review comments.
Keeps us with one source of truth for reflowInput.

This could be cleaned up in the future if we manage to remove that
printing hack or what not.

Co-Authored-By: fantasai <fantasai.cvs@inkedblade.net>

Differential Revision: https://phabricator.services.mozilla.com/D181857
2023-09-22 23:22:47 +00: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
Emilio Cobos Álvarez
6c324c6d1b Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-07 11:46:30 +00:00
Narcis Beleuzu
33592fec5e Backed out changeset 55052ae7d067 (bug 1851868) for reftest failure on 1153695.html . CLOSED TREE 2023-09-07 02:42:25 +03:00
Emilio Cobos Álvarez
0698c96bd1 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-06 22:34:35 +00:00
Emily McDonough
d7e8fb5b2e Bug 1848407 - Ensure that zero-height block frame lines will be placed on the next page when break-after: page is set. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D186061
2023-08-17 17:05:15 +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
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
Cathie Chen
0dc8c7e620 Bug 1816474 - Assertion failure: IsHiddenByContentVisibilityOfInFlowParentForLayout() in nsIFrame.cpp, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D182805
2023-07-17 14:46:10 +00:00
David Shin
cd09d0a351 Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-17 12:56:54 +00:00
Sandor Molnar
3faee50252 Backed out 3 changesets (bug 1809568) for causing build bustages in layout/generic/nsLineLayout.cpp CLOSED TREE
Backed out changeset 6c5bbcbafce9 (bug 1809568)
Backed out changeset b518133a5c34 (bug 1809568)
Backed out changeset 2407088e9b49 (bug 1809568)
2023-05-17 01:34:42 +03:00
Ting-Yu Lin
3cc1614e96 Bug 1833238 Part 2 - Always pull back floats from pushed floats list to floats list when reflowing a block. r=emilio
When balancing columns, if a block frame doesn't have enough available
block-size for a float's continuation, we move the float continuation into the
block's pushed floats list.

Typically, the float's continuation is expected to be pulled by the block's next
continuation and reflow there. However, if the block happens to be in the *last*
column, the float continuation will stay in the pushed float list until we
reflow its block again in the next column balancing loop. In this case, we
should pull it from the pushed floats list regardless of whether the
continuation has a previous continuation or not. Otherwise, it will not be
reflowed if it remains in the pushed floats list.

Differential Revision: https://phabricator.services.mozilla.com/D178141
2023-05-16 20:55:33 +00:00
Ting-Yu Lin
2a9619e15e Bug 1833238 Part 1 - Minor refactor in nsBlockFrame::DrainSelfPushedFloats(). r=emilio
This patch shouldn't change the behavior.

- Use `nsIFrame::PresShell()` to get PresShell directly.
- Rewrite the loop, and rename `next` to `prevSibling` for clarity.

Differential Revision: https://phabricator.services.mozilla.com/D178140
2023-05-16 20:55:33 +00:00
David Shin
33ec2490df Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-16 20:48:18 +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
Sandor Molnar
146a43a1bc Backed out 3 changesets (bug 1809568) for causing node devtools failures in devtools/client/debugger/src/components/test/QuickOpenModal.spec.js CLOSED TREE
Backed out changeset 56ce741da8f5 (bug 1809568)
Backed out changeset 5a91ce4870e4 (bug 1809568)
Backed out changeset cc00422f050a (bug 1809568)
2023-05-16 22:22:31 +03:00
David Shin
970986fac9 Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-16 19:02:11 +00:00
Cristian Tuns
aa3e994c56 Backed out 3 changesets (bug 1809568) for causing build bustages on nsLineLayout.cpp CLOSED TREE
Backed out changeset e862b1560caa (bug 1809568)
Backed out changeset 0a20b91de67b (bug 1809568)
Backed out changeset 6060fc7d49d4 (bug 1809568)
2023-05-15 13:03:03 -04:00
David Shin
6f868ef403 Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-15 14:34:26 +00:00
Ting-Yu Lin
f489e56a7a Bug 1830192 - Fix fragmentation for blocks with auto height and fixed max-height. r=dholbert
The only functional change in this patch is the added `else` clause.

Other changes are non-functional such as removing the `Note` and retrieving
block-end BP directly from `borderPadding` (an alias of
`BlockReflowState::BorderPadding()`). We can simplify it because nowadays
`BlockReflowState::BorderPadding()` won't skip the block-end border and padding,
and `mBorderPadding` is initialized with `PreReflowBlockLevelLogicalSkipSides()`
[1], which always assumes the current fragment is the last fragment.

The only difference between the added test and reference file are `height` and
`max-height`, so the test verifies the fragmentation are consistent internally.

[1] https://searchfox.org/mozilla-central/rev/4a5c56f4aca291802ce27320cd9a752dd5dd955e/layout/generic/BlockReflowState.cpp#43-46

Differential Revision: https://phabricator.services.mozilla.com/D176614
2023-05-10 01:24:02 +00:00
Ting-Yu Lin
afdbeac05d Bug 1831976 - Fix typos in comments regarding CSS named pages pref. r=dholbert
Replace underscore with hyphen in the pref name.

Differential Revision: https://phabricator.services.mozilla.com/D177421
2023-05-09 00:10:44 +00:00
Cosmin Sabou
44343a085c Backed out 3 changesets (bug 1809568) for causing build bustages on nsBlockFrame.cpp. CLOSED TREE
Backed out changeset eaa7fe280317 (bug 1809568)
Backed out changeset ab0f2bcb2d9b (bug 1809568)
Backed out changeset a481bf06452b (bug 1809568)
2023-05-01 21:42:14 +03:00
David Shin
65b6b0c69f Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-01 17:04:27 +00:00
Iulian Moraru
babc5faa23 Backed out 3 changesets (bug 1809568) for causing build bustages on nsLineLayout.cpp. CLOSED TREE
Backed out changeset 573dc0bd9554 (bug 1809568)
Backed out changeset b8401947aea0 (bug 1809568)
Backed out changeset 7ecabe895121 (bug 1809568)
2023-05-01 17:59:21 +03:00
David Shin
9e2157483e Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-01 13:44:43 +00:00
WhiteMind
949f553649 Bug 1827411 - Compilation failure when enabling NOISY_FINAL_SIZE or REALLY_NOISY_REFLOW flags. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175210
2023-04-12 08:40:41 +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
Ting-Yu Lin
b22e81c2af Bug 1055894 - Add GetLogicalNormalRect() and adapt some callers of GetNormalRect(). r=emilio
This patch makes the API nicer, and shouldn't change the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D174344
2023-04-01 04:17:05 +00:00
Emily McDonough
acfa5ad4ff Bug 1824490 - Use the end page value rather than the start page value of the previous frame when performing named-page breakpoints r=dholbert
Adding the test from this bug so that this can't happen next time.

Differential Revision: https://phabricator.services.mozilla.com/D174037
2023-03-30 21:58:08 +00:00
Iulian Moraru
db6eec8020 Backed out changeset a13beb2f76da (bug 1824490) for causing wp failures on page-name-002-print.html. CLOSED TREE 2023-03-30 03:59:44 +03:00
Emily McDonough
a7bf759795 Bug 1824490 - Use the end page value rather than the start page value of the previous frame when performing named-page breakpoints r=dholbert
Adding the test from this bug so that this can't happen next time.

Differential Revision: https://phabricator.services.mozilla.com/D174037
2023-03-29 23:22:58 +00:00
Ting-Yu Lin
5d9268a360 Bug 1817235 - Add a web-platform test to exercise text-align-last for a block split in multicol. r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D173597
2023-03-26 23:05:33 +00:00
Fred Chasen
7ae28190ca Bug 1818227 - Prevent drawing backplate when forced-color-adjust is none r=emilio
Prevents backplates from being drawn for any text that has forced-color-adjust: none set by checking the value of StyleText()->mForcedColorAdjust.

Differential Revision: https://phabricator.services.mozilla.com/D173362
2023-03-24 16:48:35 +00:00