Changeset 150527 in webkit
- Timestamp:
- May 22, 2013 11:59:38 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r150517 r150527 1 2013-05-22 Robert Hogan <robert@webkit.org> 2 3 Need to Remove Anonymous Wrappers When All Children Become Inline 4 https://bugs.webkit.org/show_bug.cgi?id=115687 5 6 Reviewed by David Hyatt. 7 8 * fast/block/remove-anonymous-wrappers-when-element-changes-to-float-or-positioned-expected.txt: Added. 9 * fast/block/remove-anonymous-wrappers-when-element-changes-to-float-or-positioned.html: Added. 10 * platform/qt/fast/block/float/float-not-removed-from-next-sibling2-expected.txt: 11 * platform/qt/fast/dynamic/002-expected.txt: 12 1 13 2013-05-22 Zoltan Arvai <zarvai@inf.u-szeged.hu> 2 14 -
trunk/LayoutTests/fast/block/float/float-not-removed-from-next-sibling2-expected.txt
r85876 r150527 15 15 RenderBlock (floating) {DIV} at (0,0) size 20x100 16 16 RenderImage {IMG} at (0,0) size 20x100 [bgcolor=#C0C0C0] 17 RenderBlock (anonymous) at (0,0) size 20x0 18 RenderInline {A} at (0,0) size 0x0 19 RenderText {#text} at (0,0) size 0x0 17 RenderInline {A} at (0,0) size 0x0 18 RenderText {#text} at (0,0) size 0x0 20 19 layer at (8,8) size 20x96 21 20 RenderBlock (positioned) {DIV} at (0,0) size 20x96 -
trunk/LayoutTests/platform/mac/fast/dynamic/002-expected.txt
r145296 r150527 8 8 RenderText {#text} at (2,2) size 258x18 9 9 text run at (2,2) width 258: "I should become a right-floating element." 10 RenderBlock (anonymous) at (0,0) size 784x18 11 RenderText {#text} at (0,0) size 393x18 12 text run at (0,0) width 195: "This text should be on the left. " 13 text run at (195,0) width 198: "The float should be to the right." 10 RenderText {#text} at (0,0) size 393x18 11 text run at (0,0) width 195: "This text should be on the left. " 12 text run at (195,0) width 198: "The float should be to the right." 14 13 RenderBlock {DIV} at (0,18) size 784x30 15 14 RenderBlock {DIV} at (0,48) size 784x36 -
trunk/LayoutTests/platform/qt/fast/block/float/float-not-removed-from-next-sibling2-expected.txt
r85882 r150527 15 15 RenderBlock (floating) {DIV} at (0,0) size 20x100 16 16 RenderImage {IMG} at (0,0) size 20x100 [bgcolor=#C0C0C0] 17 RenderBlock (anonymous) at (0,0) size 20x0 18 RenderInline {A} at (0,0) size 0x0 19 RenderText {#text} at (0,0) size 0x0 17 RenderInline {A} at (0,0) size 0x0 18 RenderText {#text} at (0,0) size 0x0 20 19 layer at (8,8) size 20x100 21 20 RenderBlock (positioned) {DIV} at (0,0) size 20x100 -
trunk/LayoutTests/platform/qt/fast/dynamic/002-expected.txt
r145350 r150527 8 8 RenderText {#text} at (2,2) size 244x19 9 9 text run at (2,2) width 244: "I should become a right-floating element." 10 RenderBlock (anonymous) at (0,0) size 784x19 11 RenderText {#text} at (0,0) size 371x19 12 text run at (0,0) width 184: "This text should be on the left. " 13 text run at (184,0) width 187: "The float should be to the right." 10 RenderText {#text} at (0,0) size 371x19 11 text run at (0,0) width 184: "This text should be on the left. " 12 text run at (184,0) width 187: "The float should be to the right." 14 13 RenderBlock {DIV} at (0,19) size 784x30 15 14 RenderBlock {DIV} at (0,49) size 784x38 -
trunk/Source/WebCore/ChangeLog
r150525 r150527 1 2013-05-22 Robert Hogan <robert@webkit.org> 2 3 Need to Remove Anonymous Wrappers When All Children Become Inline 4 https://bugs.webkit.org/show_bug.cgi?id=115687 5 6 Reviewed by David Hyatt. 7 8 Remove a simple subset of anonymous wrappers, i.e. anonymous blocks without continuations, 9 when a block becoming float or positioned removes the need for them. 10 11 Test: fast/block/remove-anonymous-wrappers-when-element-changes-to-float-or-positioned.html 12 13 * rendering/RenderBlock.h: 14 (RenderBlock): 15 * rendering/RenderObject.cpp: 16 (WebCore): 17 (WebCore::RenderObject::removeAnonymousWrappersFromLineIfNecessary): 18 (WebCore::RenderObject::styleWillChange): 19 (WebCore::RenderObject::styleDidChange): 20 * rendering/RenderObject.h: 21 (RenderObject): 22 1 23 2013-05-22 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> 2 24 -
trunk/Source/WebCore/rendering/RenderBlock.h
r150312 r150527 280 280 RenderBlock* createAnonymousColumnsBlock() const { return createAnonymousColumnsWithParentRenderer(this); } 281 281 RenderBlock* createAnonymousColumnSpanBlock() const { return createAnonymousColumnSpanWithParentRenderer(this); } 282 static void collapseAnonymousBoxChild(RenderBlock* parent, RenderObject* child); 282 283 283 284 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE; … … 603 604 virtual void removeLeftoverAnonymousBlock(RenderBlock* child); 604 605 605 static void collapseAnonymousBoxChild(RenderBlock* parent, RenderObject* child);606 606 void moveAllChildrenIncludingFloatsTo(RenderBlock* toBlock, bool fullRemoveInsert); 607 607 -
trunk/Source/WebCore/rendering/RenderObject.cpp
r150525 r150527 123 123 124 124 bool RenderObject::s_affectsParentBlock = false; 125 bool RenderObject::s_noLongerAffectsParentBlock = false; 125 126 126 127 RenderObjectAncestorLineboxDirtySet* RenderObject::s_ancestorLineboxDirtySet = 0; … … 1677 1678 } 1678 1679 1680 void RenderObject::removeAnonymousWrappersForInlinesIfNecessary() 1681 { 1682 // We have changed to floated or out-of-flow positioning so maybe all our parent's 1683 // children can be inline now. Bail if there are any block children left on the line, 1684 // otherwise we can proceed to stripping solitary anonymous wrappers from the inlines. 1685 // FIXME: We should also handle split inlines here - we exclude them at the moment by returning 1686 // if we find a continuation. 1687 RenderObject* curr = parent()->firstChild(); 1688 while (curr && ((curr->isAnonymousBlock() && !toRenderBlock(curr)->isAnonymousBlockContinuation()) || curr->style()->isFloating() || curr->style()->hasOutOfFlowPosition())) 1689 curr = curr->nextSibling(); 1690 1691 if (curr) 1692 return; 1693 1694 curr = parent()->firstChild(); 1695 RenderBlock* parentBlock = toRenderBlock(parent()); 1696 while (curr) { 1697 RenderObject* next = curr->nextSibling(); 1698 if (curr->isAnonymousBlock()) 1699 parentBlock->collapseAnonymousBoxChild(parentBlock, toRenderBlock(curr)); 1700 curr = next; 1701 } 1702 } 1703 1679 1704 void RenderObject::setAnimatableStyle(PassRefPtr<RenderStyle> style) 1680 1705 { … … 1894 1919 && parent() && (parent()->isBlockFlow() || parent()->isRenderInline()); 1895 1920 1921 s_noLongerAffectsParentBlock = ((!isFloating() && newStyle->isFloating()) || (!isOutOfFlowPositioned() && newStyle->hasOutOfFlowPosition())) 1922 && parent() && parent()->isRenderBlock(); 1923 1896 1924 // reset style flags 1897 1925 if (diff == StyleDifferenceLayout || diff == StyleDifferenceLayoutPositionedMovementOnly) { … … 1904 1932 setHasTransform(false); 1905 1933 setHasReflection(false); 1906 } else 1934 } else { 1907 1935 s_affectsParentBlock = false; 1936 s_noLongerAffectsParentBlock = false; 1937 } 1908 1938 1909 1939 if (view()->frameView()) { … … 1960 1990 handleDynamicFloatPositionChange(); 1961 1991 1992 if (s_noLongerAffectsParentBlock) 1993 removeAnonymousWrappersForInlinesIfNecessary(); 1962 1994 #if ENABLE(SVG) 1963 1995 SVGRenderSupport::styleChanged(this); -
trunk/Source/WebCore/rendering/RenderObject.h
r150259 r150527 248 248 // normal flow object. 249 249 void handleDynamicFloatPositionChange(); 250 void removeAnonymousWrappersForInlinesIfNecessary(); 250 251 251 252 // RenderObject tree manipulation … … 1170 1171 // Store state between styleWillChange and styleDidChange 1171 1172 static bool s_affectsParentBlock; 1173 static bool s_noLongerAffectsParentBlock; 1172 1174 }; 1173 1175
Note: See TracChangeset
for help on using the changeset viewer.