Automatic update from web-platform-tests
Obey `min-block-size` and `max-block-size` in floats
We were using the unclamped `box_size.block` instead of `block_size`.
Signed-off-by: Oriol Brufau <[email protected]>
--
wpt-commits: f31fb8f12a52a104ef20b28b4127638881bbc33c
wpt-pr: 47849
Automatic update from web-platform-tests
Respect min/max constraints in the block axis of block containers
Consider a block container that establishes an inline formatting context
and has a definite `block-size` which is clamped by `min-block-size` or
`max-block-size`.
We were already sizing such container correctly, however, its contents
were resolving their percentages against the unclamped `block-size`
value.
This patch fixes the `ContainingBlock` that we pass to the contents so
that they resolve percentages correctly.
Co-authored-by: Martin Robinson <[email protected]>
Signed-off-by: Oriol Brufau <[email protected]>
--
wpt-commits: 957bc8923cd815c0519355595de3839762f5317a
wpt-pr: 47806
Automatic update from web-platform-tests
layout: Allocate inline box start space on segment
Instead of allocating the inline padding and border space on the line,
allocate it on the segment -- which where the inline box start goes.
Co-authored-by: Rakhi Sharma <[email protected]>
--
wpt-commits: 19cd59dfdce7392d6d6cffbfd84825207d648c39
wpt-pr: 46782
Automatic update from web-platform-tests
Element collapsing thru should collapse with its children
If the top and bottom margins of an element collapse through, then this
patch treats the bottom margin as collapsing with its children, even if
`height` doesn't compute to zero.
Co-authored-by: Martin Robinson <[email protected]>
--
wpt-commits: e2b6a0217ab27012c3f18477dda3f9f8ff000592
wpt-pr: 45671
Automatic update from web-platform-tests
Destroy leftover block-in-inline anonymous wrappers.
When a block-in-inline becomes floated or out-of-flow positioned, we
need to destroy the anonymous wrapper block around it (unless it has
siblings that still are in-flow blocks). Keeping such leftover wrappers
around would prevent content before and after it from being on the same
line.
It would also incorrectly prevent the block fragmentation code from
marking inline formatting context roots as non-contiguous.
Non-contiguous inline formatting context roots require some extra work
during pre-paint, to satisfy the invariant that the FragmentData and
PhysicalFragment count must match.
Bug: 329674902, 332396356
Change-Id: Ifd67d5ba35ae5b4b56e004addc27436feeb307c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5412656
Commit-Queue: Morten Stenshorne <[email protected]>
Reviewed-by: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1281371}
--
wpt-commits: 283b5a22e65166a6e779d7c845d625f7214909aa
wpt-pr: 45468
Automatic update from web-platform-tests
Pick the first or last baseline as appropriate
The old logic was always picking the last baseline, but this should only
happen for inline-blocks.
Since replaced elements and flex containers aren't currently setting
their baselines, this is only an improvement for inline-tables.
--
wpt-commits: 02bff6f94586fcf762a9b3623a776fe724e6a42f
wpt-pr: 45287
Automatic update from web-platform-tests
Don't update row baseline if cell is empty
Gecko, Blink and WebKit agree that the if a row only has empty cells,
its baseline should be at the bottom, not at the top.
There isn't interoperability when the cells are just empty-ish, so this
patch takes the simplest approach, aligning with Blink: any out-of-flow
or in-flow content other than collapsed whitespace counts as not empty.
--
wpt-commits: 1e23d2d783a02ecd84498d83b6b6cb07fc624f0d
wpt-pr: 45281
Automatic update from web-platform-tests
layout: Take into account `text-indent` for justification
This change makes it so that when calculating the space added between
words for justification, text-indent is taken into account.
Fixes#31775.
--
wpt-commits: 96c57cf5d3731e8cd40562311c3d7a63cce2cfc9
wpt-pr: 45220
Automatic update from web-platform-tests
Allow finishing anonymous inline-table at the end of inline elements
This avoids inserting it outside of its parent.
--
wpt-commits: 19ffb2b65f273878e09b8956dc4472016b1466d0
wpt-pr: 45093
Automatic update from web-platform-tests
End ongoing IFC when inserting anonymous block-level table
So that the table appears after preceding inline-level contents.
Fixes#31603.
--
wpt-commits: 2d1637ca539586606850a4473de97ee6f19383ea
wpt-pr: 45090
Automatic update from web-platform-tests
Fix vertical alignment at the root of an IFC
At the root of an inline formatting context, we used its vertical-align
in order to compute the strut. That was wrong, since vertical-align
on a block container shouldn't affect the contents, it should only
affect the alignment of the block container (if it's inline-level)
within the parent IFC.
This was only working well if the block container was block-level, since
effective_vertical_align_for_inline_layout returned `baseline` for
block-level boxes.
Instead of the outer display type, this patch changes the logic to check
whether we are at the root of the IFC.
--
wpt-commits: 8771a8f4bdc91fe78ca440faa346249c2173c3a6
wpt-pr: 45074
Automatic update from web-platform-tests
Replace old CSS2 color parsing tests with JS
There are over a thousand near identical tests testing parsing of
<color> values across various properties; these cumulatively end up
taking several minutes to run which is almost certainly not worthwhile.
Instead, have a single testharness.js test that checks we get the
specified value we expect for all the various combinations of
property/value.
Note this does keep *-129.xht of each of these to maintain coverage that
we do, in fact, render the specified color for each property.
--
wpt-commits: 1e8deece435c7e98b72c948d8cc980f04c998e81
wpt-pr: 44732
Automatic update from web-platform-tests
CSS word-spacing property does not obey percentages
Export from https://bugs.webkit.org/show_bug.cgi?id=126674 / https://commits.webkit.org/144704@main
Reviewed by Simon Fraser.
One change between CSS2.1 and CSS3 is that the word-spacing CSS property can
take percentages (of the width of the space character) in CSS3.
* css2.1/20110323/c541-word-sp-001-expected.html:
* css2.1/20110323/c541-word-sp-001.htm: Updated to not disregard percentages
--
wpt-commits: 5d77beb8f936413bcc757fcadf59b195ec52e005
wpt-pr: 44747
Automatic update from web-platform-tests
Convert CSS2 visual tests into reftests where an existing ref matches
This is based on running the visual tests in Chrome/Firefox/Safari, and
comparing the screenshots to those of existing refs.
--
wpt-commits: ea47935039dd3e2ca2abfbadf8f87c33221077d3
wpt-pr: 44730
The implementation is straight-forward. We have to check
if `transition-behavior` is `allow-discrete` when trying to create a new
transition and when checking if we have to cancel a running transition.
Also, the test case is out-of-date, so I tweak it a little bit and add
more general test cases for transtiion-behavior. Besides, I enable the
preference in the WPT folders which use `transition-behavior` (but
those tests may be passed already or failed due to reasons other than
`transition-behavior`).
Differential Revision: https://phabricator.services.mozilla.com/D201864
Automatic update from web-platform-tests
[LineBreaker] Add a test for crbug.com/1520442
This patch adds a test, which was accidentally lost while
renaming in PS8 of crrev.com/c/5251158. The content is the
same as the one in PS7.
Bug: 1520442
Change-Id: Ie9b72f63a9560b803f7cd3120c45cc3071302405
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5261043
Reviewed-by: Morten Stenshorne <[email protected]>
Commit-Queue: Morten Stenshorne <[email protected]>
Auto-Submit: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1255506}
--
wpt-commits: 5a5bd1e6635142b99fe27a5ea731fba9385d2b90
wpt-pr: 44376
Automatic update from web-platform-tests
[LineBreaker] Remove parallel flow break tokens when rewinding floats
When crrev.com/c/5052124 started rewinding floats, its
associated parallel flow break tokens should also be reset,
but it didn't. This patch fixes it.
The 3 tests are for the same cause, but may produce different
crash points. The `1` and `2` variants are more minimized and
easier to understand, but they produce different symptoms than
the original case that they may not always spot this issue as
the code evolves.
Bug: 1520442
Change-Id: I3546dba37d0dd2324804ad6c6a408ed162934663
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5251158
Commit-Queue: Koji Ishii <[email protected]>
Auto-Submit: Koji Ishii <[email protected]>
Reviewed-by: Morten Stenshorne <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1255473}
--
wpt-commits: 6e5d9709e7fad47ff9078649e1317aec36d3f982
wpt-pr: 44316
Automatic update from web-platform-tests
[LineBreaker] Support rewinding floats in `nowrap`
This patch supports rewinding floats in `nowrap` or `pre`.
In Blink, when NG was first implemented, rewinding floats
was harder, as it had separated lists for floats. So rewinding
stopped at the last float. This wasn't really correct, but it
passed all existing tests.
This patch changes `Rewind()` to actually rewind positioned
floats when necessary.
The spec isn't very clear about this case. When Gecko fixed
their reported cases 5 years ago[1], they filed a spec
issue[2] and added several tests[3].
This patch changes the rendering of `float-nowrap-4.html`, one
of the tests by Mozilla, so this patch adds a new reference.
PS18 can fix this issue without changing the behavior for
`float-nowrap-4.html`, but logically speaking, this behavior
looks more correct.
The change is under a runtime flag `RewindFloats`, enabled by
default as a kill-switch in case this change turned out to be
not web-compatible.
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=488725#c38
[2] https://github.com/w3c/csswg-drafts/issues/3038
[3] https://wpt.fyi/results/css/CSS2/floats?label=master&label=experimental&aligned&q=float-nowrap-
Bug: 1499290
Change-Id: I9f07fb487eaecf322c43df17e240afc5bc085560
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5052124
Commit-Queue: Koji Ishii <[email protected]>
Reviewed-by: Ian Kilpatrick <[email protected]>
Auto-Submit: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1235470}
--
wpt-commits: bab94cec8a1fe684992ddb86f6b9fc0b5d3fa777
wpt-pr: 43302
Automatic update from web-platform-tests
Stop sending " " to linebreaker for replaced content
We previously sent a " " to the linebreaker in order to ensure that the
next text had a soft wrap opportunity at the start. Calling `next(" ")`
without waiting until the returned index was 1, violated some
invariants of linebreaker ultimately causing a panic.
Instead of using the linebreaker for this, simply keep a flag in the
IFC layout state, which avoids the problem entirely.
Fixes#30703.
--
wpt-commits: 1a220a92434b68e5545ba312d8337b583e44b3d9
wpt-pr: 43197
Automatic update from web-platform-tests
Stop sending " " to linebreaker for replaced content
We previously sent a " " to the linebreaker in order to ensure that the
next text had a soft wrap opportunity at the start. Calling `next(" ")`
without waiting until the returned index was 1, violated some
invariants of linebreaker ultimately causing a panic.
Instead of using the linebreaker for this, simply keep a flag in the
IFC layout state, which avoids the problem entirely.
Fixes#30703.
--
wpt-commits: 1a220a92434b68e5545ba312d8337b583e44b3d9
wpt-pr: 43197
Automatic update from web-platform-tests
Anonymous boxes that wrap inlines should not inherit overflow
In legacy layout, anonymous text wrappers were inheriting the `overflow`
and `text-overflow` properties. This results in the creation of extra
clipping for these anonymous wrappers which could clip away floats. We
will likely implement `text-overflow` differently in non-legacy layout.
This change marks all legacy layout pseudo elements as "legacy" and also
adds a new pseudo element for non-legacy layout that does not inherit
`overflow`.
Fixes#30562.
Co-authored-by: Oriol Brufau <[email protected]>
--
wpt-commits: 070bbdb666b78e99d41d4b986a2a44958b8bc324
wpt-pr: 42598
Automatic update from web-platform-tests
[layout] Fix/implement round-tripping of auto-margins in block layout
After crrev.com/c/4712468 we stopped correctly reporting auto margins
for new formatting contexts within block layout (instead returning
0px).
This patch implements round-tripping like servo (setting the value
will result in the layout not changing). This means that margin:auto
may have different values on the inline-start/inline-end sides.
Bug: 1486977
Change-Id: I7f767869a56ed7a7b8256b0990902474976cc93b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4930440
Commit-Queue: Ian Kilpatrick <[email protected]>
Reviewed-by: Morten Stenshorne <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1208883}
--
wpt-commits: 8e795451aed024f9f4cd639fb13ea48fa5bb4cc0
wpt-pr: 42498
Automatic update from web-platform-tests
Fix PlacementAmongFloats to avoid missing some bands
PlacementAmongFloats would stop iterating when current_bands would be
empty, even if next_band wasn't at infinity.
Then the BFC root or replaced block was placed after all the floats,
even if it could fit next to some of them.
This patch moves the next_band into current_bands so that the loop
keeps considering bands.
--
wpt-commits: e357f7f93f5728b630ab44991258b9b690f4f109
wpt-pr: 41765
Automatic update from web-platform-tests
Avoid crash in PlacementAmongFloats
PlacementAmongFloats was assuming that there would always be a FloatBand
at a position smaller than or equal to the given ceiling, but this was
not the case for negative ceilings.
The reason is that the FloatContext initialized the FloatBandTree with
a band at 0, and another at +∞.
This patch changes the initial bands to −∞ and +∞. This seems more
consistent and matches the expectation of PlacementAmongFloats.
--
wpt-commits: 2282bf0b4da0f4596641d9fc15793d1d861ab56d
wpt-pr: 41667
Automatic update from web-platform-tests
Never resolve margin-left:auto to a negative amount
With direction:ltr (and we don't support direction:rtl yet), the rules
from https://drafts.csswg.org/css2/#blockwidth imply that margin-left
shouldn't resolve auto to a negative amount.
This aligns Servo with Gecko and Blink. WebKit may resolve to a negative
amount in some cases.
--
wpt-commits: ad817de630b4c6a27f3895c6eabefaab408887df
wpt-pr: 41302
Automatic update from web-platform-tests
Stop re-absolutization of out of flow insets for getComputedStyle()
When we `getComputedStyle()` of an inset property of an out-of-flow
element, if the value is 'auto', percent or calc, we currently redo
the absolutization from the ComputedStyle. This is error-prone, has
known failures in WPT, and makes it impossible to work with anchor
positioning (and especially position fallback).
As we have already absolutized these values during layout, this patch
simply caches them on LayoutResult to be passed to getComputedStyle().
To minimize memory overhead, this patch makes NGLayoutResult to
unconditionally store the resolved insets (+8 bytes per box), plus
creating RareData if the box's offset in container doesn't match the
resolved insets.
Fixed: 867616
Fixed: 1423493
Fixed: 1451020
Change-Id: Ib31f17304179d5e5b91c9d91c3e97386b904d0a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4583533
Reviewed-by: Ian Kilpatrick <[email protected]>
Commit-Queue: Xiaocheng Hu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1162636}
--
wpt-commits: 1f802e3c6e578f60e06dfd41cdcce51c915b4bc9
wpt-pr: 40370
Automatic update from web-platform-tests
Properly position absolutes with static insets that are children of floats
Previously, final float positions were calculated when their parents
were positioned. This prevented proper positioning of absolute children
of floats with static insets, because they accumulate offsets as they
are hoisted up the tree.
This change moves the final float positioning to
`PlacementState::place_fragment` for the float itself so that it happens
before any insets are updated for hoisted descendants. In addition to
simplifying the code, this makes it a bit more efficient. Finally,
floats are taken into account when updating static insets of hoisted
boxes.
Fixes#29826.
--
wpt-commits: 15c79860822aefec1618cdbd556109e909798deb
wpt-pr: 40665
Automatic update from web-platform-tests
Layout 2020: Properly handle negative block margins in floats
If a float has negative block margins, it should be pushed upward, but
shouldn't affect the positioning of any floats that came before it. It
should lower the ceiling though when it still has some non-negative
block contribution. In order to implement this behavior, we should only
place the float considering its non-negative block length contribution. If
the float is pushed up completely past it's "natural" position, it
should be placed like a float with zero block size.
--
wpt-commits: 67a14f64b7b481a3c6956f8bee2af331029bb1c7
wpt-pr: 40471
The spec asks to post a task, see html.spec.whatwg.org/#update-a-style-block
What we were doing is quite crazy. Unifying the scheduling between
<style> and <link rel=stylesheet> on the patch above causes failures on
some mochitests.
Some of them aren't really related to these and are a pre-existing bug,
see bug 1838346.
Differential Revision: https://phabricator.services.mozilla.com/D180895
These WPTs pass in Chrome and Safari because they implement the older
version of the spec where you needed:
div {
& span {
}
}
(or :is(span)) instead of:
div {
span {
}
}
Replace them by a nesting test for this case.
Differential Revision: https://phabricator.services.mozilla.com/D179686
Automatic update from web-platform-tests
[CompositeBackgroundAttachmentFixed] Don't use for fieldset and table parts
Fieldset and table parts paint backgrounds specially. For example, table
row paints background per cell, so the background clip method for
composited background-attachment:fixed doesn't work for it.
Bug: 1413872
Change-Id: I3c017955e34b3c574033075c31a5142a43069079
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4477773
Reviewed-by: Philip Rogers <[email protected]>
Commit-Queue: Xianzhu Wang <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1136730}
--
wpt-commits: 94984bd4f121b2766fe52b735c31970cf2ca5478
wpt-pr: 39717
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
If `border-collapse` is set and `border` is set for `td` but there's an empty
`tr`, the collapsed border was pushed out wrongly by the empty `tr`.
Columns borders cannot collapse like row borders as you can't define an empty
column without defining a cell.
Differential Revision: https://phabricator.services.mozilla.com/D173031