Changeset 95469 in webkit
- Timestamp:
- Sep 19, 2011, 1:52:37 PM (14 years ago)
- Location:
- branches/chromium/874/Source/WebCore/rendering
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/chromium/874/Source/WebCore/rendering/RenderBlock.cpp
r94541 r95469 683 683 { 684 684 // Make sure we don't append things after :after-generated content if we have it. 685 if (!beforeChild) { 686 RenderObject* lastRenderer = lastChild(); 687 while (lastRenderer && lastRenderer->isAnonymous() && !isAfterContent(lastRenderer)) 688 lastRenderer = lastRenderer->lastChild(); 689 if (lastRenderer && isAfterContent(lastRenderer)) 690 beforeChild = lastRenderer; 691 } 685 if (!beforeChild) 686 beforeChild = findAfterContentRenderer(); 692 687 693 688 // If the requested beforeChild is not one of our children, then this is because 694 689 // there is an anonymous container within this object that contains the beforeChild. 695 690 if (beforeChild && beforeChild->parent() != this) { 696 RenderObject* anonymousChild = beforeChild->parent(); 697 ASSERT(anonymousChild); 698 699 while (anonymousChild->parent() != this) 700 anonymousChild = anonymousChild->parent(); 701 702 ASSERT(anonymousChild->isAnonymous()); 703 704 if (anonymousChild->isAnonymousBlock()) { 691 RenderObject* beforeChildAnonymousContainer = anonymousContainer(beforeChild); 692 ASSERT(beforeChildAnonymousContainer); 693 ASSERT(beforeChildAnonymousContainer->isAnonymous()); 694 695 if (beforeChildAnonymousContainer->isAnonymousBlock()) { 705 696 // Insert the child into the anonymous block box instead of here. 706 697 if (newChild->isInline() || beforeChild->parent()->firstChild() != beforeChild) … … 711 702 } 712 703 713 ASSERT( anonymousChild->isTable());704 ASSERT(beforeChildAnonymousContainer->isTable()); 714 705 if ((newChild->isTableCol() && newChild->style()->display() == TABLE_COLUMN_GROUP) 715 706 || (newChild->isRenderBlock() && newChild->style()->display() == TABLE_CAPTION) … … 718 709 || newChild->isTableCell()) { 719 710 // Insert into the anonymous table. 720 anonymousChild->addChild(newChild, beforeChild);711 beforeChildAnonymousContainer->addChild(newChild, beforeChild); 721 712 return; 722 713 } 723 714 724 715 // Go on to insert before the anonymous table. 725 beforeChild = anonymousChild;716 beforeChild = beforeChildAnonymousContainer; 726 717 } 727 718 -
branches/chromium/874/Source/WebCore/rendering/RenderObject.cpp
r94543 r95469 284 284 return; 285 285 286 RenderObject* beforeContent = 0; 287 bool beforeChildHasBeforeAndAfterContent = false; 288 if (beforeChild && (beforeChild->isTable() || beforeChild->isTableSection() || beforeChild->isTableRow())) { 289 beforeContent = beforeChild->findBeforeContentRenderer(); 290 RenderObject* afterContent = beforeChild->findAfterContentRenderer(); 291 if (beforeContent && afterContent) { 292 beforeChildHasBeforeAndAfterContent = true; 293 beforeContent->destroy(); 294 } 295 } 296 286 297 bool needsTable = false; 287 298 … … 322 333 children->insertChildNode(this, newChild, beforeChild); 323 334 } 335 324 336 if (newChild->isText() && newChild->style()->textTransform() == CAPITALIZE) { 325 337 RefPtr<StringImpl> textToTransform = toRenderText(newChild)->originalText(); … … 327 339 toRenderText(newChild)->setText(textToTransform.release(), true); 328 340 } 341 342 if (beforeChildHasBeforeAndAfterContent) 343 children->updateBeforeAfterContent(this, BEFORE); 329 344 } 330 345 -
branches/chromium/874/Source/WebCore/rendering/RenderObject.h
r94543 r95469 337 337 static inline bool isAfterContent(const RenderObject* obj) { return obj && obj->isAfterContent(); } 338 338 static inline bool isBeforeOrAfterContent(const RenderObject* obj) { return obj && obj->isBeforeOrAfterContent(); } 339 340 inline RenderObject* findBeforeContentRenderer() const 341 { 342 RenderObject* renderer = beforePseudoElementRenderer(); 343 return isBeforeContent(renderer) ? renderer : 0; 344 } 345 346 inline RenderObject* findAfterContentRenderer() const 347 { 348 RenderObject* renderer = afterPseudoElementRenderer(); 349 return isAfterContent(renderer) ? renderer : 0; 350 } 351 352 inline RenderObject* anonymousContainer(RenderObject* child) 353 { 354 RenderObject* container = child; 355 while (container->parent() != this) 356 container = container->parent(); 357 358 ASSERT(container->isAnonymous()); 359 return container; 360 } 339 361 340 362 bool childrenInline() const { return m_childrenInline; } -
branches/chromium/874/Source/WebCore/rendering/RenderTable.cpp
r94543 r95469 108 108 { 109 109 // Make sure we don't append things after :after-generated content if we have it. 110 if (!beforeChild && isAfterContent(lastChild())) 111 beforeChild = lastChild(); 110 if (!beforeChild) { 111 if (RenderObject* afterContentRenderer = findAfterContentRenderer()) 112 beforeChild = anonymousContainer(afterContentRenderer); 113 } 112 114 113 115 bool wrapInAnonymousSection = !child->isPositioned(); -
branches/chromium/874/Source/WebCore/rendering/RenderTableRow.cpp
r94543 r95469 84 84 { 85 85 // Make sure we don't append things after :after-generated content if we have it. 86 if (!beforeChild && isAfterContent(lastChild())) 87 beforeChild = lastChild(); 86 if (!beforeChild) { 87 if (RenderObject* afterContentRenderer = findAfterContentRenderer()) 88 beforeChild = anonymousContainer(afterContentRenderer); 89 } 88 90 89 91 if (!child->isTableCell()) { -
branches/chromium/874/Source/WebCore/rendering/RenderTableSection.cpp
r94543 r95469 99 99 { 100 100 // Make sure we don't append things after :after-generated content if we have it. 101 if (!beforeChild && isAfterContent(lastChild())) 102 beforeChild = lastChild(); 101 if (!beforeChild) { 102 if (RenderObject* afterContentRenderer = findAfterContentRenderer()) 103 beforeChild = anonymousContainer(afterContentRenderer); 104 } 103 105 104 106 if (!child->isTableRow()) {
Note:
See TracChangeset
for help on using the changeset viewer.