summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/resources/box-orient-button.js
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/deprecated-flexbox/resources/box-orient-button.js')
-rw-r--r--third_party/WebKit/LayoutTests/fast/deprecated-flexbox/resources/box-orient-button.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/resources/box-orient-button.js b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/resources/box-orient-button.js
new file mode 100644
index 0000000..84f135f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/resources/box-orient-button.js
@@ -0,0 +1,25 @@
+description("Check if box-orient is working in <button>. See https://bugs.webkit.org/show_bug.cgi?id=25406");
+
+function setFlexDirection(element, flexDirection) {
+ element.style.webkitFlexDirection = flexDirection;
+ element.style.flexDirection = flexDirection;
+}
+
+function gebi(id) {
+ return document.getElementById(id);
+}
+
+setFlexDirection(gebi("toVertical"), "column");
+setFlexDirection(gebi("toHorizontal"), "row");
+
+var referenceHorizontalHeight = gebi("reference_horizontal").clientHeight;
+var referenceVerticalHeight = gebi("reference_vertical").clientHeight;
+shouldBe("gebi('default').clientHeight", "referenceHorizontalHeight");
+shouldBe("gebi('horizontal').clientHeight", "referenceHorizontalHeight");
+shouldBe("gebi('vertical').clientHeight", "referenceVerticalHeight");
+shouldBe("gebi('toHorizontal').clientHeight", "referenceHorizontalHeight");
+shouldBe("gebi('toVertical').clientHeight", "referenceVerticalHeight");
+
+// If we are in DRT, we don't need meaningless messages.
+if (window.testRunner)
+ document.getElementById("main").innerHTML = "";