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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/background-serialize.html

Issue 2261533002: Fix serializing of 'unset' sub-properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: V2 Created 4 years, 4 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/StylePropertySerializer.cpp » ('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 <head> 2 <head>
3 <title>Test background properties obtained by using cssText when the properties are set by using style element's textContent.</title> 3 <title>Test background properties obtained by using cssText when the properties are set by using style element's textContent.</title>
4 <script src="../../resources/testharness.js"></script> 4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script> 5 <script src="../../resources/testharnessreport.js"></script>
6 </head> 6 </head>
7 <script> 7 <script>
8 test(function() { 8 test(function() {
9 var style = document.createElement('style'); 9 var style = document.createElement('style');
10 document.head.appendChild(style); 10 document.head.appendChild(style);
11 assert_equals(getStyle('.test { background: none; }'), '.test { background: none ; }'); 11 assert_equals(getStyle('.test { background: none; }'), '.test { background: none ; }');
12 assert_equals(getStyle('.test { background: none; background-color: black;}'), ' .test { background: none black; }'); 12 assert_equals(getStyle('.test { background: none; background-color: black;}'), ' .test { background: none black; }');
13 assert_equals(getStyle('.test { background: none; background-color: initial !imp ortant;}'), '.test { background-image: none; background-position: initial; backg round-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial !important; }'); 13 assert_equals(getStyle('.test { background: none; background-color: initial !imp ortant;}'), '.test { background-image: none; background-position: initial; backg round-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial !important; }');
14 assert_equals(getStyle('.test { background: initial; }'), '.test { background: i nitial; }'); 14 assert_equals(getStyle('.test { background: initial; }'), '.test { background: i nitial; }');
15 assert_equals(getStyle('.test { background: initial; background-color: black; }' ), '.test { background-image: initial; background-position: initial; background- size: initial; background-repeat: initial; background-attachment: initial; backg round-origin: initial; background-clip: initial; background-color: black; }'); 15 assert_equals(getStyle('.test { background: initial; background-color: black; }' ), '.test { background-image: initial; background-position: initial; background- size: initial; background-repeat: initial; background-attachment: initial; backg round-origin: initial; background-clip: initial; background-color: black; }');
16 assert_equals(getStyle('.test { background: inherit; }'), '.test { background: i nherit; }'); 16 assert_equals(getStyle('.test { background: inherit; }'), '.test { background: i nherit; }');
17 assert_equals(getStyle('.test { background: inherit; background-color: black; }' ), '.test { background-image: inherit; background-position: inherit; background- size: inherit; background-repeat: inherit; background-attachment: inherit; backg round-origin: inherit; background-clip: inherit; background-color: black; }'); 17 assert_equals(getStyle('.test { background: inherit; background-color: black; }' ), '.test { background-image: inherit; background-position: inherit; background- size: inherit; background-repeat: inherit; background-attachment: inherit; backg round-origin: inherit; background-clip: inherit; background-color: black; }');
18 assert_equals(getStyle('.test { background: unset; background-color: black; }'), '.test { background-image: unset; background-position: unset; background-size: unset; background-repeat: unset; background-attachment: unset; background-origin : unset; background-clip: unset; background-color: black; }');
19 assert_equals(getStyle('.test { background: unset; }'), '.test { background: uns et; }');
18 assert_equals(getStyle('.test { background: none; background-repeat: repeat-x !i mportant;}'), '.test { background-image: none; background-position: initial; bac kground-size: initial; background-attachment: initial; background-origin: initia l; background-clip: initial; background-color: initial; background-repeat: repea t-x !important; }'); 20 assert_equals(getStyle('.test { background: none; background-repeat: repeat-x !i mportant;}'), '.test { background-image: none; background-position: initial; bac kground-size: initial; background-attachment: initial; background-origin: initia l; background-clip: initial; background-color: initial; background-repeat: repea t-x !important; }');
19 assert_equals(getStyle('.test { background: none; background-repeat: repeat-x;}' ), '.test { background: none repeat-x; }'); 21 assert_equals(getStyle('.test { background: none; background-repeat: repeat-x;}' ), '.test { background: none repeat-x; }');
20 assert_equals(getStyle('.test { background: none; background-position-x: 0%;}'), '.test { background: none 0%; }'); 22 assert_equals(getStyle('.test { background: none; background-position-x: 0%;}'), '.test { background: none 0%; }');
21 assert_equals(getStyle('.test { background: none; background-position: 20% 80%;} '), '.test { background: none 20% 80%; }'); 23 assert_equals(getStyle('.test { background: none; background-position: 20% 80%;} '), '.test { background: none 20% 80%; }');
22 assert_equals(getStyle('.test { background-position-x: 5%; }'), '.test { backgro und-position-x: 5%; }'); 24 assert_equals(getStyle('.test { background-position-x: 5%; }'), '.test { backgro und-position-x: 5%; }');
23 assert_equals(getStyle('.test { background-position-y: 5%; }'), '.test { backgro und-position-y: 5%; }'); 25 assert_equals(getStyle('.test { background-position-y: 5%; }'), '.test { backgro und-position-y: 5%; }');
24 assert_equals(getStyle('.test { background-position-x: 5%; background-position-y : 10%; }'), '.test { background-position: 5% 10%; }'); 26 assert_equals(getStyle('.test { background-position-x: 5%; background-position-y : 10%; }'), '.test { background-position: 5% 10%; }');
25 assert_equals(getStyle('.test { background-position-x: 5%; background-position-y : 10% !important; }'), '.test { background-position-x: 5%; background-position-y : 10% !important; }'); 27 assert_equals(getStyle('.test { background-position-x: 5%; background-position-y : 10% !important; }'), '.test { background-position-x: 5%; background-position-y : 10% !important; }');
26 assert_equals(getStyle('.test { background: url(dummy://test.png); }'), '.test { background: url("dummy://test.png"); }'); 28 assert_equals(getStyle('.test { background: url(dummy://test.png); }'), '.test { background: url("dummy://test.png"); }');
27 assert_equals(getStyle('.test { background: url(dummy://test.png); background-co lor: black; }'), '.test { background: url("dummy://test.png") black; }'); 29 assert_equals(getStyle('.test { background: url(dummy://test.png); background-co lor: black; }'), '.test { background: url("dummy://test.png") black; }');
28 30
29 function getStyle(text) { 31 function getStyle(text) {
30 style.textContent = text; 32 style.textContent = text;
31 return style.sheet.cssRules[0].cssText; 33 return style.sheet.cssRules[0].cssText;
32 } 34 }
33 }); 35 });
34 </script> 36 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/StylePropertySerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698