Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cssom] Serialize the 'all' shorthand in cssText
https://bugs.webkit.org/show_bug.cgi?id=190753 Reviewed by Darin Adler. Test: imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-all-shorthand.html * LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-all-shorthand-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-all-shorthand.html: Added. * Source/WebCore/css/StyleProperties.cpp: (WebCore::StyleProperties::asTextInternal const): Canonical link: https://commits.webkit.org/255329@main
- Loading branch information
1 parent
a689335
commit 4481e38
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
...d/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-all-shorthand-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
PASS 'all' shorthand alone | ||
PASS 'all' shorthand with 'width' and 'height' | ||
PASS 'all' shorthand with 'direction' and 'unicode-bidi' | ||
PASS 'all' shorthand with 'width', 'height' and custom properties | ||
PASS 'all' shorthand with all longhands | ||
|
38 changes: 38 additions & 0 deletions
38
.../imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-all-shorthand.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<title>CSSOM test: serialization of the 'all' shorthand in cssText</title> | ||
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com"> | ||
<link rel="help" href="https://drafts.csswg.org/cssom-1/#dom-cssstyledeclaration-csstext"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
const style = document.createElement("div").style; | ||
|
||
test(function() { | ||
style.cssText = "all: inherit"; | ||
assert_equals(style.cssText, "all: inherit;"); | ||
}, "'all' shorthand alone"); | ||
|
||
test(function() { | ||
style.cssText = "width: 100px; all: inherit; height: inherit"; | ||
assert_equals(style.cssText, "all: inherit;"); | ||
}, "'all' shorthand with 'width' and 'height'"); | ||
|
||
test(function() { | ||
style.cssText = "direction: ltr; all: inherit; unicode-bidi: plaintext"; | ||
assert_equals(style.cssText, "direction: ltr; all: inherit; unicode-bidi: plaintext;"); | ||
}, "'all' shorthand with 'direction' and 'unicode-bidi'"); | ||
|
||
test(function() { | ||
style.cssText = "width: 100px; --a: a; all: inherit; --b: b; height: inherit"; | ||
assert_equals(style.cssText, "--a: a; all: inherit; --b: b;"); | ||
}, "'all' shorthand with 'width', 'height' and custom properties"); | ||
|
||
test(function() { | ||
let cssText = "all: inherit; "; | ||
for (let longhand of getComputedStyle(document.documentElement)) { | ||
cssText += longhand + ": inherit; "; | ||
} | ||
style.cssText = cssText; | ||
assert_equals(style.cssText, "all: inherit; direction: inherit; unicode-bidi: inherit;"); | ||
}, "'all' shorthand with all longhands"); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters