Index: LayoutTests/fast/alignment/resources/alignment-parsing-utils.js |
diff --git a/LayoutTests/fast/alignment/resources/alignment-parsing-utils.js b/LayoutTests/fast/alignment/resources/alignment-parsing-utils.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..54add53c84d1a74350f7c0558afeb800591c4b28 |
--- /dev/null |
+++ b/LayoutTests/fast/alignment/resources/alignment-parsing-utils.js |
@@ -0,0 +1,27 @@ |
+function checkValues(element, property, propertyID, value, computedValue) |
+{ |
+ window.element = element; |
+ var elementID = element.id || "element"; |
+ shouldBeEqualToString("element.style." + property, value); |
+ shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPropertyValue('" + propertyID + "')", computedValue); |
+} |
+ |
+function checkBadValues(element, property, propertyID, value) |
+{ |
+ element.style.justifyItems = value; |
+ checkValues(element, property, propertyID, "", "start"); |
+} |
+ |
+function checkInitialValues(element, property, propertyID, display) |
+{ |
+ var initial = "start"; |
+ if (display == "grid" || display == "flex") { |
+ element.style.display = display; |
+ initial = "stretch"; |
+ } |
+ |
+ element.style.justifyItems = "center"; |
+ checkValues(element, property, propertyID, "center", "center"); |
+ element.style.justifyItems = "initial"; |
+ checkValues(element, property, propertyID, "initial", initial); |
+} |