Closed Bug 1729450 Opened 3 years ago Closed 3 years ago

Fix up failing WPT text-emphasis-* testcases that have errors and/or overly fragile reference renderings

Categories

(Core :: Layout: Text and Fonts, defect)

defect

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

Details

Attachments

(4 files)

I've noticed that a bunch of the text-emphasis-* testcases in the css/css-text-decor/ directory are failing not because we don't support the properties, but because the testcases are either broken (e.g. with typos or using incorrect values -- probably based on preliminary versions of the spec, and then never updated), or are using a bogus comparison against a reference rendering constructed with abspos and font-size. This is (a) dependent on a particular, non-standard font, and (b) even with the expected font, is not reliable because the exact positioning of emphasis marks may not match the abspos-simulated structure; it is defined by the spec by comparison with ruby:

Emphasis marks are drawn exactly as if each character was assigned the mark as its ruby annotation text with the ruby position given by text-emphasis-position and the ruby alignment as centered.

As such, the most reliable way to create a reference rendering is with ruby annotations.

Fixing up these tests shows that a bunch of them do in fact pass in Firefox (and will improve the chances for other browsers as well, although these properties are not universally implemented yet).

The screenshots of this testcase show that even though the text-emphasis-color property is working
as expected, the reftest nevertheless fails because the exact position of the emphasis marks
does not match between test and reference.

Applying the suggested IPAMincho font, which has fixed-width Latin characters, in place of the
default (proportional) font makes it come closer to matching, but still not quite.

The root of the problem is that it tries to compare the rendering of emphasis marks with a
"simulated" emphasis mark created by reducing the font size and using absolute positioning to
try and put the mark in a suitable position. However, the actual rendering of the emphasis mark
is not defined in such terms, and matching it will be difficult and fragile.

The spec actually defines the rendering of emphasis marks to be equivalent to ruby text, so a
more reliably correct reference rendering can be created using ruby elements with the expected
emphasis-mark characters. (I note that there are already some emphasis testcases that use this
approach.)

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED

The text-emphasis-position testcases do not match the current spec, as they use the keywords 'above'
and 'below', whereas CSS Text Decorations actually specifies 'over' and 'under'. (I guess they were
created before the values were finalized.)

We also need to convert the reference lines from using abs-pos to try and simulate emphasis mark rendering
to a ruby-based version, as this is how the spec defines the rendering of the marks. The abs-pos approach
is at best an approximation, and will result in spurious reftest failures even when the emphasis properties
are working as intended.

Depends on D124793

More emphasis testcases that fail because of reference renderings that don't quite match, in addition to
some simple typos ("sample" vs "Simple").

There's some redundancy here between the testcases coming from different authors, but for now I haven't
tried to rationalize that aside from dropping a duplicate individual test for 'filled dot'.

Depends on D124794

Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e3ee29b05f7b
Fix reference elements for text-emphasis-color.html to reliably match the expected rendering. r=emilio
https://hg.mozilla.org/integration/autoland/rev/ed14cda4f033
Fix the text-emphasis-position-* testcases/references to render consistently. r=emilio
https://hg.mozilla.org/integration/autoland/rev/29f3f16dcd31
Fix up WPT reftests for text-decoration-emphasis-style-* to use more reliable ruby-based references. r=emilio
https://hg.mozilla.org/integration/autoland/rev/798e26d71dfc
Remove obsolete pref settings from WPT css-text-decor metadata, as we ship these features by default. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/30380 for changes under testing/web-platform/tests
Upstream PR was closed without merging
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dd7e2cd76e15
Fix reference elements for text-emphasis-color.html to reliably match the expected rendering. r=emilio
https://hg.mozilla.org/integration/autoland/rev/a10eea89f52d
Fix the text-emphasis-position-* testcases/references to render consistently. r=emilio
https://hg.mozilla.org/integration/autoland/rev/d567318a1b8f
Fix up WPT reftests for text-decoration-emphasis-style-* to use more reliable ruby-based references. r=emilio
https://hg.mozilla.org/integration/autoland/rev/f782f2eac991
Remove obsolete pref settings from WPT css-text-decor metadata, as we ship these features by default. r=emilio
Upstream PR merged by moz-wptsync-bot
Flags: needinfo?(jfkthame)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: