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

Side by Side Diff: LayoutTests/fast/alignment/resources/alignment-parsing-utils.js

Issue 363133003: [CSS Grid Layout] Adapting align-self, align-items and justify-self to the last CSS 3 spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Recalc style when alignItems or justifyItems change. Created 6 years, 5 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
1 function checkValues(element, property, propertyID, value, computedValue) 1 function checkValues(element, property, propertyID, value, computedValue)
2 { 2 {
3 window.element = element; 3 window.element = element;
4 var elementID = element.id || "element"; 4 var elementID = element.id || "element";
5 shouldBeEqualToString("element.style." + property, value); 5 shouldBeEqualToString("element.style." + property, value);
6 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro pertyValue('" + propertyID + "')", computedValue); 6 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro pertyValue('" + propertyID + "')", computedValue);
7 } 7 }
8 8
9 function checkBadValues(element, property, propertyID, value) 9 function checkBadValues(element, property, propertyID, value)
10 { 10 {
11 element.style.justifyItems = value; 11 element.style[property] = value;
12 checkValues(element, property, propertyID, "", "start"); 12 checkValues(element, property, propertyID, "", "start");
13 } 13 }
14 14
15 function checkInitialValues(element, property, propertyID, display, value) 15 function checkInitialValues(element, property, propertyID, display, value)
16 { 16 {
17 var initial = "start"; 17 var initial = "start";
18 if (display == "grid" || display == "flex") { 18 if (display == "grid" || display == "flex") {
19 element.style.display = display; 19 element.style.display = display;
20 initial = "stretch"; 20 initial = "stretch";
21 } 21 }
22 22
23 element.style.justifyItems = value; 23 element.style[property] = value;
24 checkValues(element, property, propertyID, value, value); 24 checkValues(element, property, propertyID, value, value);
25 element.style.justifyItems = "initial"; 25 element.style[property] = "initial";
26 checkValues(element, property, propertyID, "initial", initial); 26 checkValues(element, property, propertyID, "initial", initial);
27 } 27 }
28 28
29 function checkInheritValues(element, property, propertyID, value) 29 function checkInheritValues(element, property, propertyID, value)
30 { 30 {
31 parentElement = document.createElement("div"); 31 parentElement = document.createElement("div");
32 document.body.appendChild(parentElement); 32 document.body.appendChild(parentElement);
33 parentElement.style.justifyItems = value; 33 parentElement.style[property] = value;
34 checkValues(parentElement, property, propertyID, value, value); 34 checkValues(parentElement, property, propertyID, value, value);
35 35
36 element = document.createElement("div"); 36 element = document.createElement("div");
37 parentElement.appendChild(element); 37 parentElement.appendChild(element);
38 element.style.justifyItems = "inherit"; 38 element.style[property] = "inherit";
39 checkValues(element, property, propertyID, "inherit", value); 39 checkValues(element, property, propertyID, "inherit", value);
40 } 40 }
41 41
42 function checkLegacyValues(element, property, propertyID, value) 42 function checkLegacyValues(element, property, propertyID, value)
43 { 43 {
44 document.body.appendChild(parentElement); 44 document.body.appendChild(parentElement);
45 parentElement.style.justifyItems = value; 45 parentElement.style[property] = value;
46 checkValues(parentElement, property, propertyID, value, value); 46 checkValues(parentElement, property, propertyID, value, value);
47 47
48 element = document.createElement("div"); 48 element = document.createElement("div");
49 parentElement.appendChild(element); 49 parentElement.appendChild(element);
50 checkValues(element, property, propertyID, "", value); 50 checkValues(element, property, propertyID, "", value);
51 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698