Commit 7746786d authored by bdash's avatar bdash
Browse files

2007-05-19 Mitz Pettel <mitz@webkit.org>

        Reviewed by Darin.

        - fix http://bugs.webkit.org/show_bug.cgi?id=13774
          REGRESSION: Crash emailing blog entry using Google Reader

        Test: fast/table/stale-grid-crash.html

        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::recalcSections): Made const and replaced
        setNeedsLayout(true) with an assertion that the table is already
        marked for layout.
        (WebCore::RenderTable::sectionAbove): Added call to recalcSectionsIfNeeded().
        (WebCore::RenderTable::sectionBelow): Ditto.
        (WebCore::RenderTable::cellAbove): Ditto.
        (WebCore::RenderTable::cellBelow): Ditto.
        (WebCore::RenderTable::cellBefore): Ditto.
        (WebCore::RenderTable::cellAfter): Ditto.
        * rendering/RenderTable.h:
        Made some private member variables which are used in section recalc mutable.
        (WebCore::RenderTable::setNeedsSectionRecalc): Moved the call to
        setNeedsLayout() from recalcSections() into here, because I made
        recalcSections() const.
        (WebCore::RenderTable::recalcSectionsIfNeeded): Made const.

2007-05-19  Mitz Pettel  <mitz@webkit.org>

        Reviewed by Darin.

        - test for http://bugs.webkit.org/show_bug.cgi?id=13774
          REGRESSION: Crash emailing blog entry using Google Reader

        * fast/table/stale-grid-crash-expected.checksum: Added.
        * fast/table/stale-grid-crash-expected.png: Added.
        * fast/table/stale-grid-crash-expected.txt: Added.
        * fast/table/stale-grid-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 71b3ce0c
2007-05-19 Mitz Pettel <mitz@webkit.org>
Reviewed by Darin.
- test for http://bugs.webkit.org/show_bug.cgi?id=13774
REGRESSION: Crash emailing blog entry using Google Reader
* fast/table/stale-grid-crash-expected.checksum: Added.
* fast/table/stale-grid-crash-expected.png: Added.
* fast/table/stale-grid-crash-expected.txt: Added.
* fast/table/stale-grid-crash.html: Added.
2007-05-19 Mitz Pettel <mitz@webkit.org>
 
Reviewed by Darin.
9c6cddd940261c182d2246244228ffb6
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 53x18
text run at (0,0) width 53: "Test for "
RenderInline {I} at (0,0) size 715x18
RenderInline {A} at (0,0) size 301x18 [color=#0000EE]
RenderText {#text} at (53,0) size 301x18
text run at (53,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=13774"
RenderText {#text} at (354,0) size 414x18
text run at (354,0) width 4: " "
text run at (358,0) width 410: "REGRESSION: Crash emailing blog entry using Google Reader"
RenderText {#text} at (768,0) size 4x18
text run at (768,0) width 4: "."
RenderBlock {P} at (0,34) size 784x18
RenderText {#text} at (0,0) size 71x18
text run at (0,0) width 71: "SUCCESS"
RenderBlock (anonymous) at (0,68) size 784x1
RenderImage {IMG} at (0,0) size 1x1
RenderText {#text} at (0,0) size 0x0
RenderTable {TABLE} at (0,69) size 2x2
RenderTableSection {TBODY} at (0,0) size 2x2
RenderTableRow {TR} at (0,0) size 2x0
RenderTableRow {TR} at (0,0) size 2x2
RenderTableCell {TD} at (0,0) size 2x2 [r=1 c=0 rs=1 cs=1]
<head>
<title></title>
<script>
if (window.layoutTestController)
layoutTestController.waitUntilDone();
function test()
{
document.getElementById("topCell").style.display = "none";
document.getElementById("bottomCell").style.backgroundImage="url(../replaced/resources/1x1-green.png)";
document.getElementById("result").innerText = "SUCCESS"
if (window.layoutTestController)
layoutTestController.notifyDone();
}
</script>
</head>
<body>
<p>
Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=13774">http://bugs.webkit.org/show_bug.cgi?id=13774</a>
REGRESSION: Crash emailing blog entry using Google Reader</i>.
</p>
<p id="result">
FAIL (test did not complete)
</p>
<img src="../replaced/resources/1x1-green.png" onload="test()">
<table style="border-collapse: collapse;">
<tbody>
<tr>
<td id="topCell"></td>
</tr>
<tr>
<td id="bottomCell"></td>
</tr>
</tbody>
</table>
</body>
2007-05-19 Mitz Pettel <mitz@webkit.org>
Reviewed by Darin.
- fix http://bugs.webkit.org/show_bug.cgi?id=13774
REGRESSION: Crash emailing blog entry using Google Reader
Test: fast/table/stale-grid-crash.html
* rendering/RenderTable.cpp:
(WebCore::RenderTable::recalcSections): Made const and replaced
setNeedsLayout(true) with an assertion that the table is already
marked for layout.
(WebCore::RenderTable::sectionAbove): Added call to recalcSectionsIfNeeded().
(WebCore::RenderTable::sectionBelow): Ditto.
(WebCore::RenderTable::cellAbove): Ditto.
(WebCore::RenderTable::cellBelow): Ditto.
(WebCore::RenderTable::cellBefore): Ditto.
(WebCore::RenderTable::cellAfter): Ditto.
* rendering/RenderTable.h:
Made some private member variables which are used in section recalc mutable.
(WebCore::RenderTable::setNeedsSectionRecalc): Moved the call to
setNeedsLayout() from recalcSections() into here, because I made
recalcSections() const.
(WebCore::RenderTable::recalcSectionsIfNeeded): Made const.
2007-05-19 Mitz Pettel <mitz@webkit.org>
 
Reviewed by Darin.
......@@ -602,7 +602,7 @@ RenderTableCol* RenderTable::colElement(int col) const
return 0;
}
void RenderTable::recalcSections()
void RenderTable::recalcSections() const
{
m_caption = 0;
m_head = 0;
......@@ -669,9 +669,10 @@ void RenderTable::recalcSections()
m_columns.resize(maxCols);
m_columnPos.resize(maxCols + 1);
ASSERT(selfNeedsLayout());
m_needsSectionRecalc = false;
setNeedsLayout(true);
}
RenderObject* RenderTable::removeChildNode(RenderObject* child, bool fullRemove)
......@@ -934,8 +935,11 @@ int RenderTable::outerBorderRight() const
RenderTableSection* RenderTable::sectionAbove(const RenderTableSection* section, bool skipEmptySections) const
{
recalcSectionsIfNeeded();
if (section == m_head)
return 0;
RenderObject* prevSection = section == m_foot ? lastChild() : section->previousSibling();
while (prevSection) {
if (prevSection->isTableSection() && prevSection != m_head && prevSection != m_foot && (!skipEmptySections || static_cast<RenderTableSection*>(prevSection)->numRows()))
......@@ -949,8 +953,11 @@ RenderTableSection* RenderTable::sectionAbove(const RenderTableSection* section,
RenderTableSection* RenderTable::sectionBelow(const RenderTableSection* section, bool skipEmptySections) const
{
recalcSectionsIfNeeded();
if (section == m_foot)
return 0;
RenderObject* nextSection = section == m_head ? firstChild() : section->nextSibling();
while (nextSection) {
if (nextSection->isTableSection() && nextSection != m_head && nextSection != m_foot && (!skipEmptySections || static_cast<RenderTableSection*>(nextSection)->numRows()))
......@@ -964,6 +971,8 @@ RenderTableSection* RenderTable::sectionBelow(const RenderTableSection* section,
RenderTableCell* RenderTable::cellAbove(const RenderTableCell* cell) const
{
recalcSectionsIfNeeded();
// Find the section and row to look in
int r = cell->row();
RenderTableSection* section = 0;
......@@ -994,6 +1003,8 @@ RenderTableCell* RenderTable::cellAbove(const RenderTableCell* cell) const
RenderTableCell* RenderTable::cellBelow(const RenderTableCell* cell) const
{
recalcSectionsIfNeeded();
// Find the section and row to look in
int r = cell->row() + cell->rowSpan() - 1;
RenderTableSection* section = 0;
......@@ -1024,6 +1035,8 @@ RenderTableCell* RenderTable::cellBelow(const RenderTableCell* cell) const
RenderTableCell* RenderTable::cellBefore(const RenderTableCell* cell) const
{
recalcSectionsIfNeeded();
RenderTableSection* section = cell->section();
int effCol = colToEffCol(cell->col());
if (!effCol)
......@@ -1040,6 +1053,8 @@ RenderTableCell* RenderTable::cellBefore(const RenderTableCell* cell) const
RenderTableCell* RenderTable::cellAfter(const RenderTableCell* cell) const
{
recalcSectionsIfNeeded();
int effCol = colToEffCol(cell->col() + cell->colSpan());
if (effCol >= numEffCols())
return 0;
......
......@@ -163,7 +163,13 @@ public:
RenderTableCol* colElement(int col) const;
bool needsSectionRecalc() const { return m_needsSectionRecalc; }
void setNeedsSectionRecalc() { m_needsSectionRecalc = true; }
void setNeedsSectionRecalc()
{
if (documentBeingDestroyed())
return;
m_needsSectionRecalc = true;
setNeedsLayout(true);
}
virtual RenderObject* removeChildNode(RenderObject*, bool fullRemove = true);
......@@ -181,7 +187,7 @@ public:
virtual IntRect getOverflowClipRect(int tx, int ty);
void recalcSectionsIfNeeded()
void recalcSectionsIfNeeded() const
{
if (m_needsSectionRecalc)
recalcSections();
......@@ -192,15 +198,15 @@ public:
#endif
private:
void recalcSections();
void recalcSections() const;
Vector<int> m_columnPos;
Vector<ColumnStruct> m_columns;
mutable Vector<int> m_columnPos;
mutable Vector<ColumnStruct> m_columns;
RenderBlock* m_caption;
RenderTableSection* m_head;
RenderTableSection* m_foot;
RenderTableSection* m_firstBody;
mutable RenderBlock* m_caption;
mutable RenderTableSection* m_head;
mutable RenderTableSection* m_foot;
mutable RenderTableSection* m_firstBody;
TableLayout* m_tableLayout;
......@@ -209,9 +215,9 @@ private:
unsigned m_frame : 4; // Frame
unsigned m_rules : 4; // Rules
bool m_hasColElements : 1;
mutable bool m_hasColElements : 1;
unsigned m_padding : 22;
bool m_needsSectionRecalc : 1;
mutable bool m_needsSectionRecalc : 1;
short m_hSpacing;
short m_vSpacing;
......
Supports Markdown
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