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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <style>
5 #target {
6 background: var(--inherited-color);
7 color: var(--non-inherited-color);
8 }
9 </style>
10 <div id=target></div>
11 <script>
12 CSS.registerProperty({name: '--inherited-color', syntax: '<color>', initialValue : 'pink', inherits: true});
13 CSS.registerProperty({name: '--non-inherited-color', syntax: '<color>', initialV alue: 'purple'});
14
15 test(function() {
16 computedStyle = getComputedStyle(target);
17 assert_equals(computedStyle.getPropertyValue('--inherited-color'), 'pink');
Timothy Loh 2016/12/06 05:11:27 The discrepancy pink vs rgb().. is tracked in bug
18 assert_equals(computedStyle.getPropertyValue('--non-inherited-color'), 'purp le');
19
20 assert_equals(computedStyle.backgroundColor, 'rgb(255, 192, 203)');
21 assert_equals(computedStyle.color, 'rgb(128, 0, 128)');
22 }, "Initial values of registered properties can be referenced when no custom pro perties are explicitly set.");
23 </script>
OLDNEW
« 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