Skip to content

Commit

Permalink
getBoundingClientRect() returns wrong value for tr, td and its descen…
Browse files Browse the repository at this point in the history
…dants for a vertical table

getBoundingClientRect() returns wrong value for tr, td and its descendants for a vertical table

https://bugs.webkit.org/show_bug.cgi?id=170768

Reviewed by Ryosuke Niwa.

Patch Authored by Yuki Sekiguchi

RenderTableRow grows toward y axis even if the writing-mode of the table is vertical-rl. The reason is that RenderTableSection::layoutRows() sets the physical x/y instead of the logical x/y. The layout() should set the logical ones.

A RenderTableCell is relative to a RenderTableSection. Since the container of the RenderTableCell is a RenderTableRow, RenderTableCell::offsetFromContainer() should subtract the offset of the RenderTableRow. Since offsetFromContainer() returns the physical offset, it should subtract the flipped x/y of the RenderTableRow. However, it uses the unflipped x/y. Since offsetFromContainer() of the parent returns the flipped offset, RenderTableCell::offsetFromContainer() can use it.

* Source/WebCore/rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::offsetFromContainer): Used offsetFromContainer() to get the offset of RenderTableRow
* Source/WebCore/rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::layoutRows): Set the logical x/y instead of the physical x/y
* LayoutTests/fast/dom/Element/getBoundingClientRect-vertical-child.html: Added Test Case
* LayoutTests/fast/dom/Element/getBoundingClientRect-vertical-child-expected.txt: Added Test Case Expectations
* LayoutTests/fast/dom/Element/getBoundingClientRect-vertical-td.html: Added Test Case
* LayoutTests/fast/dom/Element/getBoundingClientRect-vertical-td-expected.txt: Added Test Case Expectations
* LayoutTests/fast/dom/Element/getBoundingClientRect-vertical-tr.html: Added Test Case
* LayoutTests/fast/dom/Element/getBoundingClientRect-vertical-tr-expected.txt: Added Test Case Expectations
* LayoutTests/platform/glib/fast/css/h1-in-section-elements-expected.txt: Updated Test Expectations
* LayoutTests/platform/glib/fast/writing-mode/border-styles-vertical-lr-expected.txt: Updated Test Expectations
* LayoutTests/platform/fast/writing-mode/border-styles-vertical-lr-mixed-expected.txt: Updated Test Expectations
* LayoutTests/platform/fast/writing-mode/border-styles-vertical-rl-expected.txt: Updated Test Expectations
* LayoutTests/platform/fast/writing-mode/border-styles-vertical-rl-mixed-expected.txt: Updated Test Expectations
* LayoutTests/platform/glib/tables/mozilla_expected_failures/bugs/bug7113-expected.txt: Updated Test Expectations
* LayoutTests/platform/gtk/fast/text/text-letter-spacing-expected.txt: Updated Test Expectations
* LayoutTests/platform/gtk/fast/writing-mode/vertical-align-table-baseline-expected.txt: Updated Test Expectations
* LayoutTests/platform/gtk/fast/tables/mozilla/bugs/bug2962-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/css/h1-in-section-elements-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/overflow/overflow-rtl-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/table/027-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/table/028-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/table/038-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/table/040-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/table/border-collapsing/equal-precedence-resolution-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/table/border-collapsing/rtl-border-collapsing-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/table/rowspan-paint-order-vertical-expected.txt: Updated Test Expectations
* LayoutTest/platform/ios/fast/table/table-display-types-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/mac/fast/overflow/overflow-rtl-expected.txt: Updated Test Expectations
* LayoutTests/platform/mac/fast/table/border-collapsing/001-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/mac/fast/table/border-collapsing/002-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/mac/fast/table/border-collapsing/003-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/mac/fast/table/border-collapsing/004-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/mac/fast/table/border-collapsing/004-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/mac/fast/table/border-collapsing/equal-precedence-resolution-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/mac/fast/table/border-collapsing/rtl-border-collapsing-vertical-expected: Updated Test Expectations
* LayoutTests/fast/table/border-collapsing/collapsed-borders-adjoining-sections-vertical-rl-expected.png: Updated Test Expectations
* LayoutTests/fast/table/border-collapsing/collapsed-borders-adjoining-sections-vertical-rl-expected.txt: Updated Test Expectations
* LayoutTests/fast/table/growCellForImageQuirk-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/table/auto-with-percent-height-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/table/border-collapsing/001-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/table/border-collapsing/002-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/table/border-collapsing/003-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/table/border-collapsing/004-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/ios/fast/writing-mode/vertical-align-table-baseline-expected.png: Updated Test Expectations
* LayoutTests/platform/ios/fast/writing-mode/vertical-align-table-baseline-expected.txt: Updated Test Expectations
* LayoutTests/platform/mac/fast/css/h1-in-section-elements-expected.png: Updated Test Expectations
* LayoutTests/platform/mac/fast/css/h1-in-section-elements-expected.txt: Updated Test Expectations
* LayoutTests/platform/mac/overflow/overflow-rtl-expected.png: Updated Test Expectations
* LayoutTests/platform/mac/overflow/overflow-rtl-expected.txt: Updated Test Expectations
* LayoutTests/platform/mac/overflow/overflow-rtl-vertical-expected.png: Updated Test Expectations
* LayoutTests/platform/mac/overflow/overflow-rtl-vertical-expected.txt: Updated Test Expectations
* LayoutTest/platform/mac/fast/table/027-vertical-expected.png: Updated Test Expectations
* LayoutTest/platform/mac/fast/table/027-vertical-expected.txt: Updated Test Expectations
* LayoutTest/platform/mac/fast/table/028-vertical-expected.png: Updated Test Expectations
* LayoutTest/platform/mac/fast/table/028-vertical-expected.txt: Updated Test Expectations
* LayoutTest/platform/mac/fast/table/038-vertical-expected.png: Updated Test Expectations
* LayoutTest/platform/mac/fast/table/038-vertical-expected.txt: Updated Test Expectations
* LayoutTest/platform/mac/fast/table/040-vertical-expected.png: Updated Test Expectations
* LayoutTest/platform/mac/fast/table/040-vertical-expected.txt: Updated Test Expectations
* LayoutTest/platform/mac/fast/table/auto-with-percent-height-vertical-expected.png: Updated Test Expectations
* LayoutTest/platform/mac/fast/table/auto-with-percent-height-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/glib/fast/table/border-collapsing/002-vertical-expected.txt: Updated Test Expectations
* LayoutTests/fast/repaint/table-writing-modes-h-expected.txt: Updated Test Expectations
* LayoutTests/fast/repaint/table-writing-modes-v-expected.txt: Updated Test Expectations
* LayoutTests/platform/glib/fast/tables/027-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/glib/fast/tables/028-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/gtk/fast/tables/038-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/gtk/fast/tables/040-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/glib/fast/table/border-collapsing/002-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/gtk/fast/table/auto-with-percent-height-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/gtk/fast/table/001-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/gtk/fast/table/003-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/gtk/fast/table/004-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/mac/fast/table/rowspan-paint-order-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/mac/fast/table/table-disply-types-vertical-expected.png: Updated Test Expectations
* LayoutTests/platform/mac/fast/table/table-disply-types-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/mac/fast/writing-mode/vertical-align-table-baseline-expected: Updated Test Expectations
* LayoutTests/platform/glib/fast/table/border-collapsing/equal-precedence-resolution-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/glib/fast/table/table-display-types-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/gtk/fast/table/border-collapsing/rtl-border-collapsing-vertical-expected.txt: Updated Test Expectations
* LayoutTests/platform/gtk/fast/table/rowspan-paint-order-vertical-expected.txt: Updated Test Expectations

Canonical link: https://commits.webkit.org/254918@main
  • Loading branch information
Ahmad-S792 authored and aproskuryakov committed Sep 27, 2022
1 parent ae1f4b1 commit 1e62e8a
Show file tree
Hide file tree
Showing 77 changed files with 605 additions and 271 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
1-A 1-B 1-C 1-D 1-E
2-A 2-B 2-C 2-D 2-E
3-A 3-B 3-C 3-D 3-E
4-A 4-B 4-C 4-D 4-E
5-A 5-B 5-C 5-D 5-E
PASS doesRectContainRect('1-A', gTrRect, gSpanRect) is true
PASS doesRectContainRect('1-B', gTrRect, gSpanRect) is true
PASS doesRectContainRect('1-C', gTrRect, gSpanRect) is true
PASS doesRectContainRect('1-D', gTrRect, gSpanRect) is true
PASS doesRectContainRect('1-E', gTrRect, gSpanRect) is true
PASS doesRectContainRect('2-A', gTrRect, gSpanRect) is true
PASS doesRectContainRect('2-B', gTrRect, gSpanRect) is true
PASS doesRectContainRect('2-C', gTrRect, gSpanRect) is true
PASS doesRectContainRect('2-D', gTrRect, gSpanRect) is true
PASS doesRectContainRect('2-E', gTrRect, gSpanRect) is true
PASS doesRectContainRect('3-A', gTrRect, gSpanRect) is true
PASS doesRectContainRect('3-B', gTrRect, gSpanRect) is true
PASS doesRectContainRect('3-C', gTrRect, gSpanRect) is true
PASS doesRectContainRect('3-D', gTrRect, gSpanRect) is true
PASS doesRectContainRect('3-E', gTrRect, gSpanRect) is true
PASS doesRectContainRect('4-A', gTrRect, gSpanRect) is true
PASS doesRectContainRect('4-B', gTrRect, gSpanRect) is true
PASS doesRectContainRect('4-C', gTrRect, gSpanRect) is true
PASS doesRectContainRect('4-D', gTrRect, gSpanRect) is true
PASS doesRectContainRect('4-E', gTrRect, gSpanRect) is true
PASS doesRectContainRect('5-A', gTrRect, gSpanRect) is true
PASS doesRectContainRect('5-B', gTrRect, gSpanRect) is true
PASS doesRectContainRect('5-C', gTrRect, gSpanRect) is true
PASS doesRectContainRect('5-D', gTrRect, gSpanRect) is true
PASS doesRectContainRect('5-E', gTrRect, gSpanRect) is true
PASS successfullyParsed is true

TEST COMPLETE

Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<style>
td { padding: 10px }
</style>
<div style="-webkit-writing-mode: vertical-rl; writing-mode: vertical-rl"> <table style="margin: 50px">
<tr id="tr1">
<td id="td1a"><span id="s1a">1-A</span></td>
<td id="td1b"><span id="s1b">1-B</span></td>
<td id="td1c"><span id="s1c">1-C</span></td>
<td id="td1d"><span id="s1d">1-D</span></td>
<td id="td1e"><span id="s1e">1-E</span></td>
</tr>
<tr id="tr2">
<td id="td2a"><span id="s2a">2-A</span></td>
<td id="td2b"><span id="s2b">2-B</span></td>
<td id="td2c"><span id="s2c">2-C</span></td>
<td id="td2d"><span id="s2d">2-D</span></td>
<td id="td2e"><span id="s2e">2-E</span></td>
</tr>
<tr id="tr3">
<td id="td3a"><span id="s3a">3-A</span></td>
<td id="td3b"><span id="s3b">3-B</span></td>
<td id="td3c"><span id="s3c">3-C</span></td>
<td id="td3d"><span id="s3d">3-D</span></td>
<td id="td3e"><span id="s3e">3-E</span></td>
</tr>
<tr id="tr4">
<td id="td4a"><span id="s4a">4-A</span></td>
<td id="td4b"><span id="s4b">4-B</span></td>
<td id="td4c"><span id="s4c">4-C</span></td>
<td id="td4d"><span id="s4d">4-D</span></td>
<td id="td4e"><span id="s4e">4-E</span></td>
</tr>
<tr id="tr5">
<td id="td5a"><span id="s5a">5-A</span></td>
<td id="td5b"><span id="s5b">5-B</span></td>
<td id="td5c"><span id="s5c">5-C</span></td>
<td id="td5d"><span id="s5d">5-D</span></td>
<td id="td5e"><span id="s5e">5-E</span></td>
</tr>
</table>
<div id="r"></div>
<div style="padding: 100px"></div>
</div>
<div id="console"></div>
<script>
if (window.testRunner)
testRunner.dumpAsText();

function doesRectContainRect(description, parent, child) {
var margin = 0;
if (child.top < (parent.top - margin)) {
return false;
}
if (child.bottom > (parent.bottom + margin)) {
return false;
}
if (child.left < (parent.left - margin)) {
return false;
}
if (child.right > (parent.right + margin)) {
return false;
}
return true;
}

var gTrRect;
var gSpanRect;
function assert_contains(parent, child, description) {
gTrRect = parent;
gSpanRect = child;
shouldBeTrue("doesRectContainRect('" + description + "', gTrRect, gSpanRect)");
}

function checkRowColumn(row, column) {
var columnName = ["a", "b", "c", "d", "e"];
var trId = "tr" + (row + 1);
var tr = document.getElementById(trId);
var trRect = tr.getBoundingClientRect();
var name = (row + 1).toString() + "-" + columnName[column].toUpperCase();
var spanId = "s" + (row + 1) + columnName[column];
var span = document.getElementById(spanId);
var spanRect = span.getBoundingClientRect();
assert_contains(trRect, spanRect, name);
}

for (var i = 0; i < 5; i++) {
for (var j = 0; j < 5; j++) {
checkRowColumn(i, j);
}
}
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
1-A 1-B 1-C 1-D 1-E
2-A 2-B 2-C 2-D 2-E
3-A 3-B 3-C 3-D 3-E
4-A 4-B 4-C 4-D 4-E
5-A 5-B 5-C 5-D 5-E
PASS doesRectContainRect('1-A', gTrRect, gTdRect) is true
PASS doesRectContainRect('1-B', gTrRect, gTdRect) is true
PASS doesRectContainRect('1-C', gTrRect, gTdRect) is true
PASS doesRectContainRect('1-D', gTrRect, gTdRect) is true
PASS doesRectContainRect('1-E', gTrRect, gTdRect) is true
PASS doesRectContainRect('2-A', gTrRect, gTdRect) is true
PASS doesRectContainRect('2-B', gTrRect, gTdRect) is true
PASS doesRectContainRect('2-C', gTrRect, gTdRect) is true
PASS doesRectContainRect('2-D', gTrRect, gTdRect) is true
PASS doesRectContainRect('2-E', gTrRect, gTdRect) is true
PASS doesRectContainRect('3-A', gTrRect, gTdRect) is true
PASS doesRectContainRect('3-B', gTrRect, gTdRect) is true
PASS doesRectContainRect('3-C', gTrRect, gTdRect) is true
PASS doesRectContainRect('3-D', gTrRect, gTdRect) is true
PASS doesRectContainRect('3-E', gTrRect, gTdRect) is true
PASS doesRectContainRect('4-A', gTrRect, gTdRect) is true
PASS doesRectContainRect('4-B', gTrRect, gTdRect) is true
PASS doesRectContainRect('4-C', gTrRect, gTdRect) is true
PASS doesRectContainRect('4-D', gTrRect, gTdRect) is true
PASS doesRectContainRect('4-E', gTrRect, gTdRect) is true
PASS doesRectContainRect('5-A', gTrRect, gTdRect) is true
PASS doesRectContainRect('5-B', gTrRect, gTdRect) is true
PASS doesRectContainRect('5-C', gTrRect, gTdRect) is true
PASS doesRectContainRect('5-D', gTrRect, gTdRect) is true
PASS doesRectContainRect('5-E', gTrRect, gTdRect) is true
PASS successfullyParsed is true

TEST COMPLETE

Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<style>
td { padding: 10px }
</style>
<div style="-webkit-writing-mode: vertical-rl; writing-mode: vertical-rl"> <table style="margin: 50px">
<tr id="tr1">
<td id="td1a"><span id="s1a">1-A</span></td>
<td id="td1b"><span id="s1b">1-B</span></td>
<td id="td1c"><span id="s1c">1-C</span></td>
<td id="td1d"><span id="s1d">1-D</span></td>
<td id="td1e"><span id="s1e">1-E</span></td>
</tr>
<tr id="tr2">
<td id="td2a"><span id="s2a">2-A</span></td>
<td id="td2b"><span id="s2b">2-B</span></td>
<td id="td2c"><span id="s2b">2-C</span></td>
<td id="td2d"><span id="s2b">2-D</span></td>
<td id="td2e"><span id="s2b">2-E</span></td>
</tr>
<tr id="tr3">
<td id="td3a"><span id="s3a">3-A</span></td>
<td id="td3b"><span id="s3b">3-B</span></td>
<td id="td3c"><span id="s3b">3-C</span></td>
<td id="td3d"><span id="s3b">3-D</span></td>
<td id="td3e"><span id="s3b">3-E</span></td>
</tr>
<tr id="tr4">
<td id="td4a"><span id="s4a">4-A</span></td>
<td id="td4b"><span id="s4b">4-B</span></td>
<td id="td4c"><span id="s4b">4-C</span></td>
<td id="td4d"><span id="s4b">4-D</span></td>
<td id="td4e"><span id="s4b">4-E</span></td>
</tr>
<tr id="tr5">
<td id="td5a"><span id="s5a">5-A</span></td>
<td id="td5b"><span id="s5b">5-B</span></td>
<td id="td5c"><span id="s5b">5-C</span></td>
<td id="td5d"><span id="s5b">5-D</span></td>
<td id="td5e"><span id="s5b">5-E</span></td>
</tr>
</table>
<div id="r"></div>
<div style="padding: 100px"></div>
</div>
<div id="console"></div>
<script>
if (window.testRunner)
testRunner.dumpAsText();

function doesRectContainRect(description, parent, child) {
var margin = 0;
if (child.top < (parent.top - margin)) {
return false;
}
if (child.bottom > (parent.bottom + margin)) {
return false;
}
if (child.left < (parent.left - margin)) {
return false;
}
if (child.right > (parent.right + margin)) {
return false;
}
return true;
}

var gTrRect;
var gTdRect;
function assert_contains(parent, child, description) {
gTrRect = parent;
gTdRect = child;
shouldBeTrue("doesRectContainRect('" + description + "', gTrRect, gTdRect)");
}

function checkRowColumn(row, column) {
var columnName = ["a", "b", "c", "d", "e"];
var trId = "tr" + (row + 1);
var tr = document.getElementById(trId);
var trRect = tr.getBoundingClientRect();
var name = (row + 1).toString() + "-" + columnName[column].toUpperCase();
var tdId = "td" + (row + 1) + columnName[column];
var td = document.getElementById(tdId);
var tdRect = td.getBoundingClientRect();
assert_contains(trRect, tdRect, name);
}

for (var i = 0; i < 5; i++) {
for (var j = 0; j < 5; j++) {
checkRowColumn(i, j);
}
}
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
1-A 1-B 1-C 1-D 1-E
2-A 2-B 2-C 2-D 2-E
3-A 3-B 3-C 3-D 3-E
4-A 4-B 4-C 4-D 4-E
5-A 5-B 5-C 5-D 5-E
PASS doesRectContainRect('tr1', gTableRect, gTrRect) is true
PASS doesRectContainRect('tr2', gTableRect, gTrRect) is true
PASS doesRectContainRect('tr3', gTableRect, gTrRect) is true
PASS doesRectContainRect('tr4', gTableRect, gTrRect) is true
PASS doesRectContainRect('tr5', gTableRect, gTrRect) is true
PASS successfullyParsed is true

TEST COMPLETE

Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<style>
td { padding: 10px }
</style>
<div style="-webkit-writing-mode: vertical-rl; writing-mode: vertical-rl">
<table style="margin: 50px">
<tr id="tr1">
<td id="td1a"><span id="s1a">1-A</span></td>
<td id="td1b"><span id="s1b">1-B</span></td>
<td id="td1c"><span id="s1c">1-C</span></td>
<td id="td1d"><span id="s1d">1-D</span></td>
<td id="td1e"><span id="s1e">1-E</span></td>
</tr>
<tr id="tr2">
<td id="td2a"><span id="s2a">2-A</span></td>
<td id="td2b"><span id="s2b">2-B</span></td>
<td id="td2c"><span id="s2b">2-C</span></td>
<td id="td2d"><span id="s2b">2-D</span></td>
<td id="td2e"><span id="s2b">2-E</span></td>
</tr>
<tr id="tr3">
<td id="td3a"><span id="s3a">3-A</span></td>
<td id="td3b"><span id="s3b">3-B</span></td>
<td id="td3c"><span id="s3b">3-C</span></td>
<td id="td3d"><span id="s3b">3-D</span></td>
<td id="td3e"><span id="s3b">3-E</span></td>
</tr>
<tr id="tr4">
<td id="td4a"><span id="s4a">4-A</span></td>
<td id="td4b"><span id="s4b">4-B</span></td>
<td id="td4c"><span id="s4b">4-C</span></td>
<td id="td4d"><span id="s4b">4-D</span></td>
<td id="td4e"><span id="s4b">4-E</span></td>
</tr>
<tr id="tr5">
<td id="td5a"><span id="s5a">5-A</span></td>
<td id="td5b"><span id="s5b">5-B</span></td>
<td id="td5c"><span id="s5b">5-C</span></td>
<td id="td5d"><span id="s5b">5-D</span></td>
<td id="td5e"><span id="s5b">5-E</span></td>
</tr>
</table>
<div id="r"></div>
<div style="padding: 100px"></div>
</div>
<div id="console"></div>
<script>
if (window.testRunner)
testRunner.dumpAsText();

function doesRectContainRect(description, parent, child) {
var margin = 0;
if (child.top < (parent.top - margin)) {
return false;
}
if (child.bottom > (parent.bottom + margin)) {
return false;
}
if (child.left < (parent.left - margin)) {
return false;
}
if (child.right > (parent.right + margin)) {
return false;
}
return true;
}

var gTableRect;
var gTrRect;
function assert_contains(parent, child, description) {
gTableRect = parent;
gTrRect = child;
shouldBeTrue("doesRectContainRect('" + description + "', gTableRect, gTrRect)");
}

var table = document.getElementsByTagName("table")[0];
var tableRect = table.getBoundingClientRect();
for (var i = 0; i < 5; i++) {
var trId = "tr" + (i + 1);
var tr = document.getElementById(trId);
var trRect = tr.getBoundingClientRect();
assert_contains(tableRect, trRect, trId);
}
</script>
4 changes: 2 additions & 2 deletions LayoutTests/fast/repaint/table-writing-modes-h-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ layer at (0,0) size 800x466
RenderTableRow {TR} at (0,0) size 52x104
RenderTableCell {TD} at (0,25) size 52x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
RenderTableCell {TD} at (0,77) size 52x2 [bgcolor=#008000] [r=0 c=1 rs=1 cs=1]
RenderTableRow {TR} at (0,52) size 52x104
RenderTableRow {TR} at (52,0) size 52x104
RenderTableCell {TD} at (52,25) size 52x2 [bgcolor=#008000] [r=1 c=0 rs=1 cs=1]
RenderTableCell {TD} at (52,77) size 52x2 [bgcolor=#008000] [r=1 c=1 rs=1 cs=1]
RenderTable {TABLE} at (10,228) size 104x104 [bgcolor=#FF0000]
Expand All @@ -32,6 +32,6 @@ layer at (0,0) size 800x466
RenderTableRow {TR} at (0,0) size 52x104
RenderTableCell {TD} at (0,25) size 52x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
RenderTableCell {TD} at (0,77) size 52x2 [bgcolor=#008000] [r=0 c=1 rs=1 cs=1]
RenderTableRow {TR} at (0,52) size 52x104
RenderTableRow {TR} at (52,0) size 52x104
RenderTableCell {TD} at (52,25) size 52x2 [bgcolor=#008000] [r=1 c=0 rs=1 cs=1]
RenderTableCell {TD} at (52,77) size 52x2 [bgcolor=#008000] [r=1 c=1 rs=1 cs=1]
4 changes: 2 additions & 2 deletions LayoutTests/fast/repaint/table-writing-modes-v-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ layer at (0,0) size 800x466
RenderTableRow {TR} at (0,0) size 52x104
RenderTableCell {TD} at (0,25) size 52x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
RenderTableCell {TD} at (0,77) size 52x2 [bgcolor=#008000] [r=0 c=1 rs=1 cs=1]
RenderTableRow {TR} at (0,52) size 52x104
RenderTableRow {TR} at (52,0) size 52x104
RenderTableCell {TD} at (52,25) size 52x2 [bgcolor=#008000] [r=1 c=0 rs=1 cs=1]
RenderTableCell {TD} at (52,77) size 52x2 [bgcolor=#008000] [r=1 c=1 rs=1 cs=1]
RenderTable {TABLE} at (10,228) size 104x104 [bgcolor=#FF0000]
Expand All @@ -32,6 +32,6 @@ layer at (0,0) size 800x466
RenderTableRow {TR} at (0,0) size 52x104
RenderTableCell {TD} at (0,25) size 52x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
RenderTableCell {TD} at (0,77) size 52x2 [bgcolor=#008000] [r=0 c=1 rs=1 cs=1]
RenderTableRow {TR} at (0,52) size 52x104
RenderTableRow {TR} at (52,0) size 52x104
RenderTableCell {TD} at (52,25) size 52x2 [bgcolor=#008000] [r=1 c=0 rs=1 cs=1]
RenderTableCell {TD} at (52,77) size 52x2 [bgcolor=#008000] [r=1 c=1 rs=1 cs=1]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1e62e8a

Please sign in to comment.