-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[Grid] Fix grid-container-ignores-first-letter-001 #47312
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
Merged
webkit-commit-queue
merged 1 commit into
WebKit:main
from
sammygill:eng/Grid-Fix-grid-container-ignores-first-letter-001
Jun 30, 2025
Merged
[Grid] Fix grid-container-ignores-first-letter-001 #47312
webkit-commit-queue
merged 1 commit into
WebKit:main
from
sammygill:eng/Grid-Fix-grid-container-ignores-first-letter-001
Jun 30, 2025
+154
−259
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
EWS run on previous version of this PR (hash 783c42a) |
783c42a
to
8d52c37
Compare
EWS run on current version of this PR (hash 8d52c37) |
alanbaradlay
approved these changes
Jun 30, 2025
https://bugs.webkit.org/show_bug.cgi?id=295114 rdar://154504582 Reviewed by Alan Baradlay. The first-letter text comes from the "first formatted line of its originating element." Finding the first formatted line of a block container: - Comes from the inline level content of the first line box if the block container establishes an inline formatting context. - If it contains block-level content, then it comes from the first formatted line of the first in-flow block-level child. If no such line exists, then there is no formatted line. The flexbox and grid specs state that they do not contribute a first formatted line or letter. In theory, finding the first formatted line requires performing layout, but we construct first letter renderers and associated structures during render tree building/updating, which occurs before. RenderBlock::firstLetterAndContainer attempts to implement a heuristic in which it finds the block container that has the first letter style and then digs into its content to find the renderer that would be associated with that style. During this process, if we hit a flexbox or a grid, we seem to just assign firstLetter to the next sibling and continue the heuristic. Instead, we should *not* return a first letter container and renderer since there should be no first formatted line and, as a result, no first letter. * LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt: * LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter.html: * LayoutTests/fast/css-grid-layout/grid-container-ignore-first-letter.html: Removed. This test seems to be a duplicate of the one contained in the grid WPT directory (grid-container-ignores-first-letter-001). * LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flexbox-ignores-first-letter.html This is the same as the grid test but for flexbox. * LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flexbox-ignores-first-letter-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flexbox-ignores-first-letter.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-ignores-first-letter-001-expected.txt: * Source/WebCore/rendering/RenderBlock.cpp: * LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt * LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter.html Flexboxes to not generate a first formatted line or a first letter for their ancestors. As a result, the container does not have a first formatted line/letter since the first in flow child does not. Canonical link: https://commits.webkit.org/296797@main
8d52c37
to
47b3695
Compare
Committed 296797@main (47b3695): https://commits.webkit.org/296797@main Reviewed commits have been landed. Closing PR #47312 and removing active labels. |
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.
47b3695
8d52c37