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

Unified Diff: third_party/WebKit/LayoutTests/css3/flexbox/resources/scrollbars.js

Issue 1921553008: Fix scroll origin, overflow rects, and coordinate flipping for flexbox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Add docs to Source/core/layout/README.md Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/css3/flexbox/resources/scrollbars.js
diff --git a/third_party/WebKit/LayoutTests/css3/flexbox/resources/scrollbars.js b/third_party/WebKit/LayoutTests/css3/flexbox/resources/scrollbars.js
new file mode 100644
index 0000000000000000000000000000000000000000..5b61b499c0fa49b5476339ed625d1687fe85cafc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/css3/flexbox/resources/scrollbars.js
@@ -0,0 +1,45 @@
+var flexDirections = ["row", "row-reverse", "column", "column-reverse"];
+var textDirections = ["ltr", "rtl"];
+var writingModes = ["horizontal", "flipped-blocks", "flipped-lines"];
+
+var createLeafNode = (i) => {
+ var flexItem = document.createElement("div");
+ flexItem.className = "leaf" + i;
+ var contentItem = document.createElement("div");
+ contentItem.innerHTML = i;
+ flexItem.appendChild(contentItem);
+ return flexItem;
+}
+
+var createContentNode = (flexDirection, textDirection, writingMode) => {
+ var flexNode = document.createElement("div");
+ flexNode.className = "flex " + flexDirection;
+ flexNode.title = "flex-direction: " + flexDirection + "; direction: " + textDirection + "; writing-mode: " + writingMode;
+ for (var i = 1; i < 4; i++)
+ flexNode.appendChild(createLeafNode(i));
+ var marginShim = document.createElement("div");
+ return flexNode;
+}
+
+var createContainerNode = (flexDirection, textDirection, writingMode) => {
+ var containerNode = document.createElement("div");
+ containerNode.className = "container " + textDirection + " " + writingMode;
+ containerNode.appendChild(createContentNode(flexDirection, textDirection, writingMode));
+ return containerNode;
+}
+
+var createContainerRow = (flexDirection) => {
+ var containerRow = document.createElement("div");
+ containerRow.className = "container-row";
+ var rowLabel = document.createElement("div");
+ rowLabel.className = "vertical-header horizontal " + flexDirection;
+ rowLabel.innerHTML = flexDirection;
+ containerRow.appendChild(rowLabel);
+ textDirections.forEach((textDirection) => {
+ writingModes.forEach((writingMode) => {
+ var containerNode = createContainerNode(flexDirection, textDirection, writingMode);
+ containerRow.appendChild(containerNode);
+ });
+ });
+ return containerRow;
+}

Powered by Google App Engine
This is Rietveld 408576698