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

Properly implement text-align-last in legacy layout engine and IFC #1169

Conversation

tuankiet65
Copy link
Contributor

@tuankiet65 tuankiet65 commented May 31, 2022

5c455ef

Properly implement text-align-last in legacy layout engine and IFC
https://bugs.webkit.org/show_bug.cgi?id=241050

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

The alignment of the last line in a block always follows the alignment specified
by text-align-last. However, the legacy layout engine currently follows the old
spec, where text-align-last only takes effect when text-align was 'justify' (see [1]
where this was changed), and IFC does not honor text-align-last at all. Fix both the
legacy layout engine and IFC to align the last line according to text-align-last.

Manually tested by running run-webkit-tests with IFC enabled and disabled.

[1]: w3c/csswg-drafts@c1f7023

* LayoutTests/TestExpectations:
* LayoutTests/fast/css3-text/css3-text-align-last/text-align-last-with-text-align-non-justify-expected.html: Removed.
* LayoutTests/fast/css3-text/css3-text-align-last/text-align-last-with-text-align-non-justify.html:
Remove obsolete test that tests the old behavior of text-align-line.
* Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::horizontalAlignmentOffset):
(WebCore::Layout::LineBoxBuilder::build):
* Source/WebCore/rendering/LegacyLineLayout.cpp:
(WebCore::LegacyLineLayout::textAlignmentForLine const):

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

@tuankiet65 tuankiet65 added CSS Cascading Style Sheets implementation Safari Technology Preview labels May 31, 2022
@webkit-early-warning-system webkit-early-warning-system added the merging-blocked Applied to prevent a change from being merged label May 31, 2022
@tuankiet65 tuankiet65 self-assigned this May 31, 2022
@tuankiet65 tuankiet65 removed merging-blocked Applied to prevent a change from being merged CSS Cascading Style Sheets implementation Safari Technology Preview labels May 31, 2022
@tuankiet65 tuankiet65 force-pushed the eng/Properly-implement-text-align-last-in-legacy-layout-engine-and-IFC branch from ba54f98 to 80b79f6 Compare May 31, 2022 03:32
@tuankiet65 tuankiet65 added CSS Cascading Style Sheets implementation Safari Technology Preview labels May 31, 2022
@webkit-early-warning-system webkit-early-warning-system added the merging-blocked Applied to prevent a change from being merged label May 31, 2022
@nt1m nt1m requested review from anttijk and alanbaradlay May 31, 2022 06:10
@nt1m
Copy link
Member

nt1m commented Jun 1, 2022

@tuankiet65 This needs rebasing (should be straightforward). More importantly some tests are failing. fast/css3-text/css3-text-justify/text-justify-last-line-simple-line-layout.html suggests that the result is inconsistent with/without IFC enabled. Not sure about the repaint ones.

@tuankiet65 tuankiet65 removed merging-blocked Applied to prevent a change from being merged CSS Cascading Style Sheets implementation Safari Technology Preview labels Jun 2, 2022
@tuankiet65 tuankiet65 force-pushed the eng/Properly-implement-text-align-last-in-legacy-layout-engine-and-IFC branch from 80b79f6 to 6e2a6e0 Compare June 2, 2022 02:25
@tuankiet65 tuankiet65 added CSS Cascading Style Sheets implementation Safari Technology Preview labels Jun 2, 2022
@tuankiet65 tuankiet65 force-pushed the eng/Properly-implement-text-align-last-in-legacy-layout-engine-and-IFC branch from 6e2a6e0 to 65f0445 Compare June 3, 2022 22:23
@nt1m nt1m added unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing labels Jun 3, 2022
@webkit-early-warning-system webkit-early-warning-system force-pushed the eng/Properly-implement-text-align-last-in-legacy-layout-engine-and-IFC branch from 65f0445 to 5c455ef Compare June 3, 2022 22:30
@webkit-early-warning-system webkit-early-warning-system merged commit 5c455ef into WebKit:main Jun 3, 2022
@webkit-early-warning-system
Copy link
Collaborator

Committed r295239 (251294@main): https://commits.webkit.org/251294@main

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

@webkit-early-warning-system webkit-early-warning-system removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Jun 3, 2022
@tuankiet65 tuankiet65 deleted the eng/Properly-implement-text-align-last-in-legacy-layout-engine-and-IFC branch June 4, 2022 09:45
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