Changeset 121296 in webkit


Ignore:
Timestamp:
Jun 26, 2012 4:08:09 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

background-size:0 shows as 1px instead of invisible
https://bugs.webkit.org/show_bug.cgi?id=86942

Patch by Joe Thomas <joethomas@motorola.com> on 2012-06-26
Reviewed by Eric Seidel.

As per the specification http://www.w3.org/TR/css3-background/#background-size, if the background image's width or height resolves to zero,
this causes the image not to be displayed. The effect should be the same as if it had been a transparent image.
This is also mentioned in http://www.w3.org/TR/2002/WD-css3-background-20020802/#background-size.

Source/WebCore:

Test: fast/backgrounds/zero-background-size.html

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::calculateFillTileSize):

LayoutTests:

  • fast/backgrounds/size/zero.html:
  • fast/backgrounds/zero-background-size-expected.html: Added.
  • fast/backgrounds/zero-background-size.html: Added.
  • platform/chromium/TestExpectations:
  • platform/efl/TestExpectations:
  • platform/gtk/TestExpectations:
  • platform/mac/fast/backgrounds/size/zero-expected.png:
  • platform/mac/fast/backgrounds/size/zero-expected.txt:
  • platform/qt/TestExpectations:
Location:
trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r121290 r121296  
     12012-06-26  Joe Thomas  <joethomas@motorola.com>
     2
     3        background-size:0 shows as 1px instead of invisible
     4        https://bugs.webkit.org/show_bug.cgi?id=86942
     5
     6        Reviewed by Eric Seidel.
     7
     8        As per the specification http://www.w3.org/TR/css3-background/#background-size, if the background image's width or height resolves to zero,
     9        this causes the image not to be displayed. The effect should be the same as if it had been a transparent image.
     10        This is also mentioned in http://www.w3.org/TR/2002/WD-css3-background-20020802/#background-size.
     11
     12        * fast/backgrounds/size/zero.html:
     13        * fast/backgrounds/zero-background-size-expected.html: Added.
     14        * fast/backgrounds/zero-background-size.html: Added.
     15        * platform/chromium/TestExpectations:
     16        * platform/efl/TestExpectations:
     17        * platform/gtk/TestExpectations:
     18        * platform/mac/fast/backgrounds/size/zero-expected.png:
     19        * platform/mac/fast/backgrounds/size/zero-expected.txt:
     20        * platform/qt/TestExpectations:
     21
    1222012-06-26  Ryosuke Niwa  <rniwa@webkit.org>
    223
  • trunk/LayoutTests/fast/backgrounds/size/zero.html

    r27251 r121296  
    66</p>
    77<p>
    8     There should be four blue squares with black borders. WebKit should not hang or assert.
     8    There should be four empty squares with black borders. WebKit should not hang or assert.
    99</p>
    10 <div style="-webkit-background-size: 0 0;"></div>
    11 <div style="-webkit-background-size: 0 32px;"></div>
    12 <div style="-webkit-background-size: 2px 0;"></div>
    13 <div style="-webkit-background-size: auto 8px;"></div>
     10<div style="background-size: 0 0;"></div>
     11<div style="background-size: 0 32px;"></div>
     12<div style="background-size: 2px 0;"></div>
     13<div style="background-size: auto 8px;"></div>
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r121289 r121296  
    37303730BUGWK89167 : media/track/track-cue-rendering-snap-to-lines-not-set.html = TEXT
    37313731
     3732// Needs Rebaseline after bug 86942
     3733BUGWK86942 : fast/backgrounds/size/zero.html = IMAGE+TEXT
     3734
    37323735// Timing out on some Windows bots
    37333736BUGWK89510 WIN : gamepad/gamepad-polling-access.html = PASS TIMEOUT
  • trunk/LayoutTests/platform/efl/TestExpectations

    r121289 r121296  
    701701BUGWK88729 SKIP : userscripts/window-onerror-for-isolated-world-2.html = PASS
    702702
     703// Needs Rebaseline after bug 86942
     704BUGWK86942 : fast/backgrounds/size/zero.html = IMAGE+TEXT
     705
    703706// Needs rebaseline after the bots cycle.
    704707BUG_OJAN : tables/mozilla/bugs/bug131020.html = TEXT IMAGE IMAGE+TEXT
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r121289 r121296  
    12351235BUGWK57346 : fast/text/justify-ideograph-leading-expansion.html = TEXT
    12361236
     1237// Needs Rebaseline after bug 86942
     1238BUGWK86942 : fast/backgrounds/size/zero.html = TEXT
     1239
    12371240BUGWK83800 : plugins/get-url-with-blank-target.html = TEXT
    12381241
  • trunk/LayoutTests/platform/mac/fast/backgrounds/size/zero-expected.txt

    r30635 r121296  
    1616          text run at (580,0) width 4: "."
    1717      RenderBlock {P} at (0,34) size 784x18
    18         RenderText {#text} at (0,0) size 558x18
    19           text run at (0,0) width 558: "There should be four blue squares with black borders. WebKit should not hang or assert."
     18        RenderText {#text} at (0,0) size 570x18
     19          text run at (0,0) width 570: "There should be four empty squares with black borders. WebKit should not hang or assert."
    2020      RenderBlock {DIV} at (8,68) size 106x106 [border: (3px solid #000000)]
    2121      RenderBlock {DIV} at (8,182) size 106x106 [border: (3px solid #000000)]
  • trunk/LayoutTests/platform/qt/TestExpectations

    r121289 r121296  
    9292BUGWK86722 SKIP : fast/images/paletted-png-with-color-profile.html = PASS
    9393
     94// Needs Rebaseline after bug 86942
     95BUGWK86942 : fast/backgrounds/size/zero.html = TEXT
     96
    9497// Needs rebaseline after the bots cycle.
    9598BUG_OJAN : tables/mozilla/bugs/bug131020.html = PASS TEXT IMAGE IMAGE+TEXT
  • trunk/Source/WebCore/ChangeLog

    r121295 r121296  
     12012-06-26  Joe Thomas  <joethomas@motorola.com>
     2
     3        background-size:0 shows as 1px instead of invisible
     4        https://bugs.webkit.org/show_bug.cgi?id=86942
     5
     6        Reviewed by Eric Seidel.
     7
     8        As per the specification http://www.w3.org/TR/css3-background/#background-size, if the background image's width or height resolves to zero,
     9        this causes the image not to be displayed. The effect should be the same as if it had been a transparent image.
     10        This is also mentioned in http://www.w3.org/TR/2002/WD-css3-background-20020802/#background-size.
     11
     12        Test: fast/backgrounds/zero-background-size.html
     13
     14        * rendering/RenderBoxModelObject.cpp:
     15        (WebCore::RenderBoxModelObject::calculateFillTileSize):
     16
    1172012-06-26  Adam Klein  <adamk@chromium.org>
    218
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r121123 r121296  
    10711071            }
    10721072           
    1073             return IntSize(max(1, w), max(1, h));
     1073            return IntSize(max(0, w), max(0, h));
    10741074        }
    10751075        case SizeNone: {
Note: See TracChangeset for help on using the changeset viewer.