Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
if border-radius includes a var(), the value is not readable from .style
https://bugs.webkit.org/show_bug.cgi?id=230389 Reviewed by Myles Maxfield. Source/WebCore: Return correct string for shorthand CSS values set by var. Add extra checks for if all longhand properties are pending values and if the requested shorthand property was set to a variable. Test: css3/short-hand-var-serialization.html * css/StyleProperties.cpp: (WebCore::StyleProperties::getPropertyValue const): LayoutTests: * css3/short-hand-var-serialization-expected.txt: Added. * css3/short-hand-var-serialization.html: Added. Canonical link: https://commits.webkit.org/243659@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
12 changed files
with
140 additions
and
31 deletions.
There are no files selected for viewing
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
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,15 @@ | ||
Test that shorthand css properties set to a variable return that variable when accessed through the style sheet. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
- Tests - | ||
PASS styleSheet.rules[1].style.borderRadius is "var(--v0)" | ||
PASS styleSheet.rules[2].style.margin is "var(--v0)" | ||
PASS styleSheet.rules[3].style.borderBlockWidth is "var(--v0)" | ||
PASS styleSheet.rules[4].style.borderInlineWidth is "var(--v0)" | ||
PASS styleSheet.rules[5].style.perspectiveOrigin is "var(--v0)" | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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,55 @@ | ||
<html> | ||
<head> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
border: 3px solid red; | ||
} | ||
#div0 { | ||
--v0: 50px; | ||
border-radius: var(--v0); | ||
} | ||
#div1 { | ||
--v0: 50px; | ||
margin: var(--v0); | ||
} | ||
|
||
#div2 { | ||
--v0: 50px; | ||
border-block-width: var(--v0); | ||
} | ||
|
||
#div3 { | ||
--v0: 50px; | ||
border-inline-width: var(--v0); | ||
} | ||
|
||
#div4 { | ||
--v0: left; | ||
perspective-origin: var(--v0); | ||
} | ||
</style> | ||
<script src="../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<div id="div0"></div> | ||
<div id="div1"></div> | ||
<div id="div2"></div> | ||
<div id="div3"></div> | ||
<div id="div4"></div> | ||
<script> | ||
description('Test that shorthand css properties set to a variable return that variable when accessed through the style sheet.'); | ||
|
||
debug('- Tests -'); | ||
//var value = document.styleSheets[1].cssRules[1].style['borderRadius']; | ||
var styleSheet = document.styleSheets[0]; | ||
shouldBeEqualToString('styleSheet.rules[1].style.borderRadius', "var(--v0)"); | ||
shouldBeEqualToString('styleSheet.rules[2].style.margin', "var(--v0)"); | ||
shouldBeEqualToString('styleSheet.rules[3].style.borderBlockWidth', "var(--v0)"); | ||
shouldBeEqualToString('styleSheet.rules[4].style.borderInlineWidth', "var(--v0)"); | ||
shouldBeEqualToString('styleSheet.rules[5].style.perspectiveOrigin', "var(--v0)"); | ||
</script> | ||
<script src="../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
|
||
PASS Logical longhands with variables - margin-inline-start | ||
PASS Logical longhands with variables - margin-inline-end | ||
FAIL Logical longhands with variables - margin-inline assert_equals: Specified value expected "" but got "var(--one) var(--two)" | ||
PASS Logical longhands with variables - margin-inline | ||
PASS Logical shorthand with 1 variable - margin-inline-start | ||
PASS Logical shorthand with 1 variable - margin-inline-end | ||
FAIL Logical shorthand with 1 variable - margin-inline assert_equals: Specified value expected "var(--one)" but got "" | ||
PASS Logical shorthand with 1 variable - margin-inline | ||
PASS Logical shorthand with 2 variables - margin-inline-start | ||
PASS Logical shorthand with 2 variables - margin-inline-end | ||
FAIL Logical shorthand with 2 variables - margin-inline assert_equals: Specified value expected "var(--one) var(--two)" but got "" | ||
PASS Logical shorthand with 2 variables - margin-inline | ||
PASS Logical shorthand with 1 variable and 1 length - margin-inline-start | ||
PASS Logical shorthand with 1 variable and 1 length - margin-inline-end | ||
FAIL Logical shorthand with 1 variable and 1 length - margin-inline assert_equals: Specified value expected "var(--one) 2px" but got "" | ||
PASS Logical shorthand with 1 variable and 1 length - margin-inline | ||
|
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
FAIL CSS variable references - shorthand properties - via CSSOM assert_equals: margin property value after calling setProperty expected "var(--prop)" but got "" | ||
PASS CSS variable references - shorthand properties - via CSSOM | ||
|
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
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
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
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
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