Changeset 113252 in webkit
- Timestamp:
- Apr 4, 2012, 3:41:56 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/chromium-mac/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
-
trunk/LayoutTests/ChangeLog
r113251 r113252 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-04-04 Dimitri Glazkov <dglazkov@chromium.org> 2 14 -
trunk/LayoutTests/platform/chromium-mac/fast/css/bidi-override-in-anonymous-block-expected.txt
r110189 r113252 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" -
trunk/LayoutTests/platform/chromium-win/fast/css/bidi-override-in-anonymous-block-expected.txt
r103884 r113252 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" -
trunk/Source/WebCore/ChangeLog
r113250 r113252 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-04-04 Erik Arvidsson <arv@chromium.org> 2 55 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r112973 r113252 782 782 // Create an anonymous table container next to our table container. 783 783 RenderBlock* parentBlock = toRenderBlock(table->parent()); 784 RenderTable* postTable = parentBlock->createAnonymousTable();784 RenderTable* postTable = RenderTable::createAnonymousWithParentRenderer(parentBlock); 785 785 parentBlock->children()->insertChildNode(parentBlock, postTable, table->nextSibling()); 786 786 … … 6676 6676 } 6677 6677 6678 RenderBlock* RenderBlock::createAnonymousBlock(bool isFlexibleBox) const6679 {6680 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());6681 6682 RenderBlock* newBox = 0;6683 if (isFlexibleBox) {6684 newStyle->setDisplay(BOX);6685 newBox = new (renderArena()) RenderDeprecatedFlexibleBox(document() /* anonymous box */);6686 } else {6687 newStyle->setDisplay(BLOCK);6688 newBox = new (renderArena()) RenderBlock(document() /* anonymous box */);6689 }6690 6691 newBox->setStyle(newStyle.release());6692 return newBox;6693 }6694 6695 6678 RenderBlock* RenderBlock::createAnonymousBlockWithSameTypeAs(RenderBlock* otherAnonymousBlock) const 6696 6679 { … … 6699 6682 if (otherAnonymousBlock->isAnonymousColumnSpanBlock()) 6700 6683 return createAnonymousColumnSpanBlock(); 6701 return createAnonymousBlock(otherAnonymousBlock->style()->display() == BOX); 6702 } 6703 6704 RenderBlock* RenderBlock::createAnonymousColumnsBlock() const 6705 { 6706 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style()); 6707 newStyle->inheritColumnPropertiesFrom(style()); 6708 newStyle->setDisplay(BLOCK); 6709 6710 RenderBlock* newBox = new (renderArena()) RenderBlock(document() /* anonymous box */); 6711 newBox->setStyle(newStyle.release()); 6712 return newBox; 6713 } 6714 6715 RenderBlock* RenderBlock::createAnonymousColumnSpanBlock() const 6716 { 6717 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style()); 6718 newStyle->setColumnSpan(ColumnSpanAll); 6719 newStyle->setDisplay(BLOCK); 6720 6721 RenderBlock* newBox = new (renderArena()) RenderBlock(document() /* anonymous box */); 6722 newBox->setStyle(newStyle.release()); 6723 return newBox; 6684 return createAnonymousBlock(otherAnonymousBlock->style()->display()); 6724 6685 } 6725 6686 … … 7454 7415 } 7455 7416 7417 RenderBlock* RenderBlock::createAnonymousWithParentRendererAndDisplay(const RenderObject* parent, EDisplay display) 7418 { 7419 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style()); 7420 7421 // FIXME: Do we need to cover the new flex box here ? 7422 // FIXME: Do we need to convert all our inline displays to block-type in the anonymous logic ? 7423 RenderBlock* newBox = 0; 7424 if (display == BOX || display == INLINE_BOX) { 7425 newStyle->setDisplay(BOX); 7426 newBox = new (parent->renderArena()) RenderDeprecatedFlexibleBox(parent->document() /* anonymous box */); 7427 } else { 7428 newStyle->setDisplay(BLOCK); 7429 newBox = new (parent->renderArena()) RenderBlock(parent->document() /* anonymous box */); 7430 } 7431 7432 newBox->setStyle(newStyle.release()); 7433 return newBox; 7434 } 7435 7436 RenderBlock* RenderBlock::createAnonymousColumnsWithParentRenderer(const RenderObject* parent) 7437 { 7438 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style()); 7439 newStyle->inheritColumnPropertiesFrom(parent->style()); 7440 newStyle->setDisplay(BLOCK); 7441 7442 RenderBlock* newBox = new (parent->renderArena()) RenderBlock(parent->document() /* anonymous box */); 7443 newBox->setStyle(newStyle.release()); 7444 return newBox; 7445 } 7446 7447 RenderBlock* RenderBlock::createAnonymousColumnSpanWithParentRenderer(const RenderObject* parent) 7448 { 7449 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style()); 7450 newStyle->setColumnSpan(ColumnSpanAll); 7451 newStyle->setDisplay(BLOCK); 7452 7453 RenderBlock* newBox = new (parent->renderArena()) RenderBlock(parent->document() /* anonymous box */); 7454 newBox->setStyle(newStyle.release()); 7455 return newBox; 7456 } 7457 7456 7458 #ifndef NDEBUG 7457 7459 -
trunk/Source/WebCore/rendering/RenderBlock.h
r112566 r113252 234 234 using RenderBoxModelObject::setContinuation; 235 235 236 // This function is a convenience helper for creating an anonymous block that inherits its 237 // style from this RenderBlock. 238 RenderBlock* createAnonymousBlock(bool isFlexibleBox = false) const; 239 RenderBlock* createAnonymousColumnsBlock() const; 240 RenderBlock* createAnonymousColumnSpanBlock() const; 236 static RenderBlock* createAnonymousWithParentRendererAndDisplay(const RenderObject*, EDisplay = BLOCK); 237 static RenderBlock* createAnonymousColumnsWithParentRenderer(const RenderObject*); 238 static RenderBlock* createAnonymousColumnSpanWithParentRenderer(const RenderObject*); 239 RenderBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return createAnonymousWithParentRendererAndDisplay(this, display); } 240 RenderBlock* createAnonymousColumnsBlock() const { return createAnonymousColumnsWithParentRenderer(this); } 241 RenderBlock* createAnonymousColumnSpanBlock() const { return createAnonymousColumnSpanWithParentRenderer(this); } 242 241 243 RenderBlock* createAnonymousBlockWithSameTypeAs(RenderBlock* otherAnonymousBlock) const; 242 244 -
trunk/Source/WebCore/rendering/RenderButton.cpp
r109689 r113252 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); -
trunk/Source/WebCore/rendering/RenderObject.cpp
r112765 r113252 270 270 } 271 271 272 RenderTable* RenderObject::createAnonymousTable() const273 {274 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());275 newStyle->setDisplay(TABLE);276 277 RenderTable* table = new (renderArena()) RenderTable(document() /* is anonymous */);278 table->setStyle(newStyle.release());279 return table;280 }281 282 272 void RenderObject::addChild(RenderObject* newChild, RenderObject* beforeChild) 283 273 { … … 324 314 table = toRenderTable(afterChild); 325 315 else { 326 table = createAnonymousTable();316 table = RenderTable::createAnonymousWithParentRenderer(this); 327 317 addChild(table, beforeChild); 328 318 } -
trunk/Source/WebCore/rendering/RenderObject.h
r112453 r113252 226 226 // normal flow object. 227 227 void handleDynamicFloatPositionChange(); 228 229 RenderTable* createAnonymousTable() const;230 228 231 229 // RenderObject tree manipulation -
trunk/Source/WebCore/rendering/RenderTable.cpp
r113222 r113252 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); … … 1281 1278 } 1282 1279 1283 } 1280 RenderTable* RenderTable::createAnonymousWithParentRenderer(const RenderObject* parent) 1281 { 1282 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style()); 1283 newStyle->setDisplay(TABLE); 1284 1285 RenderTable* newTable = new (parent->renderArena()) RenderTable(parent->document() /* is anonymous */); 1286 newTable->setStyle(newStyle.release()); 1287 return newTable; 1288 } 1289 1290 } -
trunk/Source/WebCore/rendering/RenderTable.h
r112752 r113252 212 212 } 213 213 214 static RenderTable* createAnonymousWithParentRenderer(const RenderObject*); 215 214 216 protected: 215 217 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); -
trunk/Source/WebCore/rendering/RenderTableCell.cpp
r112752 r113252 1118 1118 } 1119 1119 1120 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const RenderObject* parent) 1121 { 1122 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style()); 1123 newStyle->setDisplay(TABLE_CELL); 1124 1125 RenderTableCell* newCell = new (parent->renderArena()) RenderTableCell(parent->document() /* is anonymous */); 1126 newCell->setStyle(newStyle.release()); 1127 return newCell; 1128 } 1129 1120 1130 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderTableCell.h
r109818 r113252 139 139 void setCellWidthChanged(bool b = true) { m_cellWidthChanged = b; } 140 140 141 static RenderTableCell* createAnonymousWithParentRenderer(const RenderObject*); 142 141 143 protected: 142 144 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); -
trunk/Source/WebCore/rendering/RenderTableRow.cpp
r112425 r113252 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 -
trunk/Source/WebCore/rendering/RenderTableRow.h
r110732 r113252 42 42 void updateBeforeAndAfterContent(); 43 43 void paintOutlineForRowIfNeeded(PaintInfo&, const LayoutPoint&); 44 45 static RenderTableRow* createAnonymousWithParentRenderer(const RenderObject*); 44 46 45 47 private: -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r113162 r113252 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); … … 1418 1414 } 1419 1415 1416 RenderTableSection* RenderTableSection::createAnonymousWithParentRenderer(const RenderObject* parent) 1417 { 1418 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style()); 1419 newStyle->setDisplay(TABLE_ROW_GROUP); 1420 1421 RenderTableSection* newSection = new (parent->renderArena()) RenderTableSection(parent->document() /* is anonymous */); 1422 newSection->setStyle(newStyle.release()); 1423 return newSection; 1424 } 1425 1420 1426 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderTableSection.h
r113162 r113252 163 163 int distributeExtraLogicalHeightToRows(int extraLogicalHeight); 164 164 165 static RenderTableSection* createAnonymousWithParentRenderer(const RenderObject*); 166 165 167 protected: 166 168 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
Note:
See TracChangeset
for help on using the changeset viewer.