Changeset 156097 in webkit


Ignore:
Timestamp:
Sep 19, 2013 7:41:36 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Masking/Background] Position property should be ignored when using repeat: space
https://bugs.webkit.org/show_bug.cgi?id=120623

Source/WebCore:

The background/mask-position should be ignored when using repeat: space,
unless there is not enough space for two copies of the image. In that case,
only one image is placed and background/mask-position determines its position.

Patch by Andrei Parvu <parvu@adobe.com> on 2013-09-19
Reviewed by Dirk Schulze.

Test: css3/masking/mask-repeat-one-copy.html

  • rendering/RenderBoxModelObject.cpp: Ignored position property if space value is positive, set no-repeat otherwise.

(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):

LayoutTests:

Patch by Andrei Parvu <parvu@adobe.com> on 2013-09-19
Reviewed by Dirk Schulze.

  • css3/masking/mask-repeat-one-copy-expected.html:
  • css3/masking/mask-repeat-one-copy.html: Only one copy of the mask should be drawn, and background position should determine its position.
  • css3/masking/mask-repeat-space-padding.html: Added a mask-position which should be ignored.
Location:
trunk
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r156096 r156097  
     12013-09-19  Andrei Parvu  <parvu@adobe.com>
     2
     3        [CSS Masking/Background] Position property should be ignored when using repeat: space
     4        https://bugs.webkit.org/show_bug.cgi?id=120623
     5
     6        Reviewed by Dirk Schulze.
     7
     8        * css3/masking/mask-repeat-one-copy-expected.html:
     9        * css3/masking/mask-repeat-one-copy.html: Only one copy of the mask should be drawn, and background position should determine its position.
     10        * css3/masking/mask-repeat-space-padding.html: Added a mask-position which should be ignored.
     11
    1122013-09-19  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
    213
  • trunk/LayoutTests/css3/masking/mask-repeat-one-copy-expected.html

    r156096 r156097  
    1515                padding: 50px;
    1616                -webkit-mask-image: url("resources/circle.png");
    17                 -webkit-mask-size: 153px 127px;
    18                 -webkit-mask-repeat: space;
     17                -webkit-mask-size: 400px 300px;
     18                -webkit-mask-repeat: no-repeat;
    1919                -webkit-mask-origin: padding-box;
     20                -webkit-mask-position: 100px 100px;
    2021                -webkit-mask-clip: padding-box;
    2122            }
  • trunk/LayoutTests/css3/masking/mask-repeat-one-copy.html

    r156096 r156097  
    1515                padding: 50px;
    1616                -webkit-mask-image: url("resources/circle.png");
    17                 -webkit-mask-size: 153px 127px;
     17                -webkit-mask-size: 400px 300px;
    1818                -webkit-mask-repeat: space;
    1919                -webkit-mask-origin: padding-box;
     20                -webkit-mask-position: 100px 100px;
    2021                -webkit-mask-clip: padding-box;
    2122            }
  • trunk/LayoutTests/css3/masking/mask-repeat-space-padding.html

    r154875 r156097  
    1818                -webkit-mask-repeat: space;
    1919                -webkit-mask-origin: padding-box;
     20                -webkit-mask-position: 150px 150px; /* This should be igonored because of repeat: space */
    2021                -webkit-mask-clip: padding-box;
    2122            }
  • trunk/Source/WebCore/ChangeLog

    r156095 r156097  
     12013-09-19  Andrei Parvu  <parvu@adobe.com>
     2
     3        [CSS Masking/Background] Position property should be ignored when using repeat: space
     4        https://bugs.webkit.org/show_bug.cgi?id=120623
     5
     6        The background/mask-position should be ignored when using repeat: space,
     7        unless there is not enough space for two copies of the image. In that case,
     8        only one image is placed and background/mask-position determines its position.
     9
     10        Reviewed by Dirk Schulze.
     11
     12        Test: css3/masking/mask-repeat-one-copy.html
     13
     14        * rendering/RenderBoxModelObject.cpp: Ignored position property if space value is positive, set no-repeat otherwise.
     15        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
     16
    1172013-09-19  Andreas Kling  <akling@apple.com>
    218
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r155802 r156097  
    10381038{
    10391039    int numberOfTiles = areaSize / tileSize;
    1040     int space = 0;
     1040    int space = -1;
    10411041
    10421042    if (numberOfTiles > 1)
     
    11581158        int actualWidth = geometry.tileSize().width() + space;
    11591159
    1160         geometry.setSpaceSize(FloatSize(space, 0));
    1161         geometry.setPhaseX(actualWidth ? actualWidth - roundToInt(computedXPosition + left) % actualWidth : 0);
    1162     } else if (backgroundRepeatX == NoRepeatFill) {
     1160        if (space >= 0) {
     1161            computedXPosition = minimumValueForLength(Length(), availableWidth, &view(), true);
     1162            geometry.setSpaceSize(FloatSize(space, 0));
     1163            geometry.setPhaseX(actualWidth ? actualWidth - roundToInt(computedXPosition + left) % actualWidth : 0);
     1164        } else
     1165            backgroundRepeatX = NoRepeatFill;
     1166    }
     1167    if (backgroundRepeatX == NoRepeatFill) {
    11631168        int xOffset = fillLayer->backgroundXOrigin() == RightEdge ? availableWidth - computedXPosition : computedXPosition;
    11641169        geometry.setNoRepeatX(left + xOffset);
     
    11731178        int actualHeight = geometry.tileSize().height() + space;
    11741179
    1175         geometry.setSpaceSize(FloatSize(geometry.spaceSize().width(), space));
    1176         geometry.setPhaseY(actualHeight ? actualHeight - roundToInt(computedYPosition + top) % actualHeight : 0);
    1177     } else if (backgroundRepeatY == NoRepeatFill) {
     1180        if (space >= 0) {
     1181            computedYPosition = minimumValueForLength(Length(), availableHeight, &view(), true);
     1182            geometry.setSpaceSize(FloatSize(geometry.spaceSize().width(), space));
     1183            geometry.setPhaseY(actualHeight ? actualHeight - roundToInt(computedYPosition + top) % actualHeight : 0);
     1184        } else
     1185            backgroundRepeatY = NoRepeatFill;
     1186    }
     1187    if (backgroundRepeatY == NoRepeatFill) {
    11781188        int yOffset = fillLayer->backgroundYOrigin() == BottomEdge ? availableHeight - computedYPosition : computedYPosition;
    11791189        geometry.setNoRepeatY(top + yOffset);
Note: See TracChangeset for help on using the changeset viewer.