Commit 372ce0de authored by inferno@chromium.org's avatar inferno@chromium.org

2011-01-27 Abhishek Arya <inferno@chromium.org>

        Reviewed by Dan Bernstein.

        Recalc table sections if needed before calculating the first line
        box baseline.
        https://bugs.webkit.org/show_bug.cgi?id=53265

        When we try to calculate the baseline position of a table cell,
        we recurse through all the child sibling boxes (when children are
        non inline) and add their first linebox baseline values. If one of
        the children is a table with pending section recalc, we will access
        wrong table section values. We recalc table sections if it is needed.

        Test: fast/table/recalc-section-first-body-crash-main.html

        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::firstLineBoxBaseline):
2011-01-27  Abhishek Arya  <inferno@chromium.org>

        Reviewed by Dan Bernstein.

        Tests that we do not crash when calculating the first line box
        baseline for the table.
        https://bugs.webkit.org/show_bug.cgi?id=53265

        * fast/table/recalc-section-first-body-crash-main-expected.txt: Added.
        * fast/table/recalc-section-first-body-crash-main.html: Added.
        * fast/table/resources/recalc-section-first-body-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76915 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6b5bce9e
2011-01-27 Abhishek Arya <inferno@chromium.org>
Reviewed by Dan Bernstein.
Tests that we do not crash when calculating the first line box
baseline for the table.
https://bugs.webkit.org/show_bug.cgi?id=53265
* fast/table/recalc-section-first-body-crash-main-expected.txt: Added.
* fast/table/recalc-section-first-body-crash-main.html: Added.
* fast/table/resources/recalc-section-first-body-crash.html: Added.
2011-01-27 Ryosuke Niwa <rniwa@webkit.org>
Unreviewed, rolling out r76839.
<html>
<body>
PASS
<iframe width="0" height="0" src="resources/recalc-section-first-body-crash.html"></iframe>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
</body>
</html>
<html>
<body onload="runTest();">
<junk>a</junk>
<junk>a</junk>
<junk id="test1" style="display: -webkit-box; visibility: collapse;">
<iframe>a</iframe><junk style="display: table-row-group;">a</junk>
</junk>
<div>a</div><junk></junk>
<div id="test2" style="display: table-cell;"></div>
<script type="text/javascript">
function reference(domNode)
{
this.domNode = domNode;
}
function walk(arr, currentPrefix, index, domNode)
{
if (domNode == null)
return;
newPrefix = currentPrefix + "_" + index;
walk(arr, currentPrefix, index + 1, domNode.nextSibling);
walk(arr, newPrefix, 0, domNode.firstChild);
arr[newPrefix] = new reference(domNode);
}
function removeAll()
{
var arr = new Array();
walk(arr, "", 0, document.body);
for (key in arr) {
arr[key].domNode.parentNode.removeChild(arr[key].domNode);
if (document.body)
document.body.offsetTop;
}
}
function runTest()
{
var test1 = document.getElementById('test1');
test1.parentNode.removeChild(test1);
var test2 = document.getElementById('test2');
test2.appendChild(test1);
removeAll();
}
</script>
</body>
</html>
2011-01-27 Abhishek Arya <inferno@chromium.org>
Reviewed by Dan Bernstein.
Recalc table sections if needed before calculating the first line
box baseline.
https://bugs.webkit.org/show_bug.cgi?id=53265
When we try to calculate the baseline position of a table cell,
we recurse through all the child sibling boxes (when children are
non inline) and add their first linebox baseline values. If one of
the children is a table with pending section recalc, we will access
wrong table section values. We recalc table sections if it is needed.
Test: fast/table/recalc-section-first-body-crash-main.html
* rendering/RenderTable.cpp:
(WebCore::RenderTable::firstLineBoxBaseline):
2011-01-27 Adrienne Walker <enne@google.com>
Reviewed by Kenneth Russell.
......@@ -1126,6 +1126,8 @@ int RenderTable::firstLineBoxBaseline() const
if (isWritingModeRoot())
return -1;
recalcSectionsIfNeeded();
RenderTableSection* firstNonEmptySection = m_head ? m_head : (m_firstBody ? m_firstBody : m_foot);
if (firstNonEmptySection && !firstNonEmptySection->numRows())
firstNonEmptySection = sectionBelow(firstNonEmptySection, true);
......
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