Skip to content
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

[LFC][IFC] Support each-line keyword in text-indent #852

Conversation

tuankiet65
Copy link
Contributor

@tuankiet65 tuankiet65 commented May 20, 2022

8ac6fb0

[LFC][IFC] Support each-line keyword in text-indent
https://bugs.webkit.org/show_bug.cgi?id=240731

Patch by Kiet Ho <tho22@apple.com > on 2022-05-25
Reviewed by Alan Bujtas.

Normally, text-indent only affects the first line. When 'each-line' is specified,
subsequent lines where the previous line ends with a hard break are also indented.
This is supported in the legacy layout engine but not in LFC. Adds support for
'each-line' to bring LFC to parity with the legacy engine.

Test: imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-each-line-hanging.html

* LayoutTests/TestExpectations: Remove ImageOnlyFailure expectation.
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::layoutInlineContent):
(WebCore::Layout::LineBuilder::computedIntrinsicWidth):
(WebCore::Layout::LineBuilder::initialConstraintsForLine const): Add logic to
indent line when 'each-line' is specified, and the previous line ends with a
hard break.
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h: Modify
initialConstraintsForLine to accept information about the previous line,
not just whether there's one or not.

Canonical link: https://commits.webkit.org/250978@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294828 268f45cc-cd09-0410-ab3c-d52691b4dbfc

@tuankiet65 tuankiet65 added CSS Cascading Style Sheets implementation Safari Technology Preview labels May 20, 2022
@nt1m nt1m requested review from alanbaradlay and anttijk May 20, 2022 21:06
@tuankiet65 tuankiet65 self-assigned this May 20, 2022
@tuankiet65 tuankiet65 force-pushed the eng/LFCIFC-Support-each-line-keyword-in-text-indent branch from a1957c3 to b26e766 Compare May 20, 2022 21:23
@tuankiet65 tuankiet65 force-pushed the eng/LFCIFC-Support-each-line-keyword-in-text-indent branch from b26e766 to 518388d Compare May 21, 2022 01:23
Copy link
Contributor

@alanbaradlay alanbaradlay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

@tuankiet65 tuankiet65 force-pushed the eng/LFCIFC-Support-each-line-keyword-in-text-indent branch from 518388d to afd4ca4 Compare May 24, 2022 19:48
@tuankiet65
Copy link
Contributor Author

Difference before/after force push: account for the fact that the each-line and hanging test was migrated from WebKit repo to WPT.

@webkit-early-warning-system webkit-early-warning-system added the merging-blocked Applied to prevent a change from being merged label May 25, 2022
@nt1m nt1m removed the merging-blocked Applied to prevent a change from being merged label May 25, 2022
@alanbaradlay alanbaradlay added the merge-queue Applied to send a pull request to merge-queue label May 25, 2022
@webkit-early-warning-system webkit-early-warning-system force-pushed the eng/LFCIFC-Support-each-line-keyword-in-text-indent branch from afd4ca4 to 8ac6fb0 Compare May 25, 2022 22:30
@webkit-early-warning-system webkit-early-warning-system merged commit 8ac6fb0 into WebKit:main May 25, 2022
@webkit-early-warning-system
Copy link
Collaborator

Committed r294828 (250978@main): https://commits.webkit.org/250978@main

Reviewed commits have been landed. Closing PR #852 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system removed the merge-queue Applied to send a pull request to merge-queue label May 25, 2022
@tuankiet65 tuankiet65 deleted the eng/LFCIFC-Support-each-line-keyword-in-text-indent branch May 26, 2022 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Cascading Style Sheets implementation
Projects
None yet
4 participants