cssstyledeclaration-mutationrecord-002.html is not testing what it wants to test.

RESOLVED FIXED in Firefox 64

Status

()

enhancement
RESOLVED FIXED
7 months ago
7 months ago

People

(Reporter: emilio, Assigned: emilio)

Tracking

(Blocks 1 bug)

unspecified
mozilla64
Points:
---

Firefox Tracking Flags

(firefox64 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 months ago
It's trying to test that setting an invalid CSS value for a property doesn't fire a mutation record. But the element doesn't have an existing style attribute, and as it turns out that given the following:

let div = document.createElement("div");
div.style.display = "bogus";

div.hasAttribute("style") will be true in Firefox, Blink and Webkit, but false in Edge.

So we do fire a mutation record, but due to the attribute creation, not the mutation.

I think only Edge matches the spec, and I want to update Firefox to do the same, and add another test to test what this wants to test.
(Assignee)

Updated

7 months ago
Flags: needinfo?(emilio)
(Assignee)

Updated

7 months ago
Flags: needinfo?(emilio)
(Assignee)

Comment 1

7 months ago
This matches Edge, and the spec.

Added an explicit test for this, and a test that tests what
cssstyledeclaration-mutationrecord-002.html wanted to test, which is that
changing an existing declaration doesn't generate a mutation record.
(Assignee)

Comment 2

7 months ago
Actually I was testing it wrong, and other browsers are correct here as well. I just happened to test with a page which had a style="" attribute in <body> instead.

So the good news is that this change is even less risky.

Comment 3

7 months ago
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/ccdfe4ca1f88
Stop creating a style attribute for invalid property values. r=smaug

Comment 4

7 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/ccdfe4ca1f88
Status: NEW → RESOLVED
Last Resolved: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/13494 for changes under testing/web-platform/tests
Can't merge web-platform-tests PR due to failing upstream checks:
Github PR https://github.com/web-platform-tests/wpt/pull/13494
* Taskcluster (pull_request) (https://tools.taskcluster.net/task-group-inspector/#/OiEFwATlQK6gWHjeKdwB-A)
Upstream PR merged
You need to log in before you can comment on or make changes to this bug.