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] Is the test CSS2/text/text-align-white-space-007.xht valid? #6344

Closed
jfkthame opened this issue Jun 3, 2021 · 2 comments
Closed
Labels
Closed Accepted by Editor Discretion Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. CSS2 css-text-3 Current Work Testing Unnecessary Memory aid - issue doesn't require tests

Comments

@jfkthame
Copy link
Contributor

jfkthame commented Jun 3, 2021

The test at CSS2/text/text-align-white-space-007.xht involves white-space: pre-wrap together with text-align: justify and direction: rtl.

According to wpt.fyi, it currently passes on Firefox but not on Safari, Edge or Chrome. However, I'm finding it difficult to understand why the expected behavior would be "correct", and a change I'd like to make in Gecko will cause it to start "failing" there as well (while fixing other testcases).

It looks to me like this testcase does not take account of the fact that the pre-wrap value allows line-end spaces to hang (as noted in the summary table of behaviors below the list of values). I guess it predates the introduction of the separate break-spaces value, which wraps similarly but preserves all spaces; for that value, the "expected" result would be correct, but for pre-wrap it seems wrong.

If my understanding is correct that this testcase is invalid (at least according to current specs; it may have been valid when written), I would suggest we simply delete it. There are newer tests of these properties under the /css/css-text/ directory.

@frivoal frivoal added css-text-3 Current Work CSS2 labels Jun 7, 2021
@frivoal
Copy link
Collaborator

frivoal commented Jun 7, 2021

I suspect the reason for this test is not just the end-of-line hanging, but mainly that the spec says:

If an element’s white space is not collapsible, then the UA is not required to adjust its text for the purpose of justification and may instead treat the text as having no justification opportunities.

The test does have the "may" piece of meta data, meaning that it's ok to fail, but given that this is merely an allowance for legacy behavior, rather than a requirement or event a suggestion, I agree just deleting the test is probably best.

From a spec point of view, this used to be a requirement in css2, which css-text-3 merely relaxed, but if Firefox aligns with others, then we'll have interoperability on the opposite behavior, so maybe we should spec that behavior, even if it's a breaking change with CSS2.

cc: @fantasai

@fantasai
Copy link
Collaborator

I think the reason the allowance was made to not justify pre-wrap text was because handling tabs seemed tricky while justifying text. I think the spec is fine, but removing the testcase so that we don't encourage implementations to pass it, sounds good to me.

frivoal added a commit to web-platform-tests/wpt that referenced this issue Apr 20, 2022
Having an automated test for this encourages implementations to align,
but the spec isn't calling for this behavior, merely allowing as a less
desirable but acceptable behavior. No need to draw attention to it.

w3c/csswg-drafts#6344
@frivoal frivoal closed this as completed Apr 20, 2022
@frivoal frivoal added Testing Unnecessary Memory aid - issue doesn't require tests Closed Accepted by Editor Discretion Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. labels Apr 20, 2022
DanielRyanSmith pushed a commit to DanielRyanSmith/wpt that referenced this issue Apr 27, 2022
Having an automated test for this encourages implementations to align,
but the spec isn't calling for this behavior, merely allowing as a less
desirable but acceptable behavior. No need to draw attention to it.

w3c/csswg-drafts#6344
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue May 16, 2022
… recommended, a=testonly

Automatic update from web-platform-tests
Remove test for behavior allowed but not recommended

Having an automated test for this encourages implementations to align,
but the spec isn't calling for this behavior, merely allowing as a less
desirable but acceptable behavior. No need to draw attention to it.

w3c/csswg-drafts#6344

--

wpt-commits: d433691eff237c238fe0ff32d150279acfbac1d7
wpt-pr: 33709
jamienicol pushed a commit to jamienicol/gecko that referenced this issue May 25, 2022
… recommended, a=testonly

Automatic update from web-platform-tests
Remove test for behavior allowed but not recommended

Having an automated test for this encourages implementations to align,
but the spec isn't calling for this behavior, merely allowing as a less
desirable but acceptable behavior. No need to draw attention to it.

w3c/csswg-drafts#6344

--

wpt-commits: d433691eff237c238fe0ff32d150279acfbac1d7
wpt-pr: 33709
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted by Editor Discretion Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. CSS2 css-text-3 Current Work Testing Unnecessary Memory aid - issue doesn't require tests
Projects
None yet
Development

No branches or pull requests

3 participants