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

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: 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
OLDNEW
(Empty)
1 <style>
2 td { padding: 10px }
dgrogan 2017/04/25 23:23:35 We rarely indent by 1 space, use 2.
3 </style>
4 <div style="-webkit-writing-mode: vertical-rl; writing-mode: vertical-rl">
dgrogan 2017/04/25 23:23:34 Does safari require the prefixed property? If not,
5 <table style="margin: 50px">
dgrogan 2017/04/25 23:23:35 Why the margin?
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 <td id="td1c"><span id="s1c">1-C</span></td>
10 <td id="td1d"><span id="s1d">1-D</span></td>
11 <td id="td1e"><span id="s1e">1-E</span></td>
12 </tr>
13 <tr id="tr2">
14 <td id="td2a"><span id="s2a">2-A</span></td>
15 <td id="td2b"><span id="s2b">2-B</span></td>
16 <td id="td2c"><span id="s2c">2-C</span></td>
17 <td id="td2d"><span id="s2d">2-D</span></td>
18 <td id="td2e"><span id="s2e">2-E</span></td>
19 </tr>
20 <tr id="tr3">
21 <td id="td3a"><span id="s3a">3-A</span></td>
22 <td id="td3b"><span id="s3b">3-B</span></td>
23 <td id="td3c"><span id="s3c">3-C</span></td>
24 <td id="td3d"><span id="s3d">3-D</span></td>
25 <td id="td3e"><span id="s3e">3-E</span></td>
26 </tr>
27 <tr id="tr4">
28 <td id="td4a"><span id="s4a">4-A</span></td>
29 <td id="td4b"><span id="s4b">4-B</span></td>
30 <td id="td4c"><span id="s4c">4-C</span></td>
31 <td id="td4d"><span id="s4d">4-D</span></td>
32 <td id="td4e"><span id="s4e">4-E</span></td>
33 </tr>
34 <tr id="tr5">
35 <td id="td5a"><span id="s5a">5-A</span></td>
36 <td id="td5b"><span id="s5b">5-B</span></td>
37 <td id="td5c"><span id="s5c">5-C</span></td>
38 <td id="td5d"><span id="s5d">5-D</span></td>
39 <td id="td5e"><span id="s5e">5-E</span></td>
40 </tr>
41 </table>
42 <div style="padding: 100px"></div>
dgrogan 2017/04/25 23:23:35 div unneeded?
43 </div>
44 <script src="../../../resources/testharness.js"></script>
45 <script src="../../../resources/testharnessreport.js"></script>
46 <script>
47 function doesRectContainRect(parent, child) {
48 var margin = 0;
dgrogan 2017/04/25 23:23:34 remove margin?
49 if (child.top < (parent.top - margin)) {
50 return false;
51 }
52 if (child.bottom > (parent.bottom + margin)) {
53 return false;
54 }
55 if (child.left < (parent.left - margin)) {
56 return false;
57 }
58 if (child.right > (parent.right + margin)) {
59 return false;
60 }
61 return true;
62 }
63
64 function assert_contains(parent, child, description) {
65 assert_true(doesRectContainRect(parent, child), description);
66 }
67
68 function checkRowColumn(row, column) {
69 var columnName = ["a", "b", "c", "d", "e"];
70 var trId = "tr" + (row + 1);
71 var tr = document.getElementById(trId);
72 var trRect = tr.getBoundingClientRect();
73 var name = (row + 1).toString() + "-" + columnName[column].toUpperCase();
74 var spanId = "s" + (row + 1) + columnName[column];
75 var span = document.getElementById(spanId);
76 var spanRect = span.getBoundingClientRect();
77 assert_contains(trRect, spanRect, name);
dgrogan 2017/04/25 23:23:35 Can you add the 2 clientRect values to the fail me
78 }
79
80 test(function() {
81 for (var i = 0; i < 5; i++) {
dgrogan 2017/04/25 23:23:34 Rename i->row and j->column? And, do we need a tab
82 for (var j = 0; j < 5; j++) {
83 checkRowColumn(i, j);
84 }
85 }
86 }, "The child of td should be inside of tr in vertical table");
87 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698