Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(885)

Unified Diff: third_party/WebKit/LayoutTests/custom-properties/registered-property-computation.html

Issue 2406203004: Compute registered properties after resolving high priority properties (Closed)
Patch Set: font size cycle test Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/custom-properties/registered-property-computation-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/custom-properties/registered-property-computation.html
diff --git a/third_party/WebKit/LayoutTests/custom-properties/registered-property-computation.html b/third_party/WebKit/LayoutTests/custom-properties/registered-property-computation.html
index 897550f63c9ae144af35fcfa267f9f3195b27b98..d8603855fe14adf66ac2994d516e54be3c88544a 100644
--- a/third_party/WebKit/LayoutTests/custom-properties/registered-property-computation.html
+++ b/third_party/WebKit/LayoutTests/custom-properties/registered-property-computation.html
@@ -21,11 +21,16 @@
--list-3: 3% 10vmax 22px;
--list-4: calc(50% + 1em) 4px;
}
+#fontSizeCycle {
+ --font-size: 2em;
+ font-size: var(--font-size);
+}
</style>
<div id=divWithFontSizeSet></div>
<div id=parentDiv>
<div id=divWithFontSizeInherited></div>
+ <div id=fontSizeCycle></div>
</div>
<script>
@@ -42,6 +47,7 @@ CSS.registerProperty({name: '--list-1', syntax: '<length>+', initialValue: '0px'
CSS.registerProperty({name: '--list-2', syntax: '<length>+', initialValue: '0px'});
CSS.registerProperty({name: '--list-3', syntax: '<length-percentage>+', initialValue: '0px'});
CSS.registerProperty({name: '--list-4', syntax: '<length-percentage>+', initialValue: '0px'});
+CSS.registerProperty({name: '--font-size', syntax: '<length>', initialValue: '0px'});
for (var element of [divWithFontSizeSet, divWithFontSizeInherited]) {
var id = element.id;
@@ -72,4 +78,10 @@ for (var element of [divWithFontSizeSet, divWithFontSizeInherited]) {
assert_equals(computedStyle.getPropertyValue('--list-4'), 'calc(10px + 50%) 4px');
}, "<length-percentage>+ values are computed correctly for " + id);
}
+
+test(function() {
+ var computedStyle = getComputedStyle(fontSizeCycle);
+ assert_equals(computedStyle.fontSize, '20px');
+ assert_equals(computedStyle.getPropertyValue('--font-size'), '40px');
+}, "font-size with a var() reference to a registered property using ems works as expected");
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/custom-properties/registered-property-computation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698