Bug 190506
Summary: | Style attribute is created when an invalid property value is set via CSSOM | ||
---|---|---|---|
Product: | WebKit | Reporter: | Emilio Cobos Álvarez (:emilio) <emilio> |
Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WORKSFORME | ||
Severity: | Normal | ||
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Emilio Cobos Álvarez (:emilio)
let element = document.createElement("div");
element.style.width = "somethingthatisclearlynotawidth";
console.log(element.hasAttribute("style")); // logs true, should log false.
From https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty:
> 5. Let component value list be the result of parsing value for property property.
> 6. If component value list is null, then return.
> [...]
> 10. If updated is true, update style attribute for the CSS declaration block.
Edge's behavior is correct, I'm changing Firefox in https://bugzilla.mozilla.org/show_bug.cgi?id=1498445, where I'm adding a few tests.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Emilio Cobos Álvarez (:emilio)
Err, actually WebKit is right as well, so never mind me.