⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 207974 in webkit


Ignore:
Timestamp:
Oct 27, 2016, 3:06:45 AM (10 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r207547 - Use anonymous table row for new child at RenderTableRow::addChild() if available.
​https://bugs.webkit.org/show_bug.cgi?id=163651
<rdar://problem/28705022>

Reviewed by David Hyatt.

Source/WebCore:

We should try to prevent the continuation siblings from getting separated and inserted into
wrapper renderers. It makes finding these continuation siblings difficult.
This patch adds a checks for anonymous table rows so that we could find a closer common ancestor of
beforeChild/new child.

Test: fast/table/crash-when-table-has-continuation-and-content-inserted.html

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::showRenderObject): Add continuation information.

  • rendering/RenderTableRow.cpp:

(WebCore::RenderTableRow::addChild):

LayoutTests:

  • fast/table/crash-when-table-has-continuation-and-content-inserted-expected.txt: Added.
  • fast/table/crash-when-table-has-continuation-and-content-inserted.html: Added.
Location:
releases/WebKitGTK/webkit-2.14
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog

    r207971 r207974  
     12016-10-19  Zalan Bujtas  <zalan@apple.com>
     2
     3        Use anonymous table row for new child at RenderTableRow::addChild() if available.
     4        https://bugs.webkit.org/show_bug.cgi?id=163651
     5        <rdar://problem/28705022>
     6
     7        Reviewed by David Hyatt.
     8
     9        * fast/table/crash-when-table-has-continuation-and-content-inserted-expected.txt: Added.
     10        * fast/table/crash-when-table-has-continuation-and-content-inserted.html: Added.
     11
    1122016-10-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
    213
  • releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog

    r207972 r207974  
     12016-10-19  Zalan Bujtas  <zalan@apple.com>
     2
     3        Use anonymous table row for new child at RenderTableRow::addChild() if available.
     4        https://bugs.webkit.org/show_bug.cgi?id=163651
     5        <rdar://problem/28705022>
     6
     7        Reviewed by David Hyatt.
     8
     9        We should try to prevent the continuation siblings from getting separated and inserted into
     10        wrapper renderers. It makes finding these continuation siblings difficult.
     11        This patch adds a checks for anonymous table rows so that we could find a closer common ancestor of
     12        beforeChild/new child.
     13
     14        Test: fast/table/crash-when-table-has-continuation-and-content-inserted.html
     15
     16        * rendering/RenderObject.cpp:
     17        (WebCore::RenderObject::showRenderObject): Add continuation information.
     18        * rendering/RenderTableRow.cpp:
     19        (WebCore::RenderTableRow::addChild):
     20
    1212016-10-18  Brent Fulgham  <bfulgham@apple.com>
    222
  • releases/WebKitGTK/webkit-2.14/Source/WebCore/rendering/RenderObject.cpp

    r207074 r207974  
    11451145        }
    11461146    }
    1147 
     1147    if (is<RenderBoxModelObject>(*this)) {
     1148        auto& renderer = downcast<RenderBoxModelObject>(*this);
     1149        if (renderer.hasContinuation())
     1150            fprintf(stderr, " continuation->(%p)", renderer.continuation());
     1151    }
    11481152    showRegionsInformation();
    11491153    fprintf(stderr, "\n");
  • releases/WebKitGTK/webkit-2.14/Source/WebCore/rendering/RenderTableRow.cpp

    r203708 r207974  
    129129        }
    130130
    131         // If beforeChild is inside an anonymous cell, insert into the cell.
    132         if (last && !is<RenderTableCell>(*last) && last->parent() && last->parent()->isAnonymous() && !last->parent()->isBeforeOrAfterContent()) {
    133             last->parent()->addChild(child, beforeChild);
    134             return;
    135         }
    136 
     131        // Try to find an anonymous container for the child.
     132        if (last && last->parent() && last->parent()->isAnonymous() && !last->parent()->isBeforeOrAfterContent()) {
     133            // If beforeChild is inside an anonymous cell, insert into the cell.
     134            if (!is<RenderTableCell>(*last)) {
     135                last->parent()->addChild(child, beforeChild);
     136                return;
     137            }
     138            // If beforeChild is inside an anonymous row, insert into the row.
     139            auto& parent = *last->parent();
     140            if (is<RenderTableRow>(parent)) {
     141                auto* cell = RenderTableCell::createAnonymousWithParentRenderer(*this).release();
     142                parent.addChild(cell, beforeChild);
     143                cell->addChild(child);
     144                return;
     145            }
     146        }
    137147        auto* cell = RenderTableCell::createAnonymousWithParentRenderer(*this).release();
    138148        addChild(cell, beforeChild);
Note: See TracChangeset for help on using the changeset viewer.