Automatic update from web-platform-tests
Ensure removeProperty("all") completely removes the shorthand
This patch fixes a bug where removeProperty("all") failed to remove the
shorthand property itself from the style declaration.
Currently, Chromium only removes the longhand properties affected by
"all," but the "all" shorthand remains in the declaration. This causes
getPropertyValue("all") to incorrectly return a value instead of an
empty string after the removal. According to specification[1],
removeProperty() must remove the property entirely from the declaration
block.
This change ensures that "all" is properly deleted, bringing Chromium
into alignment with the spec and improving interoperability with other
browsers.
[1]: https://drafts.csswg.org/cssom-1/#dom-cssstyledeclaration-removeproperty
[2]: https://drafts.csswg.org/cssom-1/#dom-cssstyledeclaration-getpropertyvalue
Bug: 387030982
Change-Id: Ib980f54d7a251266f230bd1962076f6cf6a70f71
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7565506
Commit-Queue: Jinho Bang <zino@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Jinho Bang <zino@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1584541}
--
wpt-commits: 2698d8873f873ba7f441e6884a28fe9667b88b15
wpt-pr: 57774
25 lines
1.0 KiB
HTML
25 lines
1.0 KiB
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<title>CSSStyleDeclaration.removeProperty("all")</title>
|
|
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
|
|
<link rel="author" title="Mozilla" href="https://mozilla.org">
|
|
<link rel="help" href="https://drafts.csswg.org/cssom-1/#dom-cssstyledeclaration-removeproperty">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script>
|
|
test(function() {
|
|
let style = document.createElement("div").style;
|
|
style.width = "40px";
|
|
assert_equals(style.length, 1, "setter should work as expected");
|
|
style.removeProperty("all");
|
|
assert_equals(style.length, 0, "all is a shorthand of all properties, so should remove the property");
|
|
});
|
|
|
|
test(function() {
|
|
let style = document.createElement("div").style;
|
|
style.cssText = "width: 40px; all: revert";
|
|
style.removeProperty("all");
|
|
assert_equals(style.getPropertyValue("all"), "", "all is a shorthand of all properties, so should return empty string");
|
|
});
|
|
</script>
|