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

Declaration must be ignored if it includes CSS-wide keyword as part, but not whole, of it #15054

Closed
upsuper opened this issue Jan 17, 2017 · 2 comments

Comments

@upsuper
Copy link
Member

@upsuper upsuper commented Jan 17, 2017

For example the following code:

<!DOCTYPE html>
<p style="font-family: test, initial"></p>
<script>
alert(document.querySelector('p').style.fontFamily);
</script>

The declaration of font-family must be dropped because the CSS-wide keyword initial is not a valid <custom-ident>.

There are also examples that CSS-wide keywords is accepted as something other than <custom-ident>:

<!DOCTYPE html>
<p style="transform-origin: 11% 11% initial"></p>
<script>
alert(document.querySelector('p').style.transformOrigin);
</script>

In the example above, the initial value should not be accepted at all given the grammar.

@upsuper
Copy link
Member Author

@upsuper upsuper commented Jan 17, 2017

This seems to be a fundamental issue in CSS parser of Servo.

@SimonSapin could you have a look at this issue?

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Jan 26, 2017

#15183 fixes the font-family case. (Note though that the definition of font-family does not refer to <custom-ident>, it excludes some keywords explicitly.)

With a quick look at the parsing code for transform-origin I don’t understand how this can happen. I’ll look some more. But I don’t think this is "fundamental", for example style.marginTop is the empty string with margin-top: 4px inital.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.