New issue
Advanced search Search tips

Issue 894686 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 12
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

Style attribute is created when an invalid property value is set via CSSOM.

Project Member Reported by emilio@chromium.org, Oct 12

Issue description

Chrome Version       : trunk
Other browsers tested:
  Add OK or FAIL after other browsers where you have tested this issue:
     Safari: FAIL
    Firefox: FAIL (but I'm fixing in https://bugzilla.mozilla.org/show_bug.cgi?id=1498445)
    IE/Edge: PASS

What steps will reproduce the problem?

let element = document.createElement("div");
element.style.width = "somethingthatisclearlynotawidth";
console.log(element.hasAttribute("style"));

What is the expected result?
false is logged to the console.

What happens instead of that?
true is logged to the console.

Please provide any additional information below. Attach a screenshot if
possible.

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. 
 
Summary: Style attribute is created when an invalid property value is set via CSSOM. (was: Style attribute is created when an invalid property is set via CSSOM.)
Status: WontFix (was: Unconfirmed)
Ugh, terrible failure, I somehow tested with Chrome's newtab page and document.body, and the <body> in that page has a style attribute. Chrome is fine, this is just a Firefox bug. Sorry for the noise.

Sign in to add a comment