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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Element/getBoundingClientRect-vertical-child.html

Issue 2816983002: LayoutTableCell::OffsetFromContainer() should use the flipped offset of its parent. (Closed)
Patch Set: Reformat the test Created 3 years, 8 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
« no previous file with comments | « AUTHORS ('k') | third_party/WebKit/Source/core/layout/LayoutTableCell.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <style>
2 td { padding: 10px }
3 </style>
4 <div style="-webkit-writing-mode: vertical-rl; writing-mode: vertical-rl">
5 <table>
6 <tr id="tr1">
7 <td id="td1a"><span id="s1a">1-A</span></td>
8 <td id="td1b"><span id="s1b">1-B</span></td>
9 </tr>
10 <tr id="tr2">
11 <td id="td2a"><span id="s2a">2-A</span></td>
12 <td id="td2b"><span id="s2b">2-B</span></td>
13 </tr>
14 </table>
15 <script src="../../../resources/testharness.js"></script>
16 <script src="../../../resources/testharnessreport.js"></script>
17 <script>
18 function doesRectContainRect(parent, child) {
19 if (child.top < parent.top) {
20 return false;
21 }
22 if (child.bottom > parent.bottom) {
23 return false;
24 }
25 if (child.left < parent.left) {
26 return false;
27 }
28 if (child.right > parent.right) {
29 return false;
30 }
31 return true;
32 }
33
34 function rectToString(rect) {
35 return "(" + rect.left + " " + rect.top + " - " + rect.right + " " + rect. bottom + ")"
36 }
37
38 function assert_contains(parent, child, description) {
39 assert_true(doesRectContainRect(parent, child),
40 description + " " + rectToString(parent) + " should contain " + rectToString(child));
41 }
42
43 function checkRowColumn(row, column) {
44 var columnName = ["a", "b", "c", "d", "e"];
45 var trId = "tr" + (row + 1);
46 var tr = document.getElementById(trId);
47 var trRect = tr.getBoundingClientRect();
48 var name = (row + 1).toString() + "-" + columnName[column].toUpperCase();
49 var spanId = "s" + (row + 1) + columnName[column];
50 var span = document.getElementById(spanId);
51 var spanRect = span.getBoundingClientRect();
52 assert_contains(trRect, spanRect, name);
53 }
54
55 test(function() {
56 for (var row = 0; row < 2; row++) {
57 for (var column = 0; column < 2; column++) {
58 checkRowColumn(row, column);
59 }
60 }
61 }, "The child of td should be inside of tr in vertical table");
62 </script>
63 </div>
OLDNEW
« no previous file with comments | « AUTHORS ('k') | third_party/WebKit/Source/core/layout/LayoutTableCell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698