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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/variables/computed-style.html

Issue 2080723003: CSS Variable #0000ee is read as #\30 000ee (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated testcase Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSMarkup.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script> 2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script> 3 <script src="../../../resources/testharnessreport.js"></script>
4 4
5 <style> 5 <style>
6 #color { 6 #color {
7 --color-value: blue; 7 --color-value: blue;
8 --accordionColor:#0000ee;
9 --foo:#1\.;
8 background-color: var(--color-value); 10 background-color: var(--color-value);
9 } 11 }
10 12
11 #float_pixel { 13 #float_pixel {
12 --float-pixel-value: 10.5px; 14 --float-pixel-value: 10.5px;
13 border-width: var(--float-pixel-value); 15 border-width: var(--float-pixel-value);
14 } 16 }
15 17
16 #em { 18 #em {
17 --em-value: 1.5em; 19 --em-value: 1.5em;
(...skipping 17 matching lines...) Expand all
35 <div id="percentage"></div> 37 <div id="percentage"></div>
36 <div id="dynamic"></div> 38 <div id="dynamic"></div>
37 </body> 39 </body>
38 40
39 <script> 41 <script>
40 test(function() { 42 test(function() {
41 assert_equals(getComputedStyle(color).backgroundColor, 'rgb(0, 0, 255)'); 43 assert_equals(getComputedStyle(color).backgroundColor, 'rgb(0, 0, 255)');
42 }, 'background-color property, color value'); 44 }, 'background-color property, color value');
43 45
44 test(function() { 46 test(function() {
47 assert_equals(getComputedStyle(color).getPropertyValue('--accordionColor'), '# 0000ee');
48 assert_equals(getComputedStyle(color).getPropertyValue('--foo'), '#1\\.');
49 }, 'property value, accordionColor, foo');
50
51 test(function() {
45 assert_equals(getComputedStyle(float_pixel).borderWidth, '0px'); 52 assert_equals(getComputedStyle(float_pixel).borderWidth, '0px');
46 }, 'border-width property, border-style = none'); 53 }, 'border-width property, border-style = none');
47 54
48 float_pixel.style.borderStyle = "solid"; 55 float_pixel.style.borderStyle = "solid";
49 test(function() { 56 test(function() {
50 assert_equals(getComputedStyle(float_pixel).borderWidth, '10px'); 57 assert_equals(getComputedStyle(float_pixel).borderWidth, '10px');
51 }, 'border-width property, border-style = solid, floating point pixel value'); 58 }, 'border-width property, border-style = solid, floating point pixel value');
52 59
53 test(function() { 60 test(function() {
54 assert_equals(getComputedStyle(em).fontSize, '24px'); 61 assert_equals(getComputedStyle(em).fontSize, '24px');
55 }, 'font-size property, em value'); 62 }, 'font-size property, em value');
56 63
57 test(function() { 64 test(function() {
58 assert_equals( 65 assert_equals(
59 getComputedStyle(percentage).width, parseInt(getComputedStyle(document.body) .width) * 0.75 + 'px'); 66 getComputedStyle(percentage).width, parseInt(getComputedStyle(document.body) .width) * 0.75 + 'px');
60 }, 'width property, percentage value'); 67 }, 'width property, percentage value');
61 68
62 test(function() { 69 test(function() {
63 assert_equals(getComputedStyle(dynamic).getPropertyValue("--custom-value"), "" ); 70 assert_equals(getComputedStyle(dynamic).getPropertyValue("--custom-value"), "" );
64 dynamic.className = "dynamic"; 71 dynamic.className = "dynamic";
65 assert_equals(getComputedStyle(dynamic).getPropertyValue("--custom-value"), "p ass"); 72 assert_equals(getComputedStyle(dynamic).getPropertyValue("--custom-value"), "p ass");
66 }, 'custom property, forced style recalc'); 73 }, 'custom property, forced style recalc');
67 </script> 74 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSMarkup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698