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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/variables/longhand-pending-shorthand-substitution.html

Issue 2089593002: Add expansion of shorthands with custom properties to longhands using a pending substition value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix serialization and temporary property value caching. Add some additional tests. 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <style>
5 #testElem {
6 --height: 30px;
7 --size: 12px;
8 --size-and-height: var(--size)/var(--height);
9 }
Timothy Loh 2016/06/27 04:19:09 just use a single block for the two #testElem case
Andy Mutton 2016/06/28 03:18:51 Done.
10 #testElem {
11 font: italic bold var(--size-and-height) serif, sans-serif;
12 }
13
14 #testElem2 {
15 --width: 5px;
16 }
17 </style>
18
19 <div id='testElem'></div>
20 <div id='testElem2' style='margin: var(--width); margin-top: 10px;'></div>
21 <div id='testElem3' style='--b1: 1px solid grey; --b2: 2px dashed green; border: var(--b1); border-right: var(--b2);'></div>
22 <script>
23
24 test(function() {
25 var te = getComputedStyle(testElem);
Timothy Loh 2016/06/27 04:19:09 this (and similar below) is actually a style not a
Andy Mutton 2016/06/28 03:18:51 Done.
26 assert_equals(te.fontSize, '12px');
27 assert_equals(te.lineHeight, '30px');
28 assert_equals(te.fontStyle, 'italic');
29 assert_equals(te.fontWeight, 'bold');
30 assert_equals(te.fontFamily, 'serif, sans-serif');
31 }, "Test shorthand substitution in font.");
32
33 test(function() {
34 var te2 = testElem2.style;
35 assert_equals(te2.cssText, 'margin-right: ; margin-bottom: ; margin-left: ; ma rgin-top: 10px;');
36 assert_equals(te2.marginLeft, '');
37 assert_equals(te2.margin, '');
38 assert_equals(te2.marginTop, '10px');
39 }, "Test serialization with specific longhand.");
40
41 test(function() {
42 var te3 = testElem3.style;
43 assert_equals(te3.cssText, '--b1: 1px solid grey; --b2: 2px dashed green; bord er-top: var(--b1); border-bottom: var(--b1); border-left: var(--b1); border-imag e: var(--b1); border-right: var(--b2);')
44 assert_equals(te3.border, '');
45 assert_equals(te3.borderLeft, 'var(--b1)');
46 assert_equals(te3.borderTop, 'var(--b1)');
47 assert_equals(te3.borderBottom, 'var(--b1)');
48 assert_equals(te3.borderRight, 'var(--b2)');
49 }, "Test serialization for shorthands within shorthands.");
50
51 test(function() {
52 var cte3 = getComputedStyle(testElem3);
53 assert_equals(cte3.borderTop, '1px solid rgb(128, 128, 128)');
54 assert_equals(cte3.borderRight, '2px dashed rgb(0, 128, 0)');
55 }, "Test substitution for border");
56 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698