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

[css-text] Test text-align: match-parent on the root element #30175

Merged
merged 4 commits into from
Jan 4, 2023

Conversation

zcorpan
Copy link
Member

@zcorpan zcorpan commented Aug 25, 2021

If I understand correctly, a used value of 'direction: rtl' on the root element is propagated to the ICB per https://drafts.csswg.org/css-writing-modes-3/#icb

Then, https://drafts.csswg.org/css-text/#valdef-text-align-match-parent says

match-parent
This value behaves the same as inherit (computes to its parent’s computed value) except that an inherited value of start or end is interpreted against the parent’s (or the initial containing block’s, if there is no parent) direction value and results in a computed value of either left or right. When specified on the text-align shorthand, sets both text-align-all and text-align-last to match-parent.

The initial value of text-align is 'start', so I guess the inherited value for the root element has to be 'start'. Therefore, it looks at the 'direction' of the ICB, which is propagated from the root element, and is thus 'rtl'. Therefore text-align should compute to 'right'.

@nt1m
Copy link
Member

nt1m commented Jun 1, 2022

@zcorpan There's already a test for this: css/css-text/text-align/text-align-match-parent-root-rtl.html

It was in mozilla vendor-imports then was moved to the main test suite.

@nt1m nt1m closed this Jun 1, 2022
@nt1m
Copy link
Member

nt1m commented Jun 1, 2022

Wait, I guess not, this tests the computed style.

@nt1m nt1m reopened this Jun 1, 2022
Copy link
Member

@nt1m nt1m left a comment

Choose a reason for hiding this comment

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

The test name could clarify that it's about the computed value.

@zcorpan zcorpan force-pushed the bocoup/css-text-align-match-parent branch from 7694a91 to 94c54b0 Compare June 2, 2022 13:59
@zcorpan
Copy link
Member Author

zcorpan commented Jun 2, 2022

@nt1m thanks, fixed.

@nt1m
Copy link
Member

nt1m commented Jun 4, 2022

Maybe this could be named "text-align-match-parent-root-rtl-computed.html" to be consistent with the text-align-match-parent-root-rtl.html test.

Regarding the test that was renamed to "match-parent-001.html", can things be consistent with the rest of the match-parent tests: https://wpt.fyi/results/css/css-text/text-align?label=master&label=experimental&aligned&q=text-align-match-parent- ? The other tests could be renamed.

@zcorpan zcorpan merged commit 459f1c1 into master Jan 4, 2023
@zcorpan zcorpan deleted the bocoup/css-text-align-match-parent branch January 4, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants