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

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

Issue 2552163002: Fix crash when referencing a registered non-inherited custom property (Closed)
Patch Set: Created 4 years 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/Source/core/css/resolver/CSSVariableResolver.cpp » ('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-initial.html
diff --git a/third_party/WebKit/LayoutTests/custom-properties/registered-property-initial.html b/third_party/WebKit/LayoutTests/custom-properties/registered-property-initial.html
new file mode 100644
index 0000000000000000000000000000000000000000..6a6ada6634f65887bfa60d83d0551443e6f7c2cb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/custom-properties/registered-property-initial.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<style>
+#target {
+ background: var(--inherited-color);
+ color: var(--non-inherited-color);
+}
+</style>
+<div id=target></div>
+<script>
+CSS.registerProperty({name: '--inherited-color', syntax: '<color>', initialValue: 'pink', inherits: true});
+CSS.registerProperty({name: '--non-inherited-color', syntax: '<color>', initialValue: 'purple'});
+
+test(function() {
+ computedStyle = getComputedStyle(target);
+ assert_equals(computedStyle.getPropertyValue('--inherited-color'), 'pink');
Timothy Loh 2016/12/06 05:11:27 The discrepancy pink vs rgb().. is tracked in bug
+ assert_equals(computedStyle.getPropertyValue('--non-inherited-color'), 'purple');
+
+ assert_equals(computedStyle.backgroundColor, 'rgb(255, 192, 203)');
+ assert_equals(computedStyle.color, 'rgb(128, 0, 128)');
+}, "Initial values of registered properties can be referenced when no custom properties are explicitly set.");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698