layout: Use a total order comparator when distributing extra space to rowspans - #46841
Merged
Merged
Conversation
… rowspans Extra space is distributed to rowspans in an order determined by the specification. The sorting that was used to determine this order wasn't total which meant that you could have a situation where: - rowspan_a == rowspan_b - rowspan_a > rowspan_c - rowspan_c > rowspan_b This change makes the sorting total by properly ordering ranges even when one side of their ranges overlap. The test included here unfortunately has to be a bit noisy because the standard library only detects a non-total ordering under a specific set and distribution of elements. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
jdm
approved these changes
Jul 28, 2026
Collaborator
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#61579) with upstreamable changes. |
|
🔨 Triggering try run (#30384655974) for Linux (WPT) |
|
Test results for linux-wpt from try job (#30384655974): Flaky unexpected result (32)
Stable unexpected results that are known to be intermittent (16)
|
|
|
Loirooriol
reviewed
Jul 29, 2026
| /// Returns true if other is a proper subset of [`self`]. | ||
| fn fully_encloses(&self, other: &RowspanToDistribute) -> bool { | ||
| other.coordinates.y > self.coordinates.y && other.range().end < self.range().end | ||
| self.range() != other.range() && |
Contributor
There was a problem hiding this comment.
self.range() != other.range() is already ensured by the caller.
Seems a bit weird to use non-strict inequalities, but then require the ranges to be different.
Member
Author
There was a problem hiding this comment.
The main goal here is to handle the case where only end of the range overlaps (e.g. [0..3] and [0..5]). Maybe this should be renamed to is_proper_subset and the caller's code reordered?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extra space is distributed to rowspans in an order determined by the
specification. The sorting that was used to determine this order wasn't
total which meant that you could have a situation where:
This change makes the sorting total by properly ordering ranges even
when one side of their ranges overlap. The test included here
unfortunately has to be a bit noisy because the standard library only
detects a non-total ordering under a specific set and distribution of
elements.
Testing: This change includes a WPT crashtest.
Fixes: #46806.