Commit f9766b13 authored by robert@webkit.org's avatar robert@webkit.org

cell width / offsetTop incorrect

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

Reviewed by David Hyatt.

Source/WebCore:

The offsetTop and offsetLeft of sections, rows and cells should include the table's border. There are separate
problems with the offset[Top|Left] of table sections and the offsetLeft of rows which are covered under bugs 119020
and 119021 respectively - here we stick to just fixing the inclusion of the border as it doesn't require rebaselining
a lot of tests.

Test: fast/table/offset-top-includes-border.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::layoutRows):

LayoutTests:

* fast/dom/Element/offsetTop-table-cell-expected.txt:
* fast/dom/Element/offsetTop-table-cell.html:
* fast/table/offset-top-includes-border-expected.txt: Added.
* fast/table/offset-top-includes-border.html: Added.
* platform/mac/editing/selection/5057506-2-expected.txt:
* platform/mac/editing/selection/5057506-expected.txt:
* platform/qt/editing/selection/5057506-2-expected.txt:
* platform/qt/editing/selection/5057506-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fb648092
2013-08-27 Robert Hogan <robert@webkit.org>
cell width / offsetTop incorrect
https://bugs.webkit.org/show_bug.cgi?id=11582
Reviewed by David Hyatt.
* fast/dom/Element/offsetTop-table-cell-expected.txt:
* fast/dom/Element/offsetTop-table-cell.html:
* fast/table/offset-top-includes-border-expected.txt: Added.
* fast/table/offset-top-includes-border.html: Added.
* platform/mac/editing/selection/5057506-2-expected.txt:
* platform/mac/editing/selection/5057506-expected.txt:
* platform/qt/editing/selection/5057506-2-expected.txt:
* platform/qt/editing/selection/5057506-expected.txt:
2013-08-27 Renata Hodovan <reni@webkit.org>
Missing null-check of parent renderer in WebCore::HTMLEmbedElement::rendererIsNeeded()
......@@ -2,10 +2,10 @@ This is a regression test for https://bugs.webkit.org/show_bug.cgi?id=8085 Main
Table 1 row 2 top offset:50
Table 1 cell 2 top offset:50
Table 2 row 1 top offset:0
Table 2 cell 1 top offset:0
Table 2 cell 2 top offset:0
Table 2 cell 3 top offset:0
Table 2 row 1 top offset:1
Table 2 cell 1 top offset:1
Table 2 cell 2 top offset:1
Table 2 cell 3 top offset:1
Table 3 cell 1 top offset:0
Table 4 div 1 top offset:50
Test result: PASS
......
......@@ -32,7 +32,7 @@ function test()
console.innerText += "Table 4 div 1 top offset:" + div5Offset;
console.innerText += "\n";
console.innerText += "Test result: "
console.innerText += (rowOffset == 50 && cellOffset == 50 && tr1Offset == 0
console.innerText += (rowOffset == 50 && cellOffset == 50 && tr1Offset == 1
&& tr1Offset == td2Offset && tr1Offset == td3Offset && td4Offset == 0 && div5Offset == 50 ? "PASS" : "FAIL");
}
</script>
......
webkit.org/b/11582: The offsetTop of tbody, rows and cells should include the table's border. The tbody should include border-spacing in its offsetTop and offsetLeft too but that is a separate and more involved bug (webkit.org/b/119020) which when it's resolved should change the offsets from 14 to 19 for the tbody in this test. The offsetLeft for the row is also wrong (webkit.org/b/119021), fixing it will require a lot of rebaselining.
PASS
<!DOCTYPE html>
<head>
<style>
body, td, tr, tbody {
margin: 0px;
padding: 4px;
border: solid black 4px;
}
table {
margin: 0px;
padding: 4px;
border-spacing: 5px;
}
</style>
<script src="../../resources/check-layout.js"></script>
</head>
<p>webkit.org/b/11582: The offsetTop of tbody, rows and cells should include the table's border. The tbody should include border-spacing in its
offsetTop and offsetLeft too but that is a separate and more involved bug (webkit.org/b/119020) which when it's resolved should change the
offsets from 14 to 19 for the tbody in this test. The offsetLeft for the row is also wrong (webkit.org/b/119021), fixing it will require a
lot of rebaselining.</p>
<body>
<table border="10">
<tbody data-offset-y=14 data-offset-x=14>
<tr data-offset-y=19 data-offset-x=14>
<td data-offset-y=19 data-offset-x=19>
</td>
</tr>
</tbody>
</table>
<script>
checkLayout('table');
</script>
</body>
ALERT: 34
ALERT: 108
ALERT: 35
ALERT: 109
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
......
ALERT: 34
ALERT: 108
ALERT: 35
ALERT: 109
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
......
ALERT: 33
ALERT: 112.5
ALERT: 34
ALERT: 113.5
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
......
ALERT: 33
ALERT: 112.5
ALERT: 34
ALERT: 113.5
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
......@@ -26,5 +26,5 @@ layer at (0,0) size 800x600
RenderBlock {DIV} at (0,29) size 784x19
RenderText {#text} at (0,0) size 20x19
text run at (0,0) width 20: "bar"
selection start: position 0 of child 0 {#text} of child 0 {SPAN} of child 0 {TD} of child 0 {TR} of child 0 {TBODY} of child 1 {TABLE} of child 2 {DIV} of body
selection start: position 3 of child 0 {#text} of child 0 {SPAN} of child 0 {TD} of child 0 {TR} of child 0 {TBODY} of child 1 {TABLE} of child 2 {DIV} of body
selection end: position 0 of child 3 {DIV} of child 2 {DIV} of body
2013-08-27 Robert Hogan <robert@webkit.org>
cell width / offsetTop incorrect
https://bugs.webkit.org/show_bug.cgi?id=11582
Reviewed by David Hyatt.
The offsetTop and offsetLeft of sections, rows and cells should include the table's border. There are separate
problems with the offset[Top|Left] of table sections and the offsetLeft of rows which are covered under bugs 119020
and 119021 respectively - here we stick to just fixing the inclusion of the border as it doesn't require rebaselining
a lot of tests.
Test: fast/table/offset-top-includes-border.html
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::layoutRows):
2013-08-27 Jacky Jiang <zhajiang@blackberry.com>
[BlackBerry] Rotate device from landscape to portrait during youtube streaming will cause device screen flash with video list page
......@@ -37,6 +37,7 @@
#include "RenderLayer.h"
#include "RenderNamedFlowThread.h"
#include "RenderRegion.h"
#include "RenderTable.h"
#include "RenderView.h"
#include "ScrollingConstraints.h"
#include "Settings.h"
......@@ -490,7 +491,7 @@ LayoutPoint RenderBoxModelObject::adjustedPositionRelativeToOffsetParent(const L
// return the distance between the canvas origin and the left border edge
// of the element and stop this algorithm.
if (const RenderBoxModelObject* offsetParent = this->offsetParent()) {
if (offsetParent->isBox() && !offsetParent->isBody())
if (offsetParent->isBox() && !offsetParent->isBody() && !offsetParent->isTable())
referencePoint.move(-toRenderBox(offsetParent)->borderLeft(), -toRenderBox(offsetParent)->borderTop());
if (!isOutOfFlowPositioned() || flowThreadContainingBlock()) {
if (isRelPositioned())
......
......@@ -524,6 +524,8 @@ void RenderTableSection::layoutRows()
for (unsigned r = 0; r < totalRows; r++) {
// Set the row's x/y position and width/height.
if (RenderTableRow* rowRenderer = m_grid[r].rowRenderer) {
// FIXME: the x() position of the row should be table()->hBorderSpacing() so that it can
// report the correct offsetLeft. However, that will require a lot of rebaselining of test results.
rowRenderer->setLocation(LayoutPoint(0, m_rowPos[r]));
rowRenderer->setLogicalWidth(logicalWidth());
rowRenderer->setLogicalHeight(m_rowPos[r + 1] - m_rowPos[r] - vspacing);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment