Skip to content

Flip serialization of two font-variation-settings tests - #10535

Merged
emilio merged 2 commits into
web-platform-tests:masterfrom
csnardi:font-variation-settings-serialization
Apr 21, 2018
Merged

emilio merged 2 commits into
web-platform-tests:masterfrom
csnardi:font-variation-settings-serialization

Conversation

@csnardi

@csnardi csnardi commented Apr 19, 2018 •

Copy link
Copy Markdown
Member

The expected computed valid of two font variation settings tests was opposite to the specified order (and per https://drafts.csswg.org/css-fonts-4/#propdef-font-variation-settings, the computed value is "as specified"). Reverse the two axis in order to match the specified order.

@csnardi

csnardi commented Apr 19, 2018

Copy link
Copy Markdown
Member Author

@FremyCompany Can you review? Unless I'm missing something obvious, I can't see why the other serialization would be correct per the spec.

@drott drott left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

was opposite to the specified order.

Can you add a spec reference to the commit msg explaining the serialization order?

valueParserTests.forEach(function (testCase) {
test(() => {
var element = document.getElementById("value-parser-test");
element.style.fontVariationSettings = "";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The last two failures in https://crbug.com/809950 were not actual failures -- they failed because the last test failed (leading to no resetting of font-variation-settings). Since they were invalid parsing tests, they relied on font-variation-settings not being set prior to the test. While the first commit fixes the test for Chrome, this would fix it for other browsers which might run into the same problem where one test fails immediately before an invalid parsing test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the clarification and finding that out. Perhaps it's useful adding a comment here, like: "Reset to empty in order to allow testing to continue in case of parse errors occuring for the next test value."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good suggestion, I added that.

The expected computed valid of two font variation settings tests was opposite to the specified order (and per https://drafts.csswg.org/css-fonts-4/#propdef-font-variation-settings, the computed value is "as specified"). Reverse the two axis in order to match the specified order.
@csnardi
csnardi force-pushed the font-variation-settings-serialization branch from 464fd82 to 8df67e7 Compare April 20, 2018 13:59
This caused some tests to fail before the first commit simply due to font-variation-settings having already been set when the value shouldn't have been parsed.
@csnardi
csnardi force-pushed the font-variation-settings-serialization branch from 8df67e7 to 1aa52b3 Compare April 20, 2018 14:07

@drott drott left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the quick changes, LGTM.

@csnardi

csnardi commented Apr 20, 2018

Copy link
Copy Markdown
Member Author

@drott Could you also merge this? I unfortunately do not have write access to the repo.

@emilio
emilio merged commit f6d0423 into web-platform-tests:master Apr 21, 2018
@emilio

emilio commented Apr 21, 2018

Copy link
Copy Markdown
Contributor

@csnardi feel free to reach to me if you need to get something merged. I cannot grant you access, but I sure can merge your patches.

Thanks for all the work you do!

@csnardi
csnardi deleted the font-variation-settings-serialization branch April 21, 2018 19:47
@csnardi

csnardi commented Apr 21, 2018

Copy link
Copy Markdown
Member Author

@emilio Thank you, will do! :)

@FremyCompany

Copy link
Copy Markdown
Contributor

I think the spec should be updated, because the serialization of the property is not "as specified". I just took a look at the exact text we introduced:

If the same axis name appears more than once, the value associated with the last appearance supersedes any previous value for that axis. This deduplication is observable by accessing the computed value of this property.

and I agree it doesn't say you should reorder the axis names, so I'm fine with the change.

@FremyCompany
FremyCompany self-requested a review April 23, 2018 20:53

@FremyCompany FremyCompany left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@csnardi

csnardi commented Apr 23, 2018

Copy link
Copy Markdown
Member Author

@FremyCompany In the property definition box, it does say "Computed value: as specified", so I believe that would apply?

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.

5 participants