Skip to content
Permalink
Browse files
border-image-* returns the initial keyword instead of the initial val…
…ue when setting border-image shorthand

https://bugs.webkit.org/show_bug.cgi?id=244657
rdar://problem/99420050

Reviewed by Sam Weinig.

* LayoutTests/fast/borders/border-image-legacy.html: Expect initial values instead of the
keyword "initial" for specified style.

* LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-image-shorthand.sub-expected.txt:
Expect PASS.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-image-shorthand.sub-expected.txt:
Ditto.

* Source/WebCore/css/StyleProperties.cpp:
(WebCore::StyleProperties::borderImagePropertyValue const): Change the code that checks for
implicit values to not require use of the initial keyword.

* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeBorderImage): Set initial values using the actual values
rather than the initial keyword.

Canonical link: https://commits.webkit.org/257119@main
  • Loading branch information
darinadler committed Nov 29, 2022
1 parent 13674c4 commit c0c6ad146d33ff23f151c5b283baedd72f840d91
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 65 deletions.
@@ -19,10 +19,10 @@
assert_array_equals([...style], ["border-image-source", "border-image-slice", "border-image-width", "border-image-outset", "border-image-repeat"]);

assert_equals(style.borderImageSource, "url(\"\")", "Specified border-image-source");
assert_equals(style.borderImageSlice, "initial", "Specified border-image-slice");
assert_equals(style.borderImageWidth, "initial", "Specified border-image-width");
assert_equals(style.borderImageOutset, "initial", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "initial", "Specified border-image-repeat");
assert_equals(style.borderImageSlice, "100%", "Specified border-image-slice");
assert_equals(style.borderImageWidth, "1", "Specified border-image-width");
assert_equals(style.borderImageOutset, "0", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "stretch", "Specified border-image-repeat");
assert_equals(style.borderImage, "url(\"\")", "Specified border-image");
assert_equals(style.webkitBorderImage, "url(\"\")", "Specified -webkit-border-image");

@@ -44,10 +44,10 @@
assert_array_equals([...style], ["border-image-source", "border-image-slice", "border-image-width", "border-image-outset", "border-image-repeat"]);

assert_equals(style.borderImageSource, "url(\"\")", "Specified border-image-source");
assert_equals(style.borderImageSlice, "initial", "Specified border-image-slice");
assert_equals(style.borderImageWidth, "initial", "Specified border-image-width");
assert_equals(style.borderImageOutset, "initial", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "initial", "Specified border-image-repeat");
assert_equals(style.borderImageSlice, "100%", "Specified border-image-slice");
assert_equals(style.borderImageWidth, "1", "Specified border-image-width");
assert_equals(style.borderImageOutset, "0", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "stretch", "Specified border-image-repeat");
assert_equals(style.borderImage, "url(\"\")", "Specified border-image");
assert_equals(style.webkitBorderImage, "url(\"\")", "Specified -webkit-border-image");

@@ -70,9 +70,9 @@

assert_equals(style.borderImageSource, "url(\"\")", "Specified border-image-source");
assert_equals(style.borderImageSlice, "50%", "Specified border-image-slice");
assert_equals(style.borderImageWidth, "initial", "Specified border-image-width");
assert_equals(style.borderImageOutset, "initial", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "initial", "Specified border-image-repeat");
assert_equals(style.borderImageWidth, "1", "Specified border-image-width");
assert_equals(style.borderImageOutset, "0", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "stretch", "Specified border-image-repeat");
assert_equals(style.borderImage, "url(\"\") 50%", "Specified border-image");
assert_equals(style.webkitBorderImage, "url(\"\") 50%", "Specified -webkit-border-image");

@@ -95,9 +95,9 @@

assert_equals(style.borderImageSource, "url(\"\")", "Specified border-image-source");
assert_equals(style.borderImageSlice, "50% fill", "Specified border-image-slice");
assert_equals(style.borderImageWidth, "initial", "Specified border-image-width");
assert_equals(style.borderImageOutset, "initial", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "initial", "Specified border-image-repeat");
assert_equals(style.borderImageWidth, "1", "Specified border-image-width");
assert_equals(style.borderImageOutset, "0", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "stretch", "Specified border-image-repeat");
assert_equals(style.borderImage, "url(\"\") 50% fill", "Specified border-image");
assert_equals(style.webkitBorderImage, "url(\"\") 50% fill", "Specified -webkit-border-image");

@@ -121,8 +121,8 @@
assert_equals(style.borderImageSource, "url(\"\")", "Specified border-image-source");
assert_equals(style.borderImageSlice, "50%", "Specified border-image-slice");
assert_equals(style.borderImageWidth, "11 22% calc(33% + 33px) auto", "Specified border-image-width");
assert_equals(style.borderImageOutset, "initial", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "initial", "Specified border-image-repeat");
assert_equals(style.borderImageOutset, "0", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "stretch", "Specified border-image-repeat");
assert_equals(style.borderImage, "url(\"\") 50% / 11 22% calc(33% + 33px) auto", "Specified border-image");
assert_equals(style.webkitBorderImage, "url(\"\") 50% / 11 22% calc(33% + 33px) auto", "Specified -webkit-border-image");

@@ -146,8 +146,8 @@
assert_equals(style.borderImageSource, "url(\"\")", "Specified border-image-source");
assert_equals(style.borderImageSlice, "50%", "Specified border-image-slice");
assert_equals(style.borderImageWidth, "11 22% calc(33% + 33px) calc(44px)", "Specified border-image-width");
assert_equals(style.borderImageOutset, "initial", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "initial", "Specified border-image-repeat");
assert_equals(style.borderImageOutset, "0", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "stretch", "Specified border-image-repeat");
assert_equals(style.borderImage, "url(\"\") 50% / 11 22% calc(33% + 33px) calc(44px)", "Specified border-image");
assert_equals(style.webkitBorderImage, "", "Specified -webkit-border-image");

@@ -171,8 +171,8 @@
assert_equals(style.borderImageSource, "url(\"\")", "Specified border-image-source");
assert_equals(style.borderImageSlice, "50% fill", "Specified border-image-slice");
assert_equals(style.borderImageWidth, "", "Specified border-image-width");
assert_equals(style.borderImageOutset, "initial", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "initial", "Specified border-image-repeat");
assert_equals(style.borderImageOutset, "0", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "stretch", "Specified border-image-repeat");
assert_equals(style.borderImage, "", "Specified border-image");
assert_equals(style.webkitBorderImage, "url(\"\") 50% fill / 11 22% calc(33% + 33px) calc(44px)", "Specified -webkit-border-image");

@@ -196,8 +196,8 @@
assert_equals(style.borderImageSource, "url(\"\")", "Specified border-image-source");
assert_equals(style.borderImageSlice, "50%", "Specified border-image-slice");
assert_equals(style.borderImageWidth, "11px 22px 33px 44px", "Specified border-image-width");
assert_equals(style.borderImageOutset, "initial", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "initial", "Specified border-image-repeat");
assert_equals(style.borderImageOutset, "0", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "stretch", "Specified border-image-repeat");
assert_equals(style.borderImage, "url(\"\") 50% / 11px 22px 33px 44px", "Specified border-image");
assert_equals(style.webkitBorderImage, "", "Specified -webkit-border-image");

@@ -221,8 +221,8 @@
assert_equals(style.borderImageSource, "url(\"\")", "Specified border-image-source");
assert_equals(style.borderImageSlice, "50% fill", "Specified border-image-slice");
assert_equals(style.borderImageWidth, "", "Specified border-image-width");
assert_equals(style.borderImageOutset, "initial", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "initial", "Specified border-image-repeat");
assert_equals(style.borderImageOutset, "0", "Specified border-image-outset");
assert_equals(style.borderImageRepeat, "stretch", "Specified border-image-repeat");
assert_equals(style.borderImage, "", "Specified border-image");
assert_equals(style.webkitBorderImage, "url(\"\") 50% fill / 11px 22px 33px 44px", "Specified -webkit-border-image");

@@ -1,32 +1,32 @@

FAIL e.style['border-image'] = "none" should set border-image-outset assert_equals: border-image-outset should be canonical expected "0" but got "initial"
FAIL e.style['border-image'] = "none" should set border-image-repeat assert_equals: border-image-repeat should be canonical expected "stretch" but got "initial"
FAIL e.style['border-image'] = "none" should set border-image-slice assert_equals: border-image-slice should be canonical expected "100%" but got "initial"
PASS e.style['border-image'] = "none" should set border-image-outset
PASS e.style['border-image'] = "none" should set border-image-repeat
PASS e.style['border-image'] = "none" should set border-image-slice
PASS e.style['border-image'] = "none" should set border-image-source
FAIL e.style['border-image'] = "none" should set border-image-width assert_equals: border-image-width should be canonical expected "1" but got "initial"
PASS e.style['border-image'] = "none" should set border-image-width
PASS e.style['border-image'] = "none" should not set unrelated longhands
FAIL e.style['border-image'] = "url(\"http://localhost/\") 1 2 3 4 fill" should set border-image-outset assert_equals: border-image-outset should be canonical expected "0" but got "initial"
FAIL e.style['border-image'] = "url(\"http://localhost/\") 1 2 3 4 fill" should set border-image-repeat assert_equals: border-image-repeat should be canonical expected "stretch" but got "initial"
PASS e.style['border-image'] = "url(\"http://localhost/\") 1 2 3 4 fill" should set border-image-outset
PASS e.style['border-image'] = "url(\"http://localhost/\") 1 2 3 4 fill" should set border-image-repeat
PASS e.style['border-image'] = "url(\"http://localhost/\") 1 2 3 4 fill" should set border-image-slice
PASS e.style['border-image'] = "url(\"http://localhost/\") 1 2 3 4 fill" should set border-image-source
FAIL e.style['border-image'] = "url(\"http://localhost/\") 1 2 3 4 fill" should set border-image-width assert_equals: border-image-width should be canonical expected "1" but got "initial"
PASS e.style['border-image'] = "url(\"http://localhost/\") 1 2 3 4 fill" should set border-image-width
PASS e.style['border-image'] = "url(\"http://localhost/\") 1 2 3 4 fill" should not set unrelated longhands
FAIL e.style['border-image'] = "repeat round" should set border-image-outset assert_equals: border-image-outset should be canonical expected "0" but got "initial"
PASS e.style['border-image'] = "repeat round" should set border-image-outset
PASS e.style['border-image'] = "repeat round" should set border-image-repeat
FAIL e.style['border-image'] = "repeat round" should set border-image-slice assert_equals: border-image-slice should be canonical expected "100%" but got "initial"
FAIL e.style['border-image'] = "repeat round" should set border-image-source assert_equals: border-image-source should be canonical expected "none" but got "initial"
FAIL e.style['border-image'] = "repeat round" should set border-image-width assert_equals: border-image-width should be canonical expected "1" but got "initial"
PASS e.style['border-image'] = "repeat round" should set border-image-slice
PASS e.style['border-image'] = "repeat round" should set border-image-source
PASS e.style['border-image'] = "repeat round" should set border-image-width
PASS e.style['border-image'] = "repeat round" should not set unrelated longhands
FAIL e.style['border-image'] = "url(\"http://localhost/\") fill 1 2% 3 4%" should set border-image-outset assert_equals: border-image-outset should be canonical expected "0" but got "initial"
FAIL e.style['border-image'] = "url(\"http://localhost/\") fill 1 2% 3 4%" should set border-image-repeat assert_equals: border-image-repeat should be canonical expected "stretch" but got "initial"
PASS e.style['border-image'] = "url(\"http://localhost/\") fill 1 2% 3 4%" should set border-image-outset
PASS e.style['border-image'] = "url(\"http://localhost/\") fill 1 2% 3 4%" should set border-image-repeat
PASS e.style['border-image'] = "url(\"http://localhost/\") fill 1 2% 3 4%" should set border-image-slice
PASS e.style['border-image'] = "url(\"http://localhost/\") fill 1 2% 3 4%" should set border-image-source
FAIL e.style['border-image'] = "url(\"http://localhost/\") fill 1 2% 3 4%" should set border-image-width assert_equals: border-image-width should be canonical expected "1" but got "initial"
PASS e.style['border-image'] = "url(\"http://localhost/\") fill 1 2% 3 4%" should set border-image-width
PASS e.style['border-image'] = "url(\"http://localhost/\") fill 1 2% 3 4%" should not set unrelated longhands
PASS e.style['border-image'] = "1 2% 3 4% / 5% / 6" should set border-image-outset
FAIL e.style['border-image'] = "1 2% 3 4% / 5% / 6" should set border-image-repeat assert_equals: border-image-repeat should be canonical expected "stretch" but got "initial"
PASS e.style['border-image'] = "1 2% 3 4% / 5% / 6" should set border-image-repeat
PASS e.style['border-image'] = "1 2% 3 4% / 5% / 6" should set border-image-slice
FAIL e.style['border-image'] = "1 2% 3 4% / 5% / 6" should set border-image-source assert_equals: border-image-source should be canonical expected "none" but got "initial"
PASS e.style['border-image'] = "1 2% 3 4% / 5% / 6" should set border-image-source
PASS e.style['border-image'] = "1 2% 3 4% / 5% / 6" should set border-image-width
PASS e.style['border-image'] = "1 2% 3 4% / 5% / 6" should not set unrelated longhands

@@ -1,32 +1,32 @@

FAIL e.style['border-image'] = "none" should set border-image-outset assert_equals: border-image-outset should be canonical expected "0" but got "initial"
FAIL e.style['border-image'] = "none" should set border-image-repeat assert_equals: border-image-repeat should be canonical expected "stretch" but got "initial"
FAIL e.style['border-image'] = "none" should set border-image-slice assert_equals: border-image-slice should be canonical expected "100%" but got "initial"
PASS e.style['border-image'] = "none" should set border-image-outset
PASS e.style['border-image'] = "none" should set border-image-repeat
PASS e.style['border-image'] = "none" should set border-image-slice
PASS e.style['border-image'] = "none" should set border-image-source
FAIL e.style['border-image'] = "none" should set border-image-width assert_equals: border-image-width should be canonical expected "1" but got "initial"
PASS e.style['border-image'] = "none" should set border-image-width
PASS e.style['border-image'] = "none" should not set unrelated longhands
FAIL e.style['border-image'] = "url(\"http://web-platform.test/\") 1 2 3 4 fill" should set border-image-outset assert_equals: border-image-outset should be canonical expected "0" but got "initial"
FAIL e.style['border-image'] = "url(\"http://web-platform.test/\") 1 2 3 4 fill" should set border-image-repeat assert_equals: border-image-repeat should be canonical expected "stretch" but got "initial"
PASS e.style['border-image'] = "url(\"http://web-platform.test/\") 1 2 3 4 fill" should set border-image-outset
PASS e.style['border-image'] = "url(\"http://web-platform.test/\") 1 2 3 4 fill" should set border-image-repeat
PASS e.style['border-image'] = "url(\"http://web-platform.test/\") 1 2 3 4 fill" should set border-image-slice
PASS e.style['border-image'] = "url(\"http://web-platform.test/\") 1 2 3 4 fill" should set border-image-source
FAIL e.style['border-image'] = "url(\"http://web-platform.test/\") 1 2 3 4 fill" should set border-image-width assert_equals: border-image-width should be canonical expected "1" but got "initial"
PASS e.style['border-image'] = "url(\"http://web-platform.test/\") 1 2 3 4 fill" should set border-image-width
PASS e.style['border-image'] = "url(\"http://web-platform.test/\") 1 2 3 4 fill" should not set unrelated longhands
FAIL e.style['border-image'] = "repeat round" should set border-image-outset assert_equals: border-image-outset should be canonical expected "0" but got "initial"
PASS e.style['border-image'] = "repeat round" should set border-image-outset
PASS e.style['border-image'] = "repeat round" should set border-image-repeat
FAIL e.style['border-image'] = "repeat round" should set border-image-slice assert_equals: border-image-slice should be canonical expected "100%" but got "initial"
FAIL e.style['border-image'] = "repeat round" should set border-image-source assert_equals: border-image-source should be canonical expected "none" but got "initial"
FAIL e.style['border-image'] = "repeat round" should set border-image-width assert_equals: border-image-width should be canonical expected "1" but got "initial"
PASS e.style['border-image'] = "repeat round" should set border-image-slice
PASS e.style['border-image'] = "repeat round" should set border-image-source
PASS e.style['border-image'] = "repeat round" should set border-image-width
PASS e.style['border-image'] = "repeat round" should not set unrelated longhands
FAIL e.style['border-image'] = "url(\"http://web-platform.test/\") fill 1 2% 3 4%" should set border-image-outset assert_equals: border-image-outset should be canonical expected "0" but got "initial"
FAIL e.style['border-image'] = "url(\"http://web-platform.test/\") fill 1 2% 3 4%" should set border-image-repeat assert_equals: border-image-repeat should be canonical expected "stretch" but got "initial"
PASS e.style['border-image'] = "url(\"http://web-platform.test/\") fill 1 2% 3 4%" should set border-image-outset
PASS e.style['border-image'] = "url(\"http://web-platform.test/\") fill 1 2% 3 4%" should set border-image-repeat
PASS e.style['border-image'] = "url(\"http://web-platform.test/\") fill 1 2% 3 4%" should set border-image-slice
PASS e.style['border-image'] = "url(\"http://web-platform.test/\") fill 1 2% 3 4%" should set border-image-source
FAIL e.style['border-image'] = "url(\"http://web-platform.test/\") fill 1 2% 3 4%" should set border-image-width assert_equals: border-image-width should be canonical expected "1" but got "initial"
PASS e.style['border-image'] = "url(\"http://web-platform.test/\") fill 1 2% 3 4%" should set border-image-width
PASS e.style['border-image'] = "url(\"http://web-platform.test/\") fill 1 2% 3 4%" should not set unrelated longhands
PASS e.style['border-image'] = "1 2% 3 4% / 5% / 6" should set border-image-outset
FAIL e.style['border-image'] = "1 2% 3 4% / 5% / 6" should set border-image-repeat assert_equals: border-image-repeat should be canonical expected "stretch" but got "initial"
PASS e.style['border-image'] = "1 2% 3 4% / 5% / 6" should set border-image-repeat
PASS e.style['border-image'] = "1 2% 3 4% / 5% / 6" should set border-image-slice
FAIL e.style['border-image'] = "1 2% 3 4% / 5% / 6" should set border-image-source assert_equals: border-image-source should be canonical expected "none" but got "initial"
PASS e.style['border-image'] = "1 2% 3 4% / 5% / 6" should set border-image-source
PASS e.style['border-image'] = "1 2% 3 4% / 5% / 6" should set border-image-width
PASS e.style['border-image'] = "1 2% 3 4% / 5% / 6" should not set unrelated longhands

0 comments on commit c0c6ad1

Please sign in to comment.