Repository navigation
feat: support string styles through cssText and the style attribute #110
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,6 +112,23 @@ const config: WPTConfig = { | |
| ], | ||
| 'css/css-flexbox/parsing/flex-direction-invalid.html': true, | ||
| 'css/cssom/cssstyledeclaration-properties.html': true, | ||
| 'css/cssom/cssstyledeclaration-csstext.html': [ | ||
| 'uppercase property', | ||
| 'uppercase value', | ||
| 'overwriting with invalid value', | ||
| 'use rgb', | ||
| // Other cases use unsupported properties, shorthands, or computed styles. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would it take to unlock these other test cases such as shorthands? Would it help to use a more formal CSS parser?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like we'd need a proper inline style parser ;)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i don't think the parser is the blocker here, those cases skip because we don't support the properties yet (
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As long as you see the path forward, sounds good! |
||
| ], | ||
| 'css/cssom/cssstyledeclaration-csstext-final-delimiter.html': [ | ||
| 'inline style - text - delimiters - zero declarations', | ||
| // The other cases use the unsupported left and right properties. | ||
| ], | ||
| 'css/cssom/serialization-CSSDeclaration-with-important.html': [ | ||
| "Inline style declaration without whitespace between '!' and 'important'.", | ||
| "Style set dynamically via cssText without whitespace between '!' and 'important'.", | ||
| "Style set dynamically via cssText with whitespace between '!' and 'important'.", | ||
| // The remaining case unlocks once we support background-color. | ||
| ], | ||
| 'css/cssom/cssstyledeclaration-setter-attr.html': true, | ||
| 'dom/events/Event-constructors.any.js': true, | ||
| 'dom/events/EventTarget-addEventListener.any.js': true, | ||
|
|
||
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.
We don't have them yet, but would this be a good case to use
MutationObserverwhen we support them?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 don't think so,
MutationObserverdelivers records async, so right aftersetAttribute('style', ...)readingel.style.colorwould still give you the old value until the observer runs. the spec keeps them in sync inside the attribute change steps, and MO records get queued from that same algorithm. so once we add MO, this is where we'd queue the record, alongside the switch rather than replacing it