Changeset 117758 in webkit
- Timestamp:
- May 21, 2012, 3:48:21 AM (14 years ago)
- Location:
- releases/WebKitGTK/webkit-1.8
- Files:
-
- 17 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/chromium-mac-snowleopard/fast/css/bidi-override-in-anonymous-block-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/chromium-win/fast/css/bidi-override-in-anonymous-block-expected.txt (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderBlock.cpp (modified) (4 diffs)
-
Source/WebCore/rendering/RenderBlock.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderButton.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderObject.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderObject.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderTable.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderTable.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderTableCell.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderTableCell.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderTableRow.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderTableRow.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderTableSection.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderTableSection.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-1.8/LayoutTests/ChangeLog
r117757 r117758 1 2012-04-04 Abhishek Arya <inferno@chromium.org> 2 3 Add helpers to create anonymous table parts. 4 https://bugs.webkit.org/show_bug.cgi?id=83116 5 6 Reviewed by Julien Chaffraix. 7 8 Rebaselining tests because we now correctly inherit the bidi override. 9 10 * platform/chromium-mac/fast/css/bidi-override-in-anonymous-block-expected.txt: 11 * platform/chromium-win/fast/css/bidi-override-in-anonymous-block-expected.txt: 12 1 13 2012-02-22 Abhishek Arya <inferno@chromium.org> 2 14 -
releases/WebKitGTK/webkit-1.8/LayoutTests/platform/chromium-mac-snowleopard/fast/css/bidi-override-in-anonymous-block-expected.txt
r103884 r117758 226 226 RenderTableCell (anonymous) at (0,0) size 24x18 [r=0 c=0 rs=1 cs=1] 227 227 RenderText {#text} at (2,0) size 22x18 228 text run at (2,0) width 22 : "abc"228 text run at (2,0) width 22 RTL override: "abc" 229 229 RenderTableRow (anonymous) at (0,18) size 24x18 230 230 RenderTableCell {DIV} at (0,18) size 24x18 [r=1 c=0 rs=1 cs=1] … … 238 238 RenderTableCell (anonymous) at (0,0) size 24x18 [r=0 c=0 rs=1 cs=1] 239 239 RenderText {#text} at (0,0) size 24x18 240 text run at (0,0) width 24 : "opq"240 text run at (0,0) width 24 RTL override: "opq" -
releases/WebKitGTK/webkit-1.8/LayoutTests/platform/chromium-win/fast/css/bidi-override-in-anonymous-block-expected.txt
r103884 r117758 226 226 RenderTableCell (anonymous) at (0,0) size 24x20 [r=0 c=0 rs=1 cs=1] 227 227 RenderText {#text} at (2,0) size 22x19 228 text run at (2,0) width 22 : "abc"228 text run at (2,0) width 22 RTL override: "abc" 229 229 RenderTableRow (anonymous) at (0,20) size 24x20 230 230 RenderTableCell {DIV} at (0,20) size 24x20 [r=1 c=0 rs=1 cs=1] … … 238 238 RenderTableCell (anonymous) at (0,0) size 24x20 [r=0 c=0 rs=1 cs=1] 239 239 RenderText {#text} at (0,0) size 24x19 240 text run at (0,0) width 24 : "opq"240 text run at (0,0) width 24 RTL override: "opq" -
releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog
r117757 r117758 1 2012-04-04 Abhishek Arya <inferno@chromium.org> 2 3 Add helpers to create anonymous table parts. 4 https://bugs.webkit.org/show_bug.cgi?id=83116 5 6 Reviewed by Julien Chaffraix. 7 8 The patch introduces helpers to create anonymous table parts by 9 introducing a new static function createAnonymousWithParentRenderer. 10 The function builds a new anonymous wrapper of the same type as the class, 11 inheriting style properties from parent and sets a display based on 12 argument/default values. Also we streamline the RenderBlock functions 13 to match this naming convention. 14 15 * rendering/RenderBlock.cpp: 16 (WebCore::RenderBlock::createAnonymousBlockWithSameTypeAs): 17 (WebCore::RenderBlock::createAnonymousWithParentRendererAndDisplay): 18 (WebCore): 19 (WebCore::RenderBlock::createAnonymousColumnsWithParentRendererAndDisplay): 20 (WebCore::RenderBlock::createAnonymousColumnSpanWithParentRendererAndDisplay): 21 * rendering/RenderBlock.h: 22 (RenderBlock): 23 (WebCore::RenderBlock::createAnonymousBlock): 24 (WebCore::RenderBlock::createAnonymousColumnsBlock): 25 (WebCore::RenderBlock::createAnonymousColumnSpanBlock): 26 * rendering/RenderButton.cpp: 27 (WebCore::RenderButton::addChild): 28 * rendering/RenderObject.cpp: 29 (WebCore::RenderObject::addChild): 30 * rendering/RenderTable.cpp: 31 (WebCore::RenderTable::addChild): 32 (WebCore::RenderTable::createAnonymousWithParentRendererAndDisplay): 33 (WebCore): 34 * rendering/RenderTable.h: 35 (RenderTable): 36 * rendering/RenderTableCell.cpp: 37 (WebCore::RenderTableCell::createAnonymousWithParentRendererAndDisplay): 38 (WebCore): 39 * rendering/RenderTableCell.h: 40 (RenderTableCell): 41 * rendering/RenderTableRow.cpp: 42 (WebCore::RenderTableRow::addChild): 43 (WebCore::RenderTableRow::createAnonymousWithParentRendererAndDisplay): 44 (WebCore): 45 * rendering/RenderTableRow.h: 46 (RenderTableRow): 47 * rendering/RenderTableSection.cpp: 48 (WebCore::RenderTableSection::addChild): 49 (WebCore::RenderTableSection::createAnonymousWithParentRendererAndDisplay): 50 (WebCore): 51 * rendering/RenderTableSection.h: 52 (RenderTableSection): 53 1 54 2012-02-22 Abhishek Arya <inferno@chromium.org> 2 55 -
releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.cpp
r117757 r117758 671 671 // Create an anonymous table container next to our table container. 672 672 RenderBlock* parentBlock = toRenderBlock(table->parent()); 673 RenderTable* postTable = parentBlock->createAnonymousTable();673 RenderTable* postTable = RenderTable::createAnonymousWithParentRenderer(parentBlock); 674 674 parentBlock->children()->insertChildNode(parentBlock, postTable, table->nextSibling()); 675 675 … … 6467 6467 } 6468 6468 6469 RenderBlock* RenderBlock::createAnonymousBlock(bool isFlexibleBox) const6470 {6471 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());6472 6473 RenderBlock* newBox = 0;6474 if (isFlexibleBox) {6475 newStyle->setDisplay(BOX);6476 newBox = new (renderArena()) RenderDeprecatedFlexibleBox(document() /* anonymous box */);6477 } else {6478 newStyle->setDisplay(BLOCK);6479 newBox = new (renderArena()) RenderBlock(document() /* anonymous box */);6480 }6481 6482 newBox->setStyle(newStyle.release());6483 return newBox;6484 }6485 6486 6469 RenderBlock* RenderBlock::createAnonymousBlockWithSameTypeAs(RenderBlock* otherAnonymousBlock) const 6487 6470 { … … 6490 6473 if (otherAnonymousBlock->isAnonymousColumnSpanBlock()) 6491 6474 return createAnonymousColumnSpanBlock(); 6492 return createAnonymousBlock(otherAnonymousBlock->style()->display() == BOX); 6493 } 6494 6495 RenderBlock* RenderBlock::createAnonymousColumnsBlock() const 6496 { 6497 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style()); 6498 newStyle->inheritColumnPropertiesFrom(style()); 6499 newStyle->setDisplay(BLOCK); 6500 6501 RenderBlock* newBox = new (renderArena()) RenderBlock(document() /* anonymous box */); 6502 newBox->setStyle(newStyle.release()); 6503 return newBox; 6504 } 6505 6506 RenderBlock* RenderBlock::createAnonymousColumnSpanBlock() const 6507 { 6508 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style()); 6509 newStyle->setColumnSpan(ColumnSpanAll); 6510 newStyle->setDisplay(BLOCK); 6511 6512 RenderBlock* newBox = new (renderArena()) RenderBlock(document() /* anonymous box */); 6513 newBox->setStyle(newStyle.release()); 6514 return newBox; 6475 return createAnonymousBlock(otherAnonymousBlock->style()->display()); 6515 6476 } 6516 6477 … … 7241 7202 } 7242 7203 7204 RenderBlock* RenderBlock::createAnonymousWithParentRendererAndDisplay(const RenderObject* parent, EDisplay display) 7205 { 7206 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style()); 7207 7208 // FIXME: Do we need to cover the new flex box here ? 7209 // FIXME: Do we need to convert all our inline displays to block-type in the anonymous logic ? 7210 RenderBlock* newBox = 0; 7211 if (display == BOX || display == INLINE_BOX) { 7212 newStyle->setDisplay(BOX); 7213 newBox = new (parent->renderArena()) RenderDeprecatedFlexibleBox(parent->document() /* anonymous box */); 7214 } else { 7215 newStyle->setDisplay(BLOCK); 7216 newBox = new (parent->renderArena()) RenderBlock(parent->document() /* anonymous box */); 7217 } 7218 7219 newBox->setStyle(newStyle.release()); 7220 return newBox; 7221 } 7222 7223 RenderBlock* RenderBlock::createAnonymousColumnsWithParentRenderer(const RenderObject* parent) 7224 { 7225 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style()); 7226 newStyle->inheritColumnPropertiesFrom(parent->style()); 7227 newStyle->setDisplay(BLOCK); 7228 7229 RenderBlock* newBox = new (parent->renderArena()) RenderBlock(parent->document() /* anonymous box */); 7230 newBox->setStyle(newStyle.release()); 7231 return newBox; 7232 } 7233 7234 RenderBlock* RenderBlock::createAnonymousColumnSpanWithParentRenderer(const RenderObject* parent) 7235 { 7236 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style()); 7237 newStyle->setColumnSpan(ColumnSpanAll); 7238 newStyle->setDisplay(BLOCK); 7239 7240 RenderBlock* newBox = new (parent->renderArena()) RenderBlock(parent->document() /* anonymous box */); 7241 newBox->setStyle(newStyle.release()); 7242 return newBox; 7243 } 7244 7243 7245 #ifndef NDEBUG 7244 7246 -
releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.h
r117282 r117758 221 221 using RenderBoxModelObject::setContinuation; 222 222 223 // This function is a convenience helper for creating an anonymous block that inherits its 224 // style from this RenderBlock. 225 RenderBlock* createAnonymousBlock(bool isFlexibleBox = false) const; 226 RenderBlock* createAnonymousColumnsBlock() const; 227 RenderBlock* createAnonymousColumnSpanBlock() const; 223 static RenderBlock* createAnonymousWithParentRendererAndDisplay(const RenderObject*, EDisplay = BLOCK); 224 static RenderBlock* createAnonymousColumnsWithParentRenderer(const RenderObject*); 225 static RenderBlock* createAnonymousColumnSpanWithParentRenderer(const RenderObject*); 226 RenderBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return createAnonymousWithParentRendererAndDisplay(this, display); } 227 RenderBlock* createAnonymousColumnsBlock() const { return createAnonymousColumnsWithParentRenderer(this); } 228 RenderBlock* createAnonymousColumnSpanBlock() const { return createAnonymousColumnSpanWithParentRenderer(this); } 229 228 230 RenderBlock* createAnonymousBlockWithSameTypeAs(RenderBlock* otherAnonymousBlock) const; 229 231 -
releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderButton.cpp
r98929 r117758 50 50 // Create an anonymous block. 51 51 ASSERT(!firstChild()); 52 bool isFlexibleBox = style()->display() == BOX || style()->display() == INLINE_BOX; 53 m_inner = createAnonymousBlock(isFlexibleBox); 52 m_inner = createAnonymousBlock(style()->display()); 54 53 setupInnerStyle(m_inner->style()); 55 54 RenderDeprecatedFlexibleBox::addChild(m_inner); -
releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderObject.cpp
r114613 r117758 267 267 } 268 268 269 RenderTable* RenderObject::createAnonymousTable() const270 {271 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());272 newStyle->setDisplay(TABLE);273 274 RenderTable* table = new (renderArena()) RenderTable(document() /* is anonymous */);275 table->setStyle(newStyle.release());276 return table;277 }278 279 269 void RenderObject::addChild(RenderObject* newChild, RenderObject* beforeChild) 280 270 { … … 321 311 table = toRenderTable(afterChild); 322 312 else { 323 table = createAnonymousTable();313 table = RenderTable::createAnonymousWithParentRenderer(this); 324 314 addChild(table, beforeChild); 325 315 } -
releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderObject.h
r117757 r117758 220 220 // normal flow object. 221 221 void handleDynamicFloatPositionChange(); 222 223 RenderTable* createAnonymousTable() const;224 222 225 223 // RenderObject tree manipulation -
releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTable.cpp
r111970 r117758 193 193 if (beforeChild && !beforeChild->isTableSection() && beforeChild->style()->display() != TABLE_CAPTION && beforeChild->style()->display() != TABLE_COLUMN_GROUP) 194 194 beforeChild = 0; 195 RenderTableSection* section = new (renderArena()) RenderTableSection(document() /* anonymous */); 196 RefPtr<RenderStyle> newStyle = RenderStyle::create(); 197 newStyle->inheritFrom(style()); 198 newStyle->setDisplay(TABLE_ROW_GROUP); 199 section->setStyle(newStyle.release()); 195 196 RenderTableSection* section = RenderTableSection::createAnonymousWithParentRenderer(this); 200 197 addChild(section, beforeChild); 201 198 section->addChild(child); … … 1262 1259 } 1263 1260 1264 } 1261 RenderTable* RenderTable::createAnonymousWithParentRenderer(const RenderObject* parent) 1262 { 1263 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style()); 1264 newStyle->setDisplay(TABLE); 1265 1266 RenderTable* newTable = new (parent->renderArena()) RenderTable(parent->document() /* is anonymous */); 1267 newTable->setStyle(newStyle.release()); 1268 return newTable; 1269 } 1270 1271 } -
releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTable.h
r107880 r117758 212 212 } 213 213 214 static RenderTable* createAnonymousWithParentRenderer(const RenderObject*); 215 214 216 protected: 215 217 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); -
releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableCell.cpp
r107874 r117758 1098 1098 } 1099 1099 1100 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const RenderObject* parent) 1101 { 1102 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style()); 1103 newStyle->setDisplay(TABLE_CELL); 1104 1105 RenderTableCell* newCell = new (parent->renderArena()) RenderTableCell(parent->document() /* is anonymous */); 1106 newCell->setStyle(newStyle.release()); 1107 return newCell; 1108 } 1109 1100 1110 } // namespace WebCore -
releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableCell.h
r107874 r117758 137 137 void setCellWidthChanged(bool b = true) { m_cellWidthChanged = b; } 138 138 139 static RenderTableCell* createAnonymousWithParentRenderer(const RenderObject*); 140 139 141 protected: 140 142 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); -
releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableRow.cpp
r105021 r117758 114 114 } 115 115 116 RenderTableCell* cell = new (renderArena()) RenderTableCell(document() /* anonymous object */); 117 RefPtr<RenderStyle> newStyle = RenderStyle::create(); 118 newStyle->inheritFrom(style()); 119 newStyle->setDisplay(TABLE_CELL); 120 cell->setStyle(newStyle.release()); 116 RenderTableCell* cell = RenderTableCell::createAnonymousWithParentRenderer(this); 121 117 addChild(cell, beforeChild); 122 118 cell->addChild(child); … … 250 246 } 251 247 248 RenderTableRow* RenderTableRow::createAnonymousWithParentRenderer(const RenderObject* parent) 249 { 250 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style()); 251 newStyle->setDisplay(TABLE_ROW); 252 253 RenderTableRow* newRow = new (parent->renderArena()) RenderTableRow(parent->document() /* is anonymous */); 254 newRow->setStyle(newStyle.release()); 255 return newRow; 256 } 257 252 258 } // namespace WebCore -
releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableRow.h
r105021 r117758 42 42 void updateBeforeAndAfterContent(); 43 43 void paintOutlineForRowIfNeeded(PaintInfo&, const LayoutPoint&); 44 45 static RenderTableRow* createAnonymousWithParentRenderer(const RenderObject*); 44 46 45 47 private: -
releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableSection.cpp
r107038 r117758 162 162 } 163 163 164 RenderObject* row = new (renderArena()) RenderTableRow(document() /* anonymous table row */); 165 RefPtr<RenderStyle> newStyle = RenderStyle::create(); 166 newStyle->inheritFrom(style()); 167 newStyle->setDisplay(TABLE_ROW); 168 row->setStyle(newStyle.release()); 164 RenderObject* row = RenderTableRow::createAnonymousWithParentRenderer(this); 169 165 addChild(row, beforeChild); 170 166 row->addChild(child); … … 1376 1372 } 1377 1373 1374 RenderTableSection* RenderTableSection::createAnonymousWithParentRenderer(const RenderObject* parent) 1375 { 1376 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style()); 1377 newStyle->setDisplay(TABLE_ROW_GROUP); 1378 1379 RenderTableSection* newSection = new (parent->renderArena()) RenderTableSection(parent->document() /* is anonymous */); 1380 newSection->setStyle(newStyle.release()); 1381 return newSection; 1382 } 1383 1378 1384 } // namespace WebCore -
releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableSection.h
r107038 r117758 142 142 CollapsedBorderValue& cachedCollapsedBorder(const RenderTableCell*, CollapsedBorderSide); 143 143 144 static RenderTableSection* createAnonymousWithParentRenderer(const RenderObject*); 145 144 146 protected: 145 147 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
Note:
See TracChangeset
for help on using the changeset viewer.