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

[Gecko Bug 1681691] Adjust font-family names used in WPT metrics-override tests to avoid spurious failures due to antialiasing in Gecko. #28171

Merged
merged 1 commit into from Mar 23, 2021

Conversation

moz-wptsync-bot
Copy link
Collaborator

Many WPT reftests compare Ahem glyphs (squares) with a reference that uses simple shapes
such as a

with a solid background that is expected to have the exact same size.

If antialiasing is applied to the Ahem font, such tests will often fail because of
faint antialiasing pixels at the edges of the square glyphs, even though the test is
"passing" in terms of what it actually aims to check.

Rather than annotate all such tests as "fuzzy", Gecko has an option to disable antialiasing
for the Ahem font, despite it being enabled for font rendering in general, and we use this
when running the WPT reftests. However, this depends on the font-family name being exactly
"Ahem".

Therefore, in the tests which load Ahem via @font-face and override some descriptors,
we still want to use "Ahem" as the resulting family name (shadowing the standard Ahem,
if it is locally installed) so that the non-antialiased rendering will be used.

(In the case of metrics-override-normal-keyword, there are multiple "custom" versions
of Ahem loaded by the testcase, so we instead take the approach of also loading it with
a modified family name in the reference; then both testcase and reference will get
the default antialiased font rendering rather than special "Ahem" treatment.)

Differential Revision: https://phabricator.services.mozilla.com/D109290

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1681691
gecko-commit: bb53155c3dd0c74d09390815d8813df46a11142a
gecko-reviewers: emilio

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Firefox project.

…spurious failures due to antialiasing in Gecko.

Many WPT reftests compare Ahem glyphs (squares) with a reference that uses simple shapes
such as a <div> with a solid background that is expected to have the exact same size.

If antialiasing is applied to the Ahem font, such tests will often fail because of
faint antialiasing pixels at the edges of the square glyphs, even though the test is
"passing" in terms of what it actually aims to check.

Rather than annotate all such tests as "fuzzy", Gecko has an option to disable antialiasing
for the Ahem font, despite it being enabled for font rendering in general, and we use this
when running the WPT reftests. However, this depends on the font-family name being exactly
"Ahem".

Therefore, in the tests which load Ahem via @font-face and override some descriptors,
we still want to use "Ahem" as the resulting family name (shadowing the standard Ahem,
if it is locally installed) so that the non-antialiased rendering will be used.

(In the case of metrics-override-normal-keyword, there are multiple "custom" versions
of Ahem loaded by the testcase, so we instead take the approach of also loading it with
a modified family name in the reference; then both testcase and reference will get
the default antialiased font rendering rather than special "Ahem" treatment.)

Differential Revision: https://phabricator.services.mozilla.com/D109290

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1681691
gecko-commit: cac338430f0d777b8fe6441e5b6b497819b215a8
gecko-reviewers: emilio
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.

None yet

3 participants