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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 var flexDirections = ["row", "row-reverse", "column", "column-reverse"];
2 var textDirections = ["ltr", "rtl"];
3 var writingModes = ["horizontal", "flipped-blocks", "flipped-lines"];
4
5 var createLeafNode = (i) => {
6 var flexItem = document.createElement("div");
7 flexItem.className = "leaf" + i;
8 var contentItem = document.createElement("div");
9 contentItem.innerHTML = i;
10 flexItem.appendChild(contentItem);
11 return flexItem;
12 }
13
14 var createContentNode = (flexDirection, textDirection, writingMode) => {
15 var flexNode = document.createElement("div");
16 flexNode.className = "flex " + flexDirection;
17 flexNode.title = "flex-direction: " + flexDirection + "; direction: " + textDi rection + "; writing-mode: " + writingMode;
18 for (var i = 1; i < 4; i++)
19 flexNode.appendChild(createLeafNode(i));
20 var marginShim = document.createElement("div");
21 return flexNode;
22 }
23
24 var createContainerNode = (flexDirection, textDirection, writingMode) => {
25 var containerNode = document.createElement("div");
26 containerNode.className = "container " + textDirection + " " + writingMode;
27 containerNode.appendChild(createContentNode(flexDirection, textDirection, writ ingMode));
28 return containerNode;
29 }
30
31 var createContainerRow = (flexDirection) => {
32 var containerRow = document.createElement("div");
33 containerRow.className = "container-row";
34 var rowLabel = document.createElement("div");
35 rowLabel.className = "vertical-header horizontal " + flexDirection;
36 rowLabel.innerHTML = flexDirection;
37 containerRow.appendChild(rowLabel);
38 textDirections.forEach((textDirection) => {
39 writingModes.forEach((writingMode) => {
40 var containerNode = createContainerNode(flexDirection, textDirection, writ ingMode);
41 containerRow.appendChild(containerNode);
42 });
43 });
44 return containerRow;
45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698