Skip to content

inline-style-allowed-while-cloning-objects.sub.html doesn't seem to match the spec #5614

@bzbarsky

Description

@bzbarsky

This test claims that if you set up a node with an inline style by manipulating .style and then clone the node then the clone should have the same .style and the same computed style.

But cloning as defined at https://dom.spec.whatwg.org/#concept-node-clone does not special-case style attributes in any way. And https://html.spec.whatwg.org/multipage/dom.html#the-style-attribute does say that the value should be parsed no matter what (pretty sure this is not what implementations do, by the way), but that the CSP check should also be done and if it fails the "style rules" (there aren't any in this case; just declarations) should not be applied. There are also no cloning steps defined in HTML that special-case the style attribute in any way.

So as far as I can tell, per spec the computed style should NOT be the same for the original element and the clone.

At the moment Firefox passes this test because it actually has special-casing for cloning of style attributes that just copies the parsed representation instead of copying the string as per spec, but I was removing that (because it's buggy in other unrelated ways) and ran into this test failure. As far as I can tell, the test is wrong. If the intent is that this test is right, then the specs need changes somewhere in here.

@mikewest am I missing something here? This looks like a Blink-contributed test, so presumably your implementation matches the test and not the spec...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions