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

Lint rule for using Ahem as a web font. #18877

Merged
merged 1 commit into from Sep 6, 2019

Conversation

LukeZielinski
Copy link
Contributor

@LukeZielinski LukeZielinski commented Sep 5, 2019

Add a lint rule to check for tests that use the Ahem font but do not
include the /fonts/ahem.css stylesheet (which loads this font as a web
font). This prevents tests from assuming that Ahem is installed as a
system font. Also includes some unit tests.

There are a few tests that are incorrectly flagged as violating this
rule, these were added to lint.whitelist.

A bunch of other tests were fixed to load Ahem as a web font.

@wpt-pr-bot wpt-pr-bot requested review from silviapfeiffer, svgeesus, svillar, tabatkins, zcorpan and jgraham and removed request for r12a September 5, 2019 19:40
@foolip
Copy link
Member

foolip commented Sep 5, 2019

Unfortunately this is going to be a bit more complicated as https://github.com/web-platform-tests/wpt/blob/master/css/vendor-imports/mozilla/mozilla-central-reftests/README says "THIS DIRECTORY IS NOT THE MASTER COPY! DO NOT EDIT TESTS HERE!"

@dbaron @Ms2ger how should we go about making the Ahem changes to those tests?

Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

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

LGTM % imported tests we can't touch. Can you back out those changes and a lint exception for them while you figure out how to get them into Gecko and back here?

lint.whitelist Outdated

# Tests that are false positives for using Ahem as a system font
AHEM SYSTEM FONT: acid/acid3/test.html
AHEM SYSTEM FONT: preload/single-download-preload.html
Copy link
Member

Choose a reason for hiding this comment

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

This test doesn't even use Ahem, perhaps s/ahem/Foo/ or something to avoid the lint exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, done.

@Ms2ger
Copy link
Contributor

Ms2ger commented Sep 6, 2019

Unfortunately this is going to be a bit more complicated as https://github.com/web-platform-tests/wpt/blob/master/css/vendor-imports/mozilla/mozilla-central-reftests/README says "THIS DIRECTORY IS NOT THE MASTER COPY! DO NOT EDIT TESTS HERE!"

how should we go about making the Ahem changes to those tests?

Update them in mozilla-central, and @dbaron will manually push the changes upstream at some point.

include the /fonts/ahem.css stylesheet (which loads this font as a web
font). This prevents tests from assuming that Ahem is installed as a
system font. Also includes some unit tests.

There are a few tests that are incorrectly flagged as violating this
rule, these were added to lint.whitelist.

A bunch of other tests were fixed to load Ahem as a web font.
Copy link
Contributor Author

@LukeZielinski LukeZielinski left a comment

Choose a reason for hiding this comment

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

Unfortunately this is going to be a bit more complicated as https://github.com/web-platform-tests/wpt/blob/master/css/vendor-imports/mozilla/mozilla-central-reftests/README says "THIS DIRECTORY IS NOT THE MASTER COPY! DO NOT EDIT TESTS HERE!"
how should we go about making the Ahem changes to those tests?

Update them in mozilla-central, and @dbaron will manually push the changes upstream at some point.

Thanks, I reverted these. All of these tests did already load Ahem as a web font, just from their own local copies. I think they're fine just being left as is - they do the right thing, and I don't actually see /fonts/ in mozilla-central, so not sure updating them would work.

lint.whitelist Outdated

# Tests that are false positives for using Ahem as a system font
AHEM SYSTEM FONT: acid/acid3/test.html
AHEM SYSTEM FONT: preload/single-download-preload.html
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, done.

@LukeZielinski
Copy link
Contributor Author

LukeZielinski commented Sep 6, 2019

Oh, also, I'm keeping track of the failures introduced by this PR here: crbug.com/1001210
These failures aren't trivially fixed so they will be investigated later.

Looks like the failures from the checks here are all tracked. @foolip could you please force-merge this if you get a chance?

Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

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

Suggest simplification to lint.whitelist, but I'll check the CI checks here and if they're good I'll admin merge and do that change as a follow up.

# The following are imported from mozilla-central and can't be modified in WPT.
# They do load Ahem as a web font, but they use their own copy which trips the
# lint rule. Basically false positives.
AHEM SYSTEM FONT: css/vendor-imports/mozilla/mozilla-central-reftests/text3/segment-break-transformation-rules-003.html
Copy link
Member

Choose a reason for hiding this comment

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

Since we don't control these tests and the lint isn't run where they are maintained, listing individual tests isn't too useful, and will probably just mean that this list has to be updated on each sync, without driving down the number of exceptions. I recommend a blanket css/vendor-imports/mozilla/mozilla-central-reftests/* here instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

I disagree with this. We should lint those tests like normal since they should be moved out of that directory and we don't want to pile up problems that have to be addressed during that move.

Copy link
Member

Choose a reason for hiding this comment

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

That's fine with me, it's Mozilla that maintains this. I assumed the wpt lint wouldn't run when modifying these at the upstream location so that it'd just be a burden on @dbaron when syncing, but if that's fine, I'll send a revert of my simplification.

Copy link
Member

Choose a reason for hiding this comment

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

@foolip
Copy link
Member

foolip commented Sep 6, 2019

@LukeZielinski can you also file a Gecko bug for the regressions in https://wpt.fyi/results/?diff&filter=ADC&run_id=306760008&run_id=299020008?

I've logged https://bugzilla.mozilla.org/show_bug.cgi?id=1579498 for the changes we see in firefox.

@foolip foolip merged commit c66230e into web-platform-tests:master Sep 6, 2019
@foolip
Copy link
Member

foolip commented Sep 6, 2019

Sent #18901.

@LukeZielinski LukeZielinski deleted the ahem-lint-rule branch September 6, 2019 19:20
LukeZielinski added a commit to LukeZielinski/wpt that referenced this pull request Sep 6, 2019
This squashes all the previous commits and syncs to HEAD to include the
lint rule PR (web-platform-tests#18877)
@gsnedders
Copy link
Member

@LukeZielinski can you please update the docs as well? we should have the lint rule documented pending #17189 landing, and we shouldn't just say that you can rely on Ahem being installed in various places.

@LukeZielinski
Copy link
Contributor Author

@gsnedders Yes, the docs changes were in a pending PR, but I carved them off into #18972 to expedite.

LukeZielinski added a commit to LukeZielinski/wpt that referenced this pull request Sep 12, 2019
This squashes all the previous commits and syncs to HEAD to include the
lint rule PR (web-platform-tests#18877)
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

7 participants