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-values-4] Tests for cyclic dependency resolution for the lh/rlh units #8886

Merged
merged 3 commits into from Jan 12, 2018

Conversation

frivoal
Copy link
Contributor

@frivoal frivoal commented Jan 4, 2018

Goes along with the spec changes in w3c/csswg-drafts#2115

@w3c-bots
Copy link

w3c-bots commented Jan 4, 2018

Build PASSED

Started: 2018-01-04 03:09:13
Finished: 2018-01-04 03:18:47

View more information about this build on:

}
aside {
background: green;
font-size: 42px; /* number doesn't matter, as long as it's not 100 */
Copy link
Contributor

Choose a reason for hiding this comment

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

"not either 100 nor 50"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, and fixed.

assert_equals( f_s, initial_f_s, "the rlh unit on the root element's font-size property uses font metrics corresponding to the initial values of the font or line-height properties");

}, "rlh in font-size on root");
</script>
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't there be a test for what happens if you specify 2lh or 2rlh?

Copy link
Contributor Author

@frivoal frivoal Jan 11, 2018

Choose a reason for hiding this comment

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

No sure. In general, having a test checking that the unit can be use with numbers other than 1 sounds sane, but I am not sure it is needed as part of the unit cyclic dependency resolution problem, which is what I am testing here. On top of that, I am a little worried here that I'd easily run into rounding errors on this test if I started doing multiplications, especially given that on the root element, the units refer to the initial values of the properties, which depend on fonts and I have no way to force the initial value to be a round number.

As for testing that the unit in general works and makes sense with numbers other than one, I'm planning to write another series of tests about these units checking that they are sized correctly, now that we have resolved on w3c/csswg-drafts#1253. Would that be enough, or do you think there is a need for this within the cyclic dependency tests?

EDIT: fixed unclear phrasing and typo

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you might want a test that checks that, at least, specifying 2lh does something (as opposed to just being ignored by the browser instead of correctly cycle-resolved to 2x the default value). Checking that the height becomes taller than the initial one might be enough (or maybe larger than 1.75x more and smaller than 2.25x less?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, that was a good idea, sorry for pushing back initially. Also, while fixing that, I found other problems with the test, and fixed them as well. Can you have a look again?

aside {
background: green;
height: 1em;
line-height: 42px; /* number doesn't matter, as long as it's not 50 */
Copy link
Contributor

Choose a reason for hiding this comment

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

"not either 50 nor 100"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, and fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, and fixed.

@w3c-bots
Copy link

w3c-bots commented Jan 11, 2018

Build PASSED

Started: 2018-01-12 02:38:48
Finished: 2018-01-12 02:47:10

View more information about this build on:

@frivoal frivoal merged commit 73e7b61 into web-platform-tests:master Jan 12, 2018
@frivoal frivoal deleted the lh-rlh-cycles branch January 12, 2018 03:29
@frivoal
Copy link
Contributor Author

frivoal commented Jan 12, 2018

Thanks!

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