Skip to content

[cssom] Add a test for mutation records when CSSStyleDeclaration.setPropertyValue is invoked. - #10429

Merged
emilio merged 4 commits into
web-platform-tests:masterfrom
emilio:mutation-record
Apr 13, 2018
Merged

emilio merged 4 commits into
web-platform-tests:masterfrom
emilio:mutation-record

Conversation

@emilio

@emilio emilio commented Apr 11, 2018 •

Copy link
Copy Markdown
Contributor

@emilio
emilio requested a review from upsuper April 11, 2018 14:19
@emilio

emilio commented Apr 11, 2018

Copy link
Copy Markdown
Contributor Author

@upsuper upsuper left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add another test for removing non-existing property (ideally from a declaration with some declarations, because Gecko optimizes the case where the declaration doesn't exist at all).

});

m.observe(document.documentElement, { attributes: true });
document.documentElement.style.top = "0px";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm less sure about whether we should optimize this case, since it's not really changing the value. But detecting equivalence of value is probably not that trivial spec-wise... so given the spec currently, I guess this is fine.

@emilio

emilio commented Apr 11, 2018

Copy link
Copy Markdown
Contributor Author

It's fine to optimize that afaict. Removing a property goes through https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-removeproperty, which only calls "update the style attribute" if removed is true. This is consistent with what happens if the value is invalid. I'll add a test for that.

@emilio

emilio commented Apr 11, 2018

Copy link
Copy Markdown
Contributor Author

Ok, added tests for all those.

@upsuper upsuper left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the tests can really be done in a single file with multiple subtests... but it's not a big problem anyway.

@emilio

emilio commented Apr 13, 2018

Copy link
Copy Markdown
Contributor Author

Yeah, the issue is that it complicates the tests, and if one times out or something then the rest of the tests wouldn't run.

1 similar comment
@emilio

emilio commented Apr 13, 2018

Copy link
Copy Markdown
Contributor Author

Yeah, the issue is that it complicates the tests, and if one times out or something then the rest of the tests wouldn't run.

@emilio
emilio merged commit ab9fc1e into web-platform-tests:master Apr 13, 2018
@emilio
emilio deleted the mutation-record branch April 13, 2018 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants