Changeset 127163 in webkit
- Timestamp:
- Aug 30, 2012 11:15:13 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 20 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r127162 r127163 1 2012-08-24 Robert Hogan <robert@webkit.org> 2 3 CSS 2.1 failure: margin-collapse-clear-012 fails 4 https://bugs.webkit.org/show_bug.cgi?id=80394 5 6 Reviewed by David Hyatt. 7 8 * css2.1/20110323/margin-collapse-027-expected.html: Added. 9 * css2.1/20110323/margin-collapse-027.htm: Added. 10 * css2.1/20110323/margin-collapse-clear-012-expected.html: Added. 11 * css2.1/20110323/margin-collapse-clear-012.htm: Added. 12 * css2.1/20110323/margin-collapse-clear-013-expected.html: Added. 13 * css2.1/20110323/margin-collapse-clear-013.htm: Added. 14 * css2.1/20110323/margin-collapse-clear-014-expected.html: Added. 15 * css2.1/20110323/margin-collapse-clear-014.htm: Added. 16 * css2.1/20110323/margin-collapse-clear-015-expected.html: Added. 17 * css2.1/20110323/margin-collapse-clear-015.htm: Added. 18 * css2.1/20110323/margin-collapse-clear-016-expected.html: Added. 19 * css2.1/20110323/margin-collapse-clear-016.htm: Added. 20 * css2.1/20110323/margin-collapse-clear-017-expected.html: Added. 21 * css2.1/20110323/margin-collapse-clear-017.htm: Added. 22 * fast/block/margin-collapse/empty-clear-blocks.html: 23 Modified the test to reflect the new expected result. The text in the third paragraph avoids 24 the float rather than sitting underneath it. The text in the third last paragraph is 20 px below 25 the float rather than immediately beneath it. Both of these are a consequence of the revised treatment 26 of clearance when margin collapsing. This is consistent with the spec and FF and Opera. 27 * fast/css/margin-collapse-013-reduction.html: Added. 28 Sourced from https://bugzilla.mozilla.org/show_bug.cgi?id=493380 29 * fast/css/margin-collapse-top-margin-clearance-with-sibling-expected.html: Added. 30 * fast/css/margin-collapse-top-margin-clearance-with-sibling.html: Added. 31 Ensure we only avoid collapsing the margins of a self-collapsing block with the parent if we don't 32 have a subsequent sibling with height. 33 * fast/css/margin-collapse-top-margin-clearance.html: Added. 34 35 * platform/chromium-linux/fast/block/float/024-expected.png: 36 * platform/chromium-linux/fast/block/margin-collapse/empty-clear-blocks-expected.png: 37 These two progress to the same rendering used by FF and Opera. It is a consequence of calculating 38 clearance as "clearance = [height of float] - margin-top" when margin-top is a negative value. 39 40 * platform/chromium-win/fast/block/float/024-expected.txt: 41 * platform/chromium-win/fast/block/margin-collapse/025-expected.txt: 42 * platform/chromium-win/fast/block/margin-collapse/block-inside-inline/025-expected.txt: 43 The change in result for these three is a consequence of self-collapsing blocks with clearance moving their top up past the float by the value 44 of their top margin. Unlike the block-inside-inline case the 'clear' has no intrinsic height so the uncollapsed margin value has 45 no effect on its height. 46 47 * platform/chromium-win/fast/block/margin-collapse/empty-clear-blocks-expected.txt: See the png result above for comment. 48 1 49 2012-08-30 Rik Cabanier <cabanier@adobe.com> 2 50 -
trunk/LayoutTests/fast/block/margin-collapse/empty-clear-blocks.html
r16443 r127163 28 28 This paragraph has a bottom margin of 50px.</span> 29 29 <span style="clear:both; margin-top:30px;margin-bottom:-60px"></span> 30 <span style="margin-top:60px">This text should be immediately underthe float.</span>30 <span style="margin-top:60px">This text should be to the right of the float.</span> 31 31 <hr> 32 32 <span style="margin-bottom:50px"><div>This is a float that is 100px high.</div> … … 43 43 This paragraph has a bottom margin of 50px.</span> 44 44 <span style="clear:both; margin-top:-30px"></span> 45 <span style="margin-top:30px">This text should be immediatelyunder the float.</span>45 <span style="margin-top:30px">This text should be 20px under the float.</span> 46 46 <hr> 47 47 <span style="border:10px dotted black"> -
trunk/LayoutTests/platform/chromium-win/fast/block/float/024-expected.txt
r56264 r127163 13 13 RenderBlock {DIV} at (0,221) size 800x56 [bgcolor=#DDDDDD] [border: (2px solid #000000)] 14 14 RenderBlock (floating) {DIV} at (2,2) size 32x32 [bgcolor=#FFFFFF] 15 RenderBlock {DIV} at (2, 34) size 796x015 RenderBlock {DIV} at (2,18) size 796x0 16 16 RenderBlock (anonymous) at (2,34) size 796x20 17 17 RenderText {#text} at (0,0) size 460x19 18 18 text run at (0,0) width 460: "This text should be inside a black rectangle and below the 2em white square." 19 RenderBlock {DIV} at (0,293) size 800x 56[bgcolor=#DDDDDD] [border: (2px solid #000000)]19 RenderBlock {DIV} at (0,293) size 800x72 [bgcolor=#DDDDDD] [border: (2px solid #000000)] 20 20 RenderBlock (floating) {DIV} at (2,2) size 32x32 [bgcolor=#FFFFFF] 21 RenderBlock {DIV} at (2, 34) size 796x022 RenderBlock (anonymous) at (2, 34) size 796x2021 RenderBlock {DIV} at (2,50) size 796x0 22 RenderBlock (anonymous) at (2,50) size 796x20 23 23 RenderText {#text} at (0,0) size 488x19 24 24 text run at (0,0) width 488: "This text should also be inside a black rectangle and below the 2em white square." -
trunk/LayoutTests/platform/chromium-win/fast/block/margin-collapse/025-expected.txt
r56264 r127163 13 13 RenderBlock {DIV} at (3,3) size 128x128 [bgcolor=#00FF00] 14 14 RenderBlock (floating) {DIV} at (0,0) size 64x64 [bgcolor=#00FFFF] 15 RenderBlock {DIV} at (0, 64) size 128x0 [bgcolor=#FF0000]15 RenderBlock {DIV} at (0,48) size 128x0 [bgcolor=#FF0000] 16 16 RenderBlock {DIV} at (0,64) size 128x64 [border: (32px solid #FFFF00)] 17 17 RenderTableCell {TD} at (166,16) size 134x134 [bgcolor=#FF0000] [border: (3px solid #000000)] [r=0 c=1 rs=1 cs=1] -
trunk/LayoutTests/platform/chromium-win/fast/block/margin-collapse/block-inside-inline/025-expected.txt
r56264 r127163 16 16 RenderInline {SPAN} at (0,0) size 0x0 17 17 RenderBlock (anonymous) at (0,0) size 128x48 18 RenderBlock {DIV} at (0, 64) size 128x0 [bgcolor=#FF0000]19 RenderBlock (anonymous) at (0, 64) size 128x018 RenderBlock {DIV} at (0,48) size 128x0 [bgcolor=#FF0000] 19 RenderBlock (anonymous) at (0,48) size 128x0 20 20 RenderInline {SPAN} at (0,0) size 0x0 21 21 RenderText {#text} at (0,0) size 0x0 -
trunk/LayoutTests/platform/chromium-win/fast/block/margin-collapse/empty-clear-blocks-expected.txt
r56264 r127163 1 layer at (0,0) size 785x11 221 layer at (0,0) size 785x1142 2 2 RenderView at (0,0) size 785x600 3 layer at (0,0) size 785x11 224 RenderBlock {HTML} at (0,0) size 785x11 225 RenderBody {BODY} at (8,8) size 769x11 063 layer at (0,0) size 785x1142 4 RenderBlock {HTML} at (0,0) size 785x1142 5 RenderBody {BODY} at (8,8) size 769x1126 6 6 RenderBlock {SPAN} at (0,0) size 769x20 7 7 RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#00FF00] … … 12 12 RenderText {#text} at (100,0) size 271x19 13 13 text run at (100,0) width 271: "This paragraph has a bottom margin of 50px." 14 RenderBlock {SPAN} at (0, 100) size 769x015 RenderBlock {SPAN} at (0,10 0) size 769x2014 RenderBlock {SPAN} at (0,75) size 769x0 15 RenderBlock {SPAN} at (0,105) size 769x20 16 16 RenderText {#text} at (0,0) size 282x19 17 17 text run at (0,0) width 282: "This text should be immediately under the float." 18 RenderBlock {HR} at (0,1 28) size 769x2 [border: (1px inset #000000)]19 RenderBlock {SPAN} at (0,1 38) size 769x2018 RenderBlock {HR} at (0,133) size 769x2 [border: (1px inset #000000)] 19 RenderBlock {SPAN} at (0,143) size 769x20 20 20 RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#00FF00] 21 21 RenderText {#text} at (0,0) size 79x59 … … 25 25 RenderText {#text} at (100,0) size 271x19 26 26 text run at (100,0) width 271: "This paragraph has a bottom margin of 50px." 27 RenderBlock {SPAN} at (0,2 38) size 769x028 RenderBlock {SPAN} at (0,2 48) size 769x2027 RenderBlock {SPAN} at (0,218) size 769x0 28 RenderBlock {SPAN} at (0,258) size 769x20 29 29 RenderText {#text} at (0,0) size 242x19 30 30 text run at (0,0) width 242: "This text should be 10px under the float." 31 RenderBlock {HR} at (0,2 76) size 769x2 [border: (1px inset #000000)]32 RenderBlock {SPAN} at (0,2 86) size 769x2031 RenderBlock {HR} at (0,286) size 769x2 [border: (1px inset #000000)] 32 RenderBlock {SPAN} at (0,296) size 769x20 33 33 RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#00FF00] 34 34 RenderText {#text} at (0,0) size 79x59 … … 38 38 RenderText {#text} at (100,0) size 271x19 39 39 text run at (100,0) width 271: "This paragraph has a bottom margin of 50px." 40 RenderBlock {SPAN} at (0,3 86) size 769x041 RenderBlock {SPAN} at (0,3 86) size 769x2042 RenderText {#text} at ( 0,0) size 282x1943 text run at ( 0,0) width 282: "This text should be immediately underthe float."44 RenderBlock {HR} at ( 0,414) size 769x2 [border: (1px inset #000000)]45 RenderBlock {SPAN} at (0,4 24) size 769x2040 RenderBlock {SPAN} at (0,366) size 769x0 41 RenderBlock {SPAN} at (0,366) size 769x20 42 RenderText {#text} at (100,0) size 253x19 43 text run at (100,0) width 253: "This text should be to the right of the float." 44 RenderBlock {HR} at (100,394) size 669x2 [border: (1px inset #000000)] 45 RenderBlock {SPAN} at (0,404) size 769x20 46 46 RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#00FF00] 47 47 RenderText {#text} at (0,0) size 79x59 … … 51 51 RenderText {#text} at (100,0) size 271x19 52 52 text run at (100,0) width 271: "This paragraph has a bottom margin of 50px." 53 RenderBlock {SPAN} at (0, 524) size 769x054 RenderBlock {SPAN} at (0,5 24) size 769x2053 RenderBlock {SPAN} at (0,479) size 769x0 54 RenderBlock {SPAN} at (0,509) size 769x20 55 55 RenderText {#text} at (0,0) size 282x19 56 56 text run at (0,0) width 282: "This text should be immediately under the float." 57 RenderBlock {HR} at (0,5 52) size 769x2 [border: (1px inset #000000)]58 RenderBlock {SPAN} at (0,5 62) size 769x2057 RenderBlock {HR} at (0,537) size 769x2 [border: (1px inset #000000)] 58 RenderBlock {SPAN} at (0,547) size 769x20 59 59 RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#00FF00] 60 60 RenderText {#text} at (0,0) size 79x59 … … 64 64 RenderText {#text} at (100,0) size 271x19 65 65 text run at (100,0) width 271: "This paragraph has a bottom margin of 50px." 66 RenderBlock {SPAN} at (0,6 62) size 769x067 RenderBlock {SPAN} at (0,6 72) size 769x2066 RenderBlock {SPAN} at (0,617) size 769x0 67 RenderBlock {SPAN} at (0,657) size 769x20 68 68 RenderText {#text} at (0,0) size 242x19 69 69 text run at (0,0) width 242: "This text should be 10px under the float." 70 RenderBlock {HR} at (0, 700) size 769x2 [border: (1px inset #000000)]71 RenderBlock {SPAN} at (0, 710) size 769x2070 RenderBlock {HR} at (0,685) size 769x2 [border: (1px inset #000000)] 71 RenderBlock {SPAN} at (0,695) size 769x20 72 72 RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#00FF00] 73 73 RenderText {#text} at (0,0) size 79x59 … … 77 77 RenderText {#text} at (100,0) size 271x19 78 78 text run at (100,0) width 271: "This paragraph has a bottom margin of 50px." 79 RenderBlock {SPAN} at (0,8 10) size 769x080 RenderBlock {SPAN} at (0,8 10) size 769x2081 RenderText {#text} at (0,0) size 2 82x1982 text run at (0,0) width 2 82: "This text should be immediatelyunder the float."83 RenderBlock {HR} at (0,8 38) size 769x2 [border: (1px inset #000000)]84 RenderBlock {SPAN} at (0,8 48) size 769x120[border: (10px dotted #000000)]79 RenderBlock {SPAN} at (0,825) size 769x0 80 RenderBlock {SPAN} at (0,825) size 769x20 81 RenderText {#text} at (0,0) size 242x19 82 text run at (0,0) width 242: "This text should be 20px under the float." 83 RenderBlock {HR} at (0,853) size 769x2 [border: (1px inset #000000)] 84 RenderBlock {SPAN} at (0,863) size 769x125 [border: (10px dotted #000000)] 85 85 RenderBlock {SPAN} at (10,10) size 749x20 86 86 RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#00FF00] … … 91 91 RenderText {#text} at (100,0) size 271x19 92 92 text run at (100,0) width 271: "This paragraph has a bottom margin of 50px." 93 RenderBlock {SPAN} at (10, 110) size 749x094 RenderBlock {HR} at (0,9 76) size 769x2 [border: (1px inset #000000)]95 RenderBlock {SPAN} at (0, 986) size 769x120 [border: (10px dotted #000000)]93 RenderBlock {SPAN} at (10,85) size 749x0 94 RenderBlock {HR} at (0,996) size 769x2 [border: (1px inset #000000)] 95 RenderBlock {SPAN} at (0,1006) size 769x120 [border: (10px dotted #000000)] 96 96 RenderBlock {SPAN} at (10,10) size 749x20 97 97 RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#00FF00] … … 102 102 RenderText {#text} at (100,0) size 271x19 103 103 text run at (100,0) width 271: "This paragraph has a bottom margin of 50px." 104 RenderBlock {SPAN} at (10,1 10) size 749x0104 RenderBlock {SPAN} at (10,140) size 749x0 -
trunk/LayoutTests/platform/chromium/TestExpectations
r127159 r127163 3618 3618 BUGWK95136 : fast/css/sticky/sticky-writing-mode-vertical-rl.html = IMAGE 3619 3619 3620 //Require rebaseline after https://bugs.webkit.org/show_bug.cgi?id=80394 3621 BUGWK80394 MAC WIN : fast/block/margin-collapse/empty-clear-blocks.html = IMAGE+TEXT 3622 BUGWK80394 MAC WIN : fast/block/float/024.html = IMAGE+TEXT 3623 BUGWK80394 MAC WIN : fast/block/margin-collapse/025.html = TEXT 3624 BUGWK80394 MAC WIN : fast/block/margin-collapse/block-inside-inline/025.html = TEXT 3625 -
trunk/LayoutTests/platform/efl/TestExpectations
r127127 r127163 1002 1002 // Fails after r127039. 1003 1003 BUGWK95414 : inspector/timeline/timeline-load.html = TEXT 1004 1005 //Require rebaseline after https://bugs.webkit.org/show_bug.cgi?id=80394 1006 BUGWK80394 : fast/block/margin-collapse/empty-clear-blocks.html = IMAGE+TEXT 1007 BUGWK80394 : fast/block/float/024.html = IMAGE+TEXT 1008 BUGWK80394 : fast/block/margin-collapse/025.html = TEXT 1009 BUGWK80394 : fast/block/margin-collapse/block-inside-inline/025.html = TEXT 1010 -
trunk/LayoutTests/platform/gtk/TestExpectations
r127130 r127163 40 40 BUGWK77754 : fast/inline/absolute-positioned-inline-in-centred-block.html = TEXT 41 41 BUGWK77754 : fast/css/absolute-child-with-percent-height-inside-relative-parent.html = TEXT 42 43 //Require rebaseline after https://bugs.webkit.org/show_bug.cgi?id=80394 44 BUGWK80394 : fast/block/margin-collapse/empty-clear-blocks.html = IMAGE+TEXT 45 BUGWK80394 : fast/block/float/024.html = IMAGE+TEXT 46 BUGWK80394 : fast/block/margin-collapse/025.html = TEXT 47 BUGWK80394 : fast/block/margin-collapse/block-inside-inline/025.html = TEXT 42 48 43 49 ////////////////////////////////////////////////////////////////////////////////////////// -
trunk/LayoutTests/platform/mac/TestExpectations
r127050 r127163 364 364 365 365 BUGWK92464 DEBUG : fast/events/tabindex-focus-blur-all.html = CRASH PASS 366 367 //Require rebaseline after https://bugs.webkit.org/show_bug.cgi?id=80394 368 BUGWK80394 : fast/block/float/024.html = IMAGE+TEXT 369 BUGWK80394 : fast/block/margin-collapse/empty-clear-blocks.html = IMAGE+TEXT 370 BUGWK80394 : fast/block/margin-collapse/025.html = TEXT 371 BUGWK80394 : fast/block/margin-collapse/block-inside-inline/025.html = TEXT 372 -
trunk/LayoutTests/platform/qt/TestExpectations
r126911 r127163 203 203 BUGWK77754 : fast/css/absolute-child-with-percent-height-inside-relative-parent.html = TEXT 204 204 205 //Require rebaseline after https://bugs.webkit.org/show_bug.cgi?id=80394 206 BUGWK80394 : fast/block/margin-collapse/empty-clear-blocks.html = IMAGE+TEXT 207 BUGWK80394 : fast/block/float/024.html = IMAGE+TEXT 208 BUGWK80394 : fast/block/margin-collapse/025.html = TEXT 209 BUGWK80394 : fast/block/margin-collapse/block-inside-inline/025.html = TEXT 210 -
trunk/LayoutTests/platform/win/Skipped
r127101 r127163 2150 2150 # Test times out 2151 2151 platform/win/accessibility/single-select-children.html 2152 2153 # Require rebaseline after https://bugs.webkit.org/show_bug.cgi?id=80394 2154 fast/block/float/024.html 2155 fast/block/margin-collapse/empty-clear-blocks.html 2156 fast/block/margin-collapse/025.html 2157 fast/block/margin-collapse/block-inside-inline/025.html 2158 -
trunk/Source/WebCore/ChangeLog
r127162 r127163 1 2012-08-24 Robert Hogan <robert@webkit.org> 2 3 CSS 2.1 failure: margin-collapse-clear-012 fails 4 https://bugs.webkit.org/show_bug.cgi?id=80394 5 6 Reviewed by David Hyatt. 7 8 CSS2.1 states: "If the top and bottom margins of an element with clearance are adjoining, its margins collapse with 9 the adjoining margins of following siblings but that resulting margin does not collapse with the bottom margin of the parent block." 10 This is a change in the spec since http://trac.webkit.org/changeset/47678, so prevent the margins of collapsed blocks from collapsing 11 with parent margins. 12 13 Also, in the case of self-collapsing blocks adjust the clearance so that it is equal to [height of float to clear] - margin-top of the 14 self-collapsing block. (See the 'Explanation' section near the end of http://www.w3.org/TR/CSS21/visuren.html#clearance). This allows 15 the correct value of any margins collapsed with subsequent siblings to contribute to the height of the parent. For example if a block 16 with margin-top of 40px has to clear a float of 100px, the clearance is now 60px so set that as the height of the parent. If a subsequent 17 sibling has a collapsed margin value of 140px (e.g. from a margin-top of 80px and a margin-bottom of 140px) then the height of the parent 18 becomes 200px by adding on that collapsed margin. 19 20 Tests: css2.1/20110323/margin-collapse-clear-012.htm 21 css2.1/20110323/margin-collapse-clear-013.htm 22 css2.1/20110323/margin-collapse-027.htm 23 fast/css/margin-collapse-013-reduction.html 24 fast/css/margin-collapse-top-margin-clearance.html 25 fast/css/margin-collapse-top-margin-clearance-with-sibling.html 26 27 * rendering/RenderBlock.cpp: 28 (WebCore::RenderBlock::clearFloatsIfNeeded): 29 (WebCore::RenderBlock::handleAfterSideOfBlock): Without this margin-collapse/block-inside-inline/025.html adds in the margin to 30 an anonymous block containing a block child. FF does this, Opera does not. The spec is not crystal-clear but Opera's behaviour 31 seems correct - it's totally unintuitive to think the margins of an anonymous block and its block-flow child should be considered adjoining. 32 Maybe this is a FIXME pending clarification in the spec? 33 * rendering/RenderBlock.h: 34 (WebCore::RenderBlock::MarginInfo::setCanCollapseMarginAfterWithChildren): 35 1 36 2012-08-30 Rik Cabanier <cabanier@adobe.com> 2 37 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r127155 r127163 2083 2083 // margins with following siblings. Reset the current margins to represent 2084 2084 // the self-collapsing block's margins only. 2085 MarginValues childMargins = marginValuesForChild(child); 2086 marginInfo.setPositiveMargin(max(childMargins.positiveMarginBefore(), childMargins.positiveMarginAfter())); 2087 marginInfo.setNegativeMargin(max(childMargins.negativeMarginBefore(), childMargins.negativeMarginAfter())); 2088 2085 2089 // CSS2.1 states: 2086 // "An element that has had clearance applied to it never collapses its top margin with its parent block's bottom margin. 2087 // Therefore if we are at the bottom of the block, let's go ahead and reset margins to only include the 2088 // self-collapsing block's bottom margin. 2089 bool atBottomOfBlock = true; 2090 for (RenderBox* curr = child->nextSiblingBox(); curr && atBottomOfBlock; curr = curr->nextSiblingBox()) { 2091 if (!curr->isFloatingOrOutOfFlowPositioned()) 2092 atBottomOfBlock = false; 2093 } 2094 2095 MarginValues childMargins = marginValuesForChild(child); 2096 if (atBottomOfBlock) { 2097 marginInfo.setPositiveMargin(childMargins.positiveMarginAfter()); 2098 marginInfo.setNegativeMargin(childMargins.negativeMarginAfter()); 2099 } else { 2100 marginInfo.setPositiveMargin(max(childMargins.positiveMarginBefore(), childMargins.positiveMarginAfter())); 2101 marginInfo.setNegativeMargin(max(childMargins.negativeMarginBefore(), childMargins.negativeMarginAfter())); 2102 } 2103 2104 // Adjust our height such that we are ready to be collapsed with subsequent siblings (or the bottom 2105 // of the parent block). 2106 setLogicalHeight(child->logicalTop() - max(ZERO_LAYOUT_UNIT, marginInfo.margin())); 2090 // "If the top and bottom margins of an element with clearance are adjoining, its margins collapse with 2091 // the adjoining margins of following siblings but that resulting margin does not collapse with the bottom margin of the parent block." 2092 // So the parent's bottom margin cannot collapse through this block or any subsequent self-collapsing blocks. Check subsequent siblings 2093 // for a block with height - if none is found then don't allow the margins to collapse with the parent. 2094 bool wouldCollapseMarginsWithParent = marginInfo.canCollapseMarginAfterWithChildren(); 2095 for (RenderBox* curr = child->nextSiblingBox(); curr && wouldCollapseMarginsWithParent; curr = curr->nextSiblingBox()) { 2096 if (!curr->isFloatingOrOutOfFlowPositioned() && !curr->isSelfCollapsingBlock()) 2097 wouldCollapseMarginsWithParent = false; 2098 } 2099 if (wouldCollapseMarginsWithParent) 2100 marginInfo.setCanCollapseMarginAfterWithChildren(false); 2101 2102 // CSS2.1: "the amount of clearance is set so that clearance + margin-top = [height of float], i.e., clearance = [height of float] - margin-top" 2103 // Move the top of the child box to the bottom of the float ignoring the child's top margin. 2104 LayoutUnit collapsedMargin = collapsedMarginBeforeForChild(child); 2105 setLogicalHeight(child->logicalTop() - collapsedMargin); 2106 heightIncrease -= collapsedMargin; 2107 2107 } else 2108 2108 // Increase our height by the amount we had to clear. … … 2118 2118 marginInfo.setAtBeforeSideOfBlock(false); 2119 2119 } 2120 2121 return yPos + heightIncrease; 2120 2121 LayoutUnit logicalTop = yPos + heightIncrease; 2122 // After margin collapsing, one of our floats may now intrude into the child. If the child doesn't contain floats of its own it 2123 // won't get picked up for relayout even though the logical top estimate was wrong - so add the newly intruding float now. 2124 if (containsFloats() && child->isRenderBlock() && !toRenderBlock(child)->containsFloats() && lowestFloatLogicalBottom() > logicalTop) 2125 toRenderBlock(child)->addIntrudingFloats(this, logicalLeftOffsetForContent(), logicalTop); 2126 2127 return logicalTop; 2122 2128 } 2123 2129 … … 2280 2286 2281 2287 // If we can't collapse with children then go ahead and add in the bottom margin. 2288 // Don't do this for ordinary anonymous blocks as only the enclosing box should add in 2289 // its margin. 2282 2290 if (!marginInfo.canCollapseWithMarginAfter() && !marginInfo.canCollapseWithMarginBefore() 2291 && (!isAnonymousBlock() || isAnonymousColumnsBlock() || isAnonymousColumnSpanBlock()) 2283 2292 && (!document()->inQuirksMode() || !marginInfo.quirkContainer() || !marginInfo.marginAfterQuirk())) 2284 2293 setLogicalHeight(logicalHeight() + marginInfo.margin()); -
trunk/Source/WebCore/rendering/RenderBlock.h
r127155 r127163 931 931 bool canCollapseMarginBeforeWithChildren() const { return m_canCollapseMarginBeforeWithChildren; } 932 932 bool canCollapseMarginAfterWithChildren() const { return m_canCollapseMarginAfterWithChildren; } 933 void setCanCollapseMarginAfterWithChildren(bool collapse) { m_canCollapseMarginAfterWithChildren = collapse; } 933 934 bool quirkContainer() const { return m_quirkContainer; } 934 935 bool determinedMarginBeforeQuirk() const { return m_determinedMarginBeforeQuirk; }
Note: See TracChangeset
for help on using the changeset viewer.