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: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WORKSFORME    
Severity: Normal    
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Emilio Cobos Álvarez (:emilio)
Reported 2018-10-11 19:43:41 PDT
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
Emilio Cobos Álvarez (:emilio)
Comment 1 2018-10-11 19:44:59 PDT
Err, actually WebKit is right as well, so never mind me.
Note You need to log in before you can comment on or make changes to this bug.