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] Update 'line-break' tests #14334

Merged
merged 1 commit into from
Dec 4, 2018

Conversation

MurakamiShinyu
Copy link
Contributor

Fix test file name numbering

The problem was that line-break-normal-* and line-break-strict-* had diffrent numbering for same ranges, e.g. line-break-normal-021 and line-break-strict-014 for same iteration marks. It was confusing, so I changed the numbering for 'normal' to be the same as for 'strict'.

  • line-break-normal-021 → line-break-normal-014
  • line-break-normal-022 → line-break-normal-015
  • line-break-normal-023a → line-break-normal-016a
  • line-break-normal-023b → line-break-normal-016b
  • line-break-normal-024a → line-break-normal-017a
  • line-break-normal-024b → line-break-normal-017b

Fix tests for Inseparatable characters

The tests for Inseparatable characters line-break-strict-015 and line-break-normal-015 (was line-break-normal-022) had wrong assertion "does not allow line breaking before inseparable characters". This should be "does not allow line breaking between inseparable characters".

I changed the tests to test line breaking between (not before) two inseparable characters.

Fix tests for Centered punctuation marks

The tests for Centered punctuation marks line-break-strict-016a and line-break-normal-016a (was line-break-normal-023a) contained tests for EAW=Narrow characters (U+003A, U+003B, U+0021, U+003F) that are excluded in the current 'line-break' spec.

Fix tests for Postfixes

The tests for Postfixes line-break-strict-017a and line-break-normal-017a (was line-break-normal-024a) contained tests for EAW=Narrow characters (U+0025 and U+00A2) that are excluded in the current 'line-break' spec.

Add tests for Prefixes

Added the tests for line breaking after Prefixes line-break-*-018.

Add 'loose' and 'normal' values tests that were missing

  • line-break-loose-011 .. line-break-loose-017b
  • line-break-normal-011 .. line-break-normal-013

Adjust width of the test block

I changed the width of the test block p.test, p.control {...} that was width: 10em to width: 10.2em. This extra (.2em) width is needed to prevent unexpected line breaking caused by some symbol characters wider than 1em.

I found this problem with line-break-loose-018. The width of U+2116 "№" is slightly wider than 1em and if the block width is 10em the line breaking occurs before that character, and the test always fails.

### Fix test file name numbering

The problem was that `line-break-normal-*` and `line-break-strict-*` had diffrent numbering for same ranges, e.g. `line-break-normal-021` and `line-break-strict-014` for same iteration marks. It was confusing, so I changed the numbering for 'normal' to be the same as for 'strict'.

- line-break-normal-021  → line-break-normal-014
- line-break-normal-022  → line-break-normal-015
- line-break-normal-023a → line-break-normal-016a
- line-break-normal-023b → line-break-normal-016b
- line-break-normal-024a → line-break-normal-017a
- line-break-normal-024b → line-break-normal-017b

### Fix tests for Inseparatable characters

The tests for Inseparatable characters `line-break-strict-015` and `line-break-normal-015` (was `line-break-normal-022`) had wrong assertion "does not allow line breaking **before** inseparable characters". This should be "does not allow line breaking **between** inseparable characters".

I changed the tests to test line breaking **between** (not **before**) two inseparable characters.

### Fix tests for Centered punctuation marks

The tests for Centered punctuation marks `line-break-strict-016a` and `line-break-normal-016a` (was `line-break-normal-023a`) contained tests for EAW=Narrow characters (U+003A, U+003B, U+0021, U+003F) that are excluded in the current 'line-break' spec.

### Fix tests for Postfixes

The tests for Postfixes `line-break-strict-017a` and `line-break-normal-017a` (was `line-break-normal-024a`) contained tests for EAW=Narrow characters (U+0025 and U+00A2) that are excluded in the current 'line-break' spec.

### Add tests for Prefixes

Added the tests for line breaking after Prefixes `line-break-*-018`.

### Add 'loose' and 'normal' values tests that were missing

- line-break-loose-011 .. line-break-loose-017b
- line-break-normal-011 .. line-break-normal-013

### Adjust width of the test block

I changed the width of the test block `p.test, p.control {...}` that was `width: 10em` to `width: 10.2em`. This extra (.2em) width is needed to prevent unexpected line breaking caused by some symbol characters wider than 1em.

I found this problem with `line-break-loose-018`. The width of U+2116 "№" is slightly wider than 1em and if the block width is 10em the line breaking occurs before that character�, and the test always fails.
Copy link
Contributor

@r12a r12a left a comment

Choose a reason for hiding this comment

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

I don't currently have time to review these tests properly, but i'll just note that i have similar-looking tests at https://w3c.github.io/i18n-tests/results/line-breaks-jazh (click on the link in the left column to run the tests). I note that because my tests produce js-based results - you may want to consider doing something similar, rather than making these manual tests (iiuc).

@MurakamiShinyu
Copy link
Contributor Author

This pull request is not for adding new tests, but for updating existing css/css-text/line-break/ tests that were made in early 2011. The css-text-3 'line-break' spec has been changed since then but these tests had not been updated. In this PR, I updated the outdated tests and also added some missing tests.

@r12a Yes, these tests are similar to your https://w3c.github.io/i18n-tests/results/line-breaks-jazh (thanks!), but non-JavaScript and can be used to test layout engines without JavaScript.

Copy link
Contributor

@fantasai fantasai left a comment

Choose a reason for hiding this comment

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

rs=fantasai

@fantasai fantasai merged commit 614fd87 into web-platform-tests:master Dec 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants