Changeset 124347 in webkit


Ignore:
Timestamp:
Aug 1, 2012 11:16:58 AM (12 years ago)
Author:
robert@webkit.org
Message:

CSS 2.1 failure: margin-collapse-012 fails
https://bugs.webkit.org/show_bug.cgi?id=80219

Reviewed by Eric Seidel.

Source/WebCore:

Tests: css2.1/20110323/margin-collapse-012.htm

fast/css/margin-collapse-abspos-negmargin.htm

I also ran this against the full margin-collapse-* CSS 2.1 suite without regressions.

Per http://www.w3.org/TR/CSS21/box.html#collapsing-margins don't collapse the margins of
positioned blocks. Instead, just use the margin of the sibling/container to offset the
positioned block's logical top - its own margin gets added in later at
RenderBox::computePositionedLogicalHeightUsing().

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::adjustPositionedBlock):

LayoutTests:

  • css2.1/20110323/margin-collapse-012.htm: Added.
  • css2.1/20110323/margin-collapse-012-expected.html: Added.
  • fast/css/margin-collapse-abspos-negmargin-expected.html: Added.
  • fast/css/margin-collapse-abspos-negmargin.htm: Added.
  • fast/block/positioning/auto/001.html:
  • fast/block/positioning/auto/002.html:
  • fast/block/positioning/auto/vertical-lr/002.html:
  • fast/block/positioning/auto/vertical-rl/002.html:
  • fast/dynamic/staticY.html: Remove the margins from these tests so the results remain the same. The new results are consistent with FF.
  • platform/chromium-linux/fast/box-sizing/box-sizing-expected.png:
  • platform/chromium-win/compositing/overflow/clip-descendents-expected.txt:
  • platform/chromium-win/fast/box-sizing/box-sizing-expected.txt: I've rebaselined these - removing the margins doesn't seem helpful.
Location:
trunk
Files:
4 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r124340 r124347  
     12012-07-31  Robert Hogan  <robert@webkit.org>
     2
     3        CSS 2.1 failure: margin-collapse-012 fails
     4        https://bugs.webkit.org/show_bug.cgi?id=80219
     5
     6        Reviewed by Eric Seidel.
     7
     8        * css2.1/20110323/margin-collapse-012.htm: Added.
     9        * css2.1/20110323/margin-collapse-012-expected.html: Added.
     10        * fast/css/margin-collapse-abspos-negmargin-expected.html: Added.
     11        * fast/css/margin-collapse-abspos-negmargin.htm: Added.
     12
     13        * fast/block/positioning/auto/001.html:
     14        * fast/block/positioning/auto/002.html:
     15        * fast/block/positioning/auto/vertical-lr/002.html:
     16        * fast/block/positioning/auto/vertical-rl/002.html:
     17        * fast/dynamic/staticY.html:
     18          Remove the margins from these tests so the results remain the same. The new results
     19          are consistent with FF.
     20
     21        * platform/chromium-linux/fast/box-sizing/box-sizing-expected.png:
     22        * platform/chromium-win/compositing/overflow/clip-descendents-expected.txt:
     23        * platform/chromium-win/fast/box-sizing/box-sizing-expected.txt:
     24          I've rebaselined these - removing the margins doesn't seem helpful.
     25
    1262012-08-01  Xianzhu Wang  <wangxianzhu@chromium.org>
    227
  • trunk/LayoutTests/fast/block/positioning/auto/001.html

    r11995 r124347  
    88<div style="position:absolute;width:100px;height:200px;border:20px solid black;padding:50px;">
    99<div style="margin-bottom:50px"></div>
    10 <span style="position:absolute;margin-top:50px;width:100px;height:100px;background-color:green"></span>
     10<span style="position:absolute;width:100px;height:100px;background-color:green"></span>
    1111<div style="position:absolute;width:100px;height:100px;background-color:olive;top:0px"></div>
    1212<div style="position:absolute;width:100px;height:100px;background-color:olive;top:200px"></div>
  • trunk/LayoutTests/fast/block/positioning/auto/002.html

    r11995 r124347  
    88<div style="position:absolute;width:100px;height:200px;border:20px solid black;padding-top:50px;padding-bottom:50px;padding-left:px;padding-right:100px">
    99<div style="margin-bottom:50px"></div>
    10 <div style="margin-left:100px;position:absolute;margin-top:50px;width:100px;height:100px;background-color:green"></div>
     10<div style="margin-left:100px;position:absolute;width:100px;height:100px;background-color:green"></div>
    1111<div style="margin-left:100px;position:absolute;width:100px;height:100px;background-color:olive;top:0px"></div>
    1212<div style="margin-left:100px;position:absolute;width:100px;height:100px;background-color:olive;top:200px"></div>
  • trunk/LayoutTests/fast/block/positioning/auto/vertical-lr/002.html

    r79930 r124347  
    88<div style="position:absolute;height:100px;width:200px;border:20px solid black;padding-left:50px;padding-right:50px;padding-bottom:100px">
    99<div style="margin-right:50px"></div>
    10 <div style="margin-top:100px;position:absolute;margin-left:50px;width:100px;height:100px;background-color:green"></div>
     10<div style="margin-top:100px;position:absolute;width:100px;height:100px;background-color:green"></div>
    1111<div style="margin-top:100px;position:absolute;width:100px;height:100px;background-color:olive;left:0px"></div>
    1212<div style="margin-top:100px;position:absolute;width:100px;height:100px;background-color:olive;left:200px"></div>
  • trunk/LayoutTests/fast/block/positioning/auto/vertical-rl/002.html

    r79930 r124347  
    88<div style="position:absolute;height:100px;width:200px;border:20px solid black;padding-left:50px;padding-right:50px;padding-bottom:100px">
    99<div style="margin-left:50px"></div>
    10 <div style="margin-top:100px;position:absolute;margin-right:50px;width:100px;height:100px;background-color:green"></div>
     10<div style="margin-top:100px;position:absolute;width:100px;height:100px;background-color:green"></div>
    1111<div style="margin-top:100px;position:absolute;width:100px;height:100px;background-color:olive;right:0px"></div>
    1212<div style="margin-top:100px;position:absolute;width:100px;height:100px;background-color:olive;right:200px"></div>
  • trunk/LayoutTests/fast/dynamic/staticY.html

    r19148 r124347  
    5353        document.body.offsetTop;
    5454   
    55         t2.style.marginTop = "50px";
    5655        t3.style.height = "50px";
    5756        t4.style.height = "50px";
  • trunk/LayoutTests/platform/chromium-win/compositing/overflow/clip-descendents-expected.txt

    r116006 r124347  
    88      (children 6
    99        (GraphicsLayer
    10           (position 48.00 66.00)
     10          (position 48.00 82.00)
    1111          (bounds 60.00 70.00)
    1212          (children 1
     
    2020        )
    2121        (GraphicsLayer
    22           (position 240.00 66.00)
     22          (position 240.00 82.00)
    2323          (bounds 60.00 70.00)
    2424          (drawsContent 1)
    2525        )
    2626        (GraphicsLayer
    27           (position 240.00 66.00)
     27          (position 240.00 82.00)
    2828          (bounds 60.00 70.00)
    2929          (children 1
     
    3636        )
    3737        (GraphicsLayer
    38           (position 240.00 66.00)
     38          (position 240.00 82.00)
    3939          (bounds 60.00 70.00)
    4040          (children 1
  • trunk/LayoutTests/platform/chromium-win/fast/box-sizing/box-sizing-expected.txt

    r121722 r124347  
    7070        RenderBR {BR} at (120,0) size 0x19
    7171      RenderBlock {HR} at (0,897) size 769x3 [border: (1px inset #000000)]
    72 layer at (13,418) size 20x20
    73   RenderBlock (positioned) {DIV} at (13,417) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
    74 layer at (43,418) size 20x20
    75   RenderBlock (positioned) {DIV} at (43,417) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
    76 layer at (73,418) size 20x20
    77   RenderBlock (positioned) {DIV} at (73,417) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
    78 layer at (103,418) size 20x20
    79   RenderBlock (positioned) {DIV} at (103,417) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
     72layer at (13,428) size 20x20
     73  RenderBlock (positioned) {DIV} at (13,427) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
     74layer at (43,428) size 20x20
     75  RenderBlock (positioned) {DIV} at (43,427) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
     76layer at (73,428) size 20x20
     77  RenderBlock (positioned) {DIV} at (73,427) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
     78layer at (103,428) size 20x20
     79  RenderBlock (positioned) {DIV} at (103,427) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
    8080    RenderBR {BR} at (6,6) size 0x19
    8181    RenderBR {BR} at (6,26) size 0x19
    8282    RenderBR {BR} at (6,46) size 0x19
    83 layer at (13,757) size 20x20
    84   RenderImage {IMG} at (13,757) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
    85 layer at (43,757) size 20x20
    86   RenderImage {IMG} at (43,757) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
    87 layer at (73,757) size 20x20
    88   RenderImage {IMG} at (73,757) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
    89 layer at (103,757) size 20x20
    90   RenderImage {IMG} at (103,757) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
     83layer at (13,767) size 20x20
     84  RenderImage {IMG} at (13,767) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
     85layer at (43,767) size 20x20
     86  RenderImage {IMG} at (43,767) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
     87layer at (73,767) size 20x20
     88  RenderImage {IMG} at (73,767) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
     89layer at (103,767) size 20x20
     90  RenderImage {IMG} at (103,767) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r124340 r124347  
    35043504// Started failing after http://trac.webkit.org/changeset/124314
    35053505BUGWK92863 : fast/forms/input-widths.html = TEXT
     3506
     3507// Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=80219
     3508BUGWK80219 MAC WIN : fast/box-sizing/box-sizing.html = IMAGE+TEXT
     3509BUGWK80219 MAC : compositing/overflow/clip-descendents.html = TEXT
  • trunk/LayoutTests/platform/efl/TestExpectations

    r124294 r124347  
    831831// This test depends on subpixel layout.
    832832BUGWK92352 : css3/flexbox/flex-rounding.html = TEXT
     833
     834// Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=80219
     835BUGWK80219 : fast/box-sizing/box-sizing.html = IMAGE+TEXT
     836BUGWK80219 : compositing/overflow/clip-descendents.html = TEXT
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r124311 r124347  
    3636// Tests that require new results.
    3737//////////////////////////////////////////////////////////////////////////////////////////
     38
     39// Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=80219
     40BUGWK80219 : fast/box-sizing/box-sizing.html = IMAGE+TEXT
     41BUGWK80219 : compositing/overflow/clip-descendents.html = TEXT
    3842
    3943//////////////////////////////////////////////////////////////////////////////////////////
  • trunk/LayoutTests/platform/mac/TestExpectations

    r123452 r124347  
    306306// Layout Test css3/filters/custom/custom-filter-animation.html is failing
    307307BUGWK84813 : css3/filters/custom/custom-filter-animation.html = TEXT
     308
     309// Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=80219
     310BUGWK80219 : fast/box-sizing/box-sizing.html = IMAGE+TEXT
     311BUGWK80219 : compositing/overflow/clip-descendents.html = TEXT
  • trunk/LayoutTests/platform/qt/TestExpectations

    r124317 r124347  
    125125
    126126BUGWK85811 DEBUG : fast/events/message-port-close.html = CRASH
     127
     128// Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=80219
     129BUGWK80219 : fast/box-sizing/box-sizing.html = IMAGE+TEXT
     130BUGWK80219 : compositing/overflow/clip-descendents.html = TEXT
  • trunk/Source/WebCore/ChangeLog

    r124342 r124347  
     12012-07-31  Robert Hogan  <robert@webkit.org>
     2
     3        CSS 2.1 failure: margin-collapse-012 fails
     4        https://bugs.webkit.org/show_bug.cgi?id=80219
     5
     6        Reviewed by Eric Seidel.
     7
     8        Tests: css2.1/20110323/margin-collapse-012.htm
     9               fast/css/margin-collapse-abspos-negmargin.htm
     10
     11        I also ran this against the full margin-collapse-* CSS 2.1 suite without regressions.
     12
     13        Per http://www.w3.org/TR/CSS21/box.html#collapsing-margins don't collapse the margins of
     14        positioned blocks. Instead, just use the margin of the sibling/container to offset the
     15        positioned block's logical top - its own margin gets added in later at
     16        RenderBox::computePositionedLogicalHeightUsing().
     17
     18        * rendering/RenderBlock.cpp:
     19        (WebCore::RenderBlock::adjustPositionedBlock):
     20
    1212012-08-01  Sheriff Bot  <webkit.review.bot@gmail.com>
    222
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r124168 r124347  
    16921692
    16931693    if (!marginInfo.canCollapseWithMarginBefore()) {
    1694         child->computeBlockDirectionMargins(this);
    1695         LayoutUnit marginBefore = marginBeforeForChild(child);
     1694        // Positioned blocks don't collapse margins, so add the margin provided by
     1695        // the container now. The child's own margin is added later when calculating its logical top.
    16961696        LayoutUnit collapsedBeforePos = marginInfo.positiveMargin();
    16971697        LayoutUnit collapsedBeforeNeg = marginInfo.negativeMargin();
    1698         if (marginBefore > 0) {
    1699             if (marginBefore > collapsedBeforePos)
    1700                 collapsedBeforePos = marginBefore;
    1701         } else {
    1702             if (-marginBefore > collapsedBeforeNeg)
    1703                 collapsedBeforeNeg = -marginBefore;
    1704         }
    1705         logicalTop += (collapsedBeforePos - collapsedBeforeNeg) - marginBefore;
     1698        logicalTop += collapsedBeforePos - collapsedBeforeNeg;
    17061699    }
    17071700   
Note: See TracChangeset for help on using the changeset viewer.