Changeset 259296 in webkit
- Timestamp:
- Mar 31, 2020, 10:03:58 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 16 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/table/anonymous-colgroup-simple-expected.txt (added)
-
LayoutTests/fast/table/anonymous-colgroup-simple.html (added)
-
LayoutTests/fast/table/table-insert-before-non-anonymous-block-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios-wk1/fast/table/table-insert-before-non-anonymous-block-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios/css2.1/20110323/margin-applies-to-006-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios/fast/forms/form-hides-table-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios/ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-012-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios/tables/mozilla_expected_failures/dom/appendCol1-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac/css2.1/20110323/margin-applies-to-006-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac/fast/forms/form-hides-table-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac/fast/table/table-insert-before-non-anonymous-block-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-012-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac/tables/mozilla_expected_failures/dom/appendCol1-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderTableCol.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderTableCol.h (modified) (1 diff)
-
Source/WebCore/rendering/updating/RenderTreeBuilderTable.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r259294 r259296 1 2020-03-31 Zalan Bujtas <zalan@apple.com> 2 3 [Tables] Infinite recursion in RenderTreeBuilder::attach 4 https://bugs.webkit.org/show_bug.cgi?id=209771 5 <rdar://problem/59923112> 6 7 Reviewed by Simon Fraser. 8 9 * fast/table/anonymous-colgroup-simple-expected.txt: Added. 10 * fast/table/anonymous-colgroup-simple.html: Added. 11 1 12 2020-03-31 Jason Lawrence <lawrence.j@apple.com> 2 13 -
trunk/LayoutTests/fast/table/table-insert-before-non-anonymous-block-expected.txt
r97074 r259296 39 39 RenderTableCell {DIV} at (0,0) size 50x0 [bgcolor=#0000FF] [r=0 c=0 rs=1 cs=1] 40 40 RenderTableCell {DIV} at (50,0) size 50x0 [bgcolor=#0000FF] [r=0 c=1 rs=1 cs=1] 41 RenderTableCol {DIV} at (0,0) size 0x0 41 RenderTableCol at (0,0) size 0x0 42 RenderTableCol {DIV} at (0,0) size 0x0 42 43 RenderTable {DIV} at (0,300) size 101x50 43 44 RenderTableSection (anonymous) at (0,0) size 101x50 -
trunk/LayoutTests/platform/ios-wk1/fast/table/table-insert-before-non-anonymous-block-expected.txt
r204944 r259296 39 39 RenderTableCell {DIV} at (0,0) size 50x0 [bgcolor=#0000FF] [r=0 c=0 rs=1 cs=1] 40 40 RenderTableCell {DIV} at (50,0) size 50x0 [bgcolor=#0000FF] [r=0 c=1 rs=1 cs=1] 41 RenderTableCol {DIV} at (0,0) size 0x0 41 RenderTableCol at (0,0) size 0x0 42 RenderTableCol {DIV} at (0,0) size 0x0 42 43 RenderTable {DIV} at (0,300) size 101x50 43 44 RenderTableSection (anonymous) at (0,0) size 101x50 -
trunk/LayoutTests/platform/ios/css2.1/20110323/margin-applies-to-006-expected.txt
r195740 r259296 10 10 RenderBlock (positioned) {DIV} at (8,52) size 240x240 [border: (10px solid #0000FF)] 11 11 RenderTable {DIV} at (10,10) size 220x220 12 RenderTableCol {DIV} at (0,0) size 0x0 12 RenderTableCol at (0,0) size 0x0 13 RenderTableCol {DIV} at (0,0) size 0x0 13 14 RenderTableSection (anonymous) at (0,0) size 220x220 14 15 RenderTableRow {DIV} at (0,0) size 220x220 -
trunk/LayoutTests/platform/ios/fast/forms/form-hides-table-expected.txt
r195740 r259296 143 143 RenderBlock {DIV} at (0,554) size 784x0 144 144 RenderTable at (0,0) size 0x0 145 RenderTableCol {DIV} at (0,0) size 0x0 145 RenderTableCol at (0,0) size 0x0 146 RenderTableCol {DIV} at (0,0) size 0x0 146 147 RenderBlock {DIV} at (0,554) size 784x42 147 148 RenderTable at (0,0) size 121x42 -
trunk/LayoutTests/platform/ios/ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-012-expected.txt
r197635 r259296 8 8 text run at (0,0) width 417: "Test passes if there is a box with sharp or rounded corners below." 9 9 RenderTable {DIV} at (0,36) size 102x102 [border: (1.50px none #000000)] 10 RenderTableCol {DIV} at (0,0) size 0x0 [border: (3px solid #008000)] 10 RenderTableCol at (0,0) size 0x0 11 RenderTableCol {DIV} at (0,0) size 0x0 [border: (3px solid #008000)] 11 12 RenderTableSection (anonymous) at (1,1) size 100x100 12 13 RenderTableRow {DIV} at (0,0) size 99x99 -
trunk/LayoutTests/platform/ios/tables/mozilla_expected_failures/dom/appendCol1-expected.txt
r191623 r259296 18 18 RenderText {#text} at (2,2) size 24x19 19 19 text run at (2,2) width 24: "c12" 20 RenderTableCol {COL} at (0,0) size 0x0 20 RenderTableCol at (0,0) size 0x0 21 RenderTableCol {COL} at (0,0) size 0x0 21 22 RenderBlock (anonymous) at (0,50) size 784x20 22 23 RenderBR {BR} at (0,0) size 0x19 -
trunk/LayoutTests/platform/mac/css2.1/20110323/margin-applies-to-006-expected.txt
r195740 r259296 10 10 RenderBlock (positioned) {DIV} at (8,50) size 240x240 [border: (10px solid #0000FF)] 11 11 RenderTable {DIV} at (10,10) size 220x220 12 RenderTableCol {DIV} at (0,0) size 0x0 12 RenderTableCol at (0,0) size 0x0 13 RenderTableCol {DIV} at (0,0) size 0x0 13 14 RenderTableSection (anonymous) at (0,0) size 220x220 14 15 RenderTableRow {DIV} at (0,0) size 220x220 -
trunk/LayoutTests/platform/mac/fast/forms/form-hides-table-expected.txt
r195740 r259296 143 143 RenderBlock {DIV} at (0,526) size 769x0 144 144 RenderTable at (0,0) size 0x0 145 RenderTableCol {DIV} at (0,0) size 0x0 145 RenderTableCol at (0,0) size 0x0 146 RenderTableCol {DIV} at (0,0) size 0x0 146 147 RenderBlock {DIV} at (0,526) size 769x40 147 148 RenderTable at (0,0) size 121x40 -
trunk/LayoutTests/platform/mac/fast/table/table-insert-before-non-anonymous-block-expected.txt
r195740 r259296 39 39 RenderTableCell {DIV} at (0,0) size 50x0 [bgcolor=#0000FF] [r=0 c=0 rs=1 cs=1] 40 40 RenderTableCell {DIV} at (50,0) size 50x0 [bgcolor=#0000FF] [r=0 c=1 rs=1 cs=1] 41 RenderTableCol {DIV} at (0,0) size 0x0 41 RenderTableCol at (0,0) size 0x0 42 RenderTableCol {DIV} at (0,0) size 0x0 42 43 RenderTable {DIV} at (0,300) size 101x50 43 44 RenderTableSection (anonymous) at (0,0) size 101x50 -
trunk/LayoutTests/platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-012-expected.txt
r195740 r259296 8 8 text run at (0,0) width 417: "Test passes if there is a box with sharp or rounded corners below." 9 9 RenderTable {DIV} at (0,34) size 102x102 [border: (1px none #000000)] 10 RenderTableCol {DIV} at (0,0) size 0x0 [border: (3px solid #008000)] 10 RenderTableCol at (0,0) size 0x0 11 RenderTableCol {DIV} at (0,0) size 0x0 [border: (3px solid #008000)] 11 12 RenderTableSection (anonymous) at (1,1) size 99x99 12 13 RenderTableRow {DIV} at (0,0) size 99x99 -
trunk/LayoutTests/platform/mac/tables/mozilla_expected_failures/dom/appendCol1-expected.txt
r191623 r259296 18 18 RenderText {#text} at (2,2) size 24x18 19 19 text run at (2,2) width 24: "c12" 20 RenderTableCol {COL} at (0,0) size 0x0 20 RenderTableCol at (0,0) size 0x0 21 RenderTableCol {COL} at (0,0) size 0x0 21 22 RenderBlock (anonymous) at (0,46) size 784x18 22 23 RenderBR {BR} at (0,0) size 0x18 -
trunk/Source/WebCore/ChangeLog
r259290 r259296 1 2020-03-31 Zalan Bujtas <zalan@apple.com> 2 3 [Tables] Infinite recursion in RenderTreeBuilder::attach 4 https://bugs.webkit.org/show_bug.cgi?id=209771 5 <rdar://problem/59923112> 6 7 Reviewed by Simon Fraser. 8 9 Let's construct a COLGROUP wrapper when a COL element is inserted into a <table>. The rest of the table code assumes such structure. 10 (https://www.w3.org/TR/html52/tabular-data.html#the-col-element) 11 12 Test: fast/table/anonymous-colgroup-simple.html 13 14 * rendering/RenderTableCol.cpp: 15 (WebCore::RenderTableCol::RenderTableCol): 16 (WebCore::RenderTableCol::updateFromElement): 17 * rendering/RenderTableCol.h: 18 * rendering/updating/RenderTreeBuilderTable.cpp: 19 (WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild): 20 1 21 2020-03-31 youenn fablet <youenn@apple.com> 2 22 -
trunk/Source/WebCore/rendering/RenderTableCol.cpp
r232178 r259296 50 50 } 51 51 52 RenderTableCol::RenderTableCol(Document& document, RenderStyle&& style) 53 : RenderBox(document, WTFMove(style), 0) 54 { 55 setInline(true); 56 } 57 52 58 void RenderTableCol::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) 53 59 { … … 78 84 void RenderTableCol::updateFromElement() 79 85 { 86 ASSERT(element()); 80 87 unsigned oldSpan = m_span; 81 if (element() .hasTagName(colTag) || element().hasTagName(colgroupTag)) {82 HTMLTableColElement& tc = static_cast<HTMLTableColElement&>( element());88 if (element()->hasTagName(colTag) || element()->hasTagName(colgroupTag)) { 89 HTMLTableColElement& tc = static_cast<HTMLTableColElement&>(*element()); 83 90 m_span = tc.span(); 84 91 } else -
trunk/Source/WebCore/rendering/RenderTableCol.h
r232178 r259296 37 37 public: 38 38 RenderTableCol(Element&, RenderStyle&&); 39 Element& element() const { return downcast<Element>(nodeForNonAnonymous()); }39 RenderTableCol(Document&, RenderStyle&&); 40 40 41 41 void clearPreferredLogicalWidthsDirtyBits(); -
trunk/Source/WebCore/rendering/updating/RenderTreeBuilderTable.cpp
r256089 r259296 53 53 } 54 54 55 auto createAnonymousTableCell = [&] (auto& parent) -> RenderTableCell& { 56 auto newCell = RenderTableCell::createAnonymousWithParentRenderer(parent); 57 auto& cell = *newCell; 58 m_builder.attach(parent, WTFMove(newCell), beforeChild); 59 beforeChild = nullptr; 60 return cell; 61 }; 62 55 63 auto* lastChild = beforeChild ? beforeChild : parent.lastCell(); 56 64 if (lastChild) { … … 64 72 if (auto* lastChildParent = lastChild->parent()) { 65 73 if (lastChildParent->isAnonymous() && !lastChildParent->isBeforeOrAfterContent()) { 74 // If beforeChild is inside an anonymous COLGROUP, create a cell for the new renderer. 75 if (is<RenderTableCol>(*lastChildParent)) 76 return createAnonymousTableCell(parent); 66 77 // If beforeChild is inside an anonymous cell, insert into the cell. 67 78 if (!is<RenderTableCell>(*lastChild)) 68 79 return *lastChildParent; 69 80 // If beforeChild is inside an anonymous row, insert into the row. 70 if (is<RenderTableRow>(*lastChildParent)) { 71 auto newCell = RenderTableCell::createAnonymousWithParentRenderer(parent); 72 auto& cell = *newCell; 73 m_builder.attach(*lastChildParent, WTFMove(newCell), beforeChild); 74 beforeChild = nullptr; 75 return cell; 76 } 81 if (is<RenderTableRow>(*lastChildParent)) 82 return createAnonymousTableCell(downcast<RenderTableRow>(*lastChildParent)); 77 83 } 78 84 } 79 85 } 80 auto newCell = RenderTableCell::createAnonymousWithParentRenderer(parent); 81 auto& cell = *newCell; 82 m_builder.attach(parent, WTFMove(newCell), beforeChild); 83 beforeChild = nullptr; 84 return cell; 86 return createAnonymousTableCell(parent); 85 87 } 86 88 … … 122 124 RenderElement& RenderTreeBuilder::Table::findOrCreateParentForChild(RenderTable& parent, const RenderObject& child, RenderObject*& beforeChild) 123 125 { 124 if (is<RenderTableCaption>(child) || is<RenderTable Col>(child) || is<RenderTableSection>(child))126 if (is<RenderTableCaption>(child) || is<RenderTableSection>(child)) 125 127 return parent; 128 129 if (is<RenderTableCol>(child)) { 130 if (!child.node() || child.style().display() == DisplayType::TableColumnGroup) { 131 // COLGROUPs and anonymous RenderTableCols (generated wrappers for COLs) are direct children of the table renderer. 132 return parent; 133 } 134 auto newColGroup = createRenderer<RenderTableCol>(parent.document(), RenderStyle::createAnonymousStyleWithDisplay(parent.style(), DisplayType::TableColumnGroup)); 135 newColGroup->initializeStyle(); 136 auto& colGroup = *newColGroup; 137 m_builder.attach(parent, WTFMove(newColGroup), beforeChild); 138 beforeChild = nullptr; 139 return colGroup; 140 } 126 141 127 142 auto* lastChild = parent.lastChild(); … … 144 159 parentCandidate = parentCandidate->parent(); 145 160 146 if (parentCandidate && is<RenderTableSection>(*parentCandidate) && parentCandidate->isAnonymous() && !parent.isAfterContent(parentCandidate)) { 147 if (beforeChild == parentCandidate) 148 beforeChild = downcast<RenderTableSection>(*parentCandidate).firstRow(); 149 return downcast<RenderElement>(*parentCandidate); 161 if (parentCandidate) { 162 if (beforeChild && !beforeChild->isAnonymous() && parentCandidate->parent() == &parent) { 163 auto* section = parentCandidate->previousSibling(); 164 if (is<RenderTableSection>(section) && section->isAnonymous()) { 165 beforeChild = nullptr; 166 return downcast<RenderElement>(*section); 167 } 168 } 169 170 if (is<RenderTableSection>(*parentCandidate) && parentCandidate->isAnonymous() && !parent.isAfterContent(parentCandidate)) { 171 if (beforeChild == parentCandidate) 172 beforeChild = downcast<RenderTableSection>(*parentCandidate).firstRow(); 173 return downcast<RenderElement>(*parentCandidate); 174 } 150 175 } 151 176
Note:
See TracChangeset
for help on using the changeset viewer.