-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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-ui] Test serialization: -webkit-appearance
#17221
[css-ui] Test serialization: -webkit-appearance
#17221
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also test the same things but for the unprefixed 'appearance' property?
<script> | ||
test(function() { | ||
var input = document.createElement('input'); | ||
input.style = '-webkit-appearance: none;'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to use setAttribute()
instead. The setter here is forwarded to the cssText
setter.
I believe so, but I don't really know how these things are implemented to say for sure. :-) |
The path I'm trying to test is the attribute change steps for the owner node: https://drafts.csswg.org/cssom/#ref-for-parse-a-css-declaration-block By my reading, the relationship is the other way around--
That's why using
As I understand it, such tests would verify that |
The attribute change steps are run as a result of https://dom.spec.whatwg.org/#dom-element-setattribute Setting https://drafts.csswg.org/cssom/#elementcssinlinestyle As for |
Change API used to set style in order to actually test the internals referenced by the test title.
Introduce tests for property reference
Remove duplicate assertion
Comprehensive tests for property references have been added since these tests were written. Remove the excess assertions in order to improve the focus of these tests.
Add equivalent tests for unprefixed `appearance` property
Thanks for the clarification, Simon! I've improved the tests using a few commits and added an explanation to the body of each commit message. This introduces new tests for direct property reference. I've added these in a new file because according to legacy name alias, they are neither parsing nor serialization. This motivated a lot of tests (just learned that "webkit-case" is a concept in CSSOM), and a dedicated file helps make the enumeration of all combinations (including how the methods should not recognize the camel-case/webkit-case versions) a little easier to see. Since the serialization and parsing tests already use these API's, I didn't rely on serialization or parsing here. That lead to some overlap (i.e. multiple sub-tests rely on These new tests also made some of the assertions in the "parsing" tests redundant. I've removed those extra assertions to keep things organized. What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will cherish this all the days of my life |
I think we can merge this. |
* [css-ui] Test serialization: `-webkit-appearance` * fixup! [css-ui] Test serialization: `-webkit-appearance` Change API used to set style in order to actually test the internals referenced by the test title. * fixup! [css-ui] Test serialization: `-webkit-appearance` Introduce tests for property reference * fixup! [css-ui] Test serialization: `-webkit-appearance` Remove duplicate assertion * fixup! [css-ui] Test serialization: `-webkit-appearance` Comprehensive tests for property references have been added since these tests were written. Remove the excess assertions in order to improve the focus of these tests. * fixup! [css-ui] Test serialization: `-webkit-appearance` Add equivalent tests for unprefixed `appearance` property * fixup! [css-ui] Test serialization: `-webkit-appearance`
This is in service of csswg-drafts #3024 - Unprefix 'appearance' and/or make the spec web-compatible
I've tried to avoid the parsing code paths from the serialization tests and vice versa. Was I successful?