-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix table column width distribution for colspan with mixed percent and auto columns #54582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Ahmad-S792
wants to merge
1
commit into
WebKit:main
Choose a base branch
from
Ahmad-S792:eng/Fix-table-column-width-distribution-for-colspan-with-mixed-percent-and-auto-columns
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Contributor
Collaborator
|
EWS run on previous version of this PR (hash 28475a9) Details |
Contributor
Author
28475a9 to
47217d7
Compare
Collaborator
|
EWS run on previous version of this PR (hash 47217d7) Details |
47217d7 to
36e210b
Compare
Collaborator
|
EWS run on previous version of this PR (hash 36e210b) Details |
36e210b to
aca72d5
Compare
Collaborator
|
EWS run on previous version of this PR (hash aca72d5) Details |
…d auto columns https://bugs.webkit.org/show_bug.cgi?id=303263 rdar://165561401 Reviewed by NOBODY (OOPS!). This patch aligns WebKit with Chromium / Blink and Gecko / Firefox. When a table has a row with mixed percentage and auto width columns, and another row with a colspan spanning those columns, the auto column's width was incorrectly negating the percentage constraint. This caused the width distribution to be based solely on content width rather than respecting the percentage values. The issue occurred in AutoTableLayout::calcEffectiveLogicalWidth() when distributing the colspan cell's min/max widths. The code had separate paths for all-fixed columns and all-percent columns, but no proper handling for mixed percent+auto columns. The fix adds a new branch that detects when we have mixed percentage and auto columns. By this point in the code, the earlier percentage distribution logic has already converted auto columns to effective percentage widths. The new code calculates the total effective percentage and distributes the colspan's min/max widths proportionally based on these percentages, similar to the existing all-percent case. This ensures that a 90% column and an auto column (converted to ~10%) receive width in a 90:10 ratio from the spanning cell, properly respecting the percentage constraint. Tests: imported/w3c/web-platform-tests/css/css-tables/table-colspan-percent-auto-ref.html imported/w3c/web-platform-tests/css/css-tables/table-colspan-percent-auto.html * LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-colspan-percent-auto-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-colspan-percent-auto-ref.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-colspan-percent-auto.html: Added. * Source/WebCore/rendering/AutoTableLayout.cpp: (WebCore::AutoTableLayout::calcEffectiveLogicalWidth): > Rebaselines: * LayoutTests/platform/gtk/fast/table/003-expected.txt: * LayoutTests/platform/mac-sequoia-wk1/fast/table/003-expected.txt: * LayoutTests/platform/mac-sequoia-wk2/fast/table/003-expected.txt: * LayoutTests/platform/mac-sonoma-wk1/fast/table/003-expected.txt: * LayoutTests/platform/mac-wk1/fast/table/003-expected.txt: * LayoutTests/platform/mac-wk2/fast/table/003-expected.txt: * LayoutTests/platform/mac/fast/table/003-expected.txt: * LayoutTests/platform/wpe/fast/table/003-expected.txt:
aca72d5 to
efd90e2
Compare
Collaborator
|
EWS run on current version of this PR (hash efd90e2) Details |
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.
efd90e2
efd90e2