Source/WebCore: [CSS Masking] -webkit-mask-repeat: space does not work
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Aug 2013 12:58:10 +0000 (12:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Aug 2013 12:58:10 +0000 (12:58 +0000)
commit6f4a90aeb11623b6a155d88e9583ae901e73a073
tree0d6d6940cb218ca854469d485d751ac8b052da91
parent0aba6f4d2b915f29d7715399ae5e43170bc26980
Source/WebCore: [CSS Masking] -webkit-mask-repeat: space does not work
Added the space option to background-repeat and -webkit-mask-repeat.
With the property value 'space', the background or mask image gets repeated as often as it fits within the background positioning
area. The repeated images are spaced equally to fill the unused area.
https://bugs.webkit.org/show_bug.cgi?id=119324

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

Tests: css3/background/background-repeat-space-border.html
       css3/background/background-repeat-space-content.html
       css3/background/background-repeat-space-padding.html
       css3/masking/mask-repeat-space-border.html
       css3/masking/mask-repeat-space-content.html
       css3/masking/mask-repeat-space-padding.html

* platform/graphics/GeneratorGeneratedImage.cpp:
(WebCore::GeneratorGeneratedImage::drawPattern): Passed the space values to the image buffer.
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled): Added the space values when computing the location of the tile.
* platform/graphics/Image.h: Added the space property.
(WebCore::Image::spaceSize):
(WebCore::Image::setSpaceSize):
* platform/graphics/ImageBuffer.h: Added the space property.
(WebCore::ImageBuffer::spaceSize):
(WebCore::ImageBuffer::setSpaceSize):
* platform/graphics/cg/ImageBufferCG.cpp: Passed the space values when copying an image.
(WebCore::ImageBuffer::copyImage):
* platform/graphics/cg/ImageCG.cpp: Added the space values when creating a platform pattern.
(WebCore::Image::drawPattern):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended): Computed the space values on x and y axis.
(WebCore::getSpace):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Pass the space values to the Image class.
* rendering/RenderBoxModelObject.h: Added the space property.
(WebCore::RenderBoxModelObject::BackgroundImageGeometry::spaceSize):
(WebCore::RenderBoxModelObject::BackgroundImageGeometry::setSpaceSize):
* svg/graphics/SVGImage.cpp: Passed the space property to the created image.
(WebCore::SVGImage::drawPatternForContainer):
* svg/graphics/SVGImageForContainer.cpp: Passed the space property to the image property.
(WebCore::SVGImageForContainer::drawPattern):

LayoutTests: [CSS Masking] -webkit-mask-repeat: space does not work
Added tests to verify correct usage of background-repeat: space and mask-repeat: space.
Added one test for each possible mask/background clip: border, padding and content
https://bugs.webkit.org/show_bug.cgi?id=119324

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

* css3/background/background-repeat-space-border-expected.html: Added.
* css3/background/background-repeat-space-border.html: Added.
* css3/background/background-repeat-space-content-expected.html: Added.
* css3/background/background-repeat-space-content.html: Added.
* css3/background/background-repeat-space-padding-expected.html: Added.
* css3/background/background-repeat-space-padding.html: Added.
* css3/masking/mask-repeat-space-border-expected.html: Added.
* css3/masking/mask-repeat-space-border.html: Added.
* css3/masking/mask-repeat-space-content-expected.html: Added.
* css3/masking/mask-repeat-space-content.html: Added.
* css3/masking/mask-repeat-space-padding-expected.html: Added.
* css3/masking/mask-repeat-space-padding.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/background/background-repeat-space-border-expected.html [new file with mode: 0644]
LayoutTests/css3/background/background-repeat-space-border.html [new file with mode: 0644]
LayoutTests/css3/background/background-repeat-space-content-expected.html [new file with mode: 0644]
LayoutTests/css3/background/background-repeat-space-content.html [new file with mode: 0644]
LayoutTests/css3/background/background-repeat-space-padding-expected.html [new file with mode: 0644]
LayoutTests/css3/background/background-repeat-space-padding.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-repeat-space-border-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-repeat-space-border.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-repeat-space-content-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-repeat-space-content.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-repeat-space-padding-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-repeat-space-padding.html [new file with mode: 0644]
LayoutTests/css3/masking/resources/circle.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp
Source/WebCore/platform/graphics/Image.cpp
Source/WebCore/platform/graphics/Image.h
Source/WebCore/platform/graphics/ImageBuffer.h
Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
Source/WebCore/platform/graphics/cg/ImageCG.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderBoxModelObject.h
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebCore/svg/graphics/SVGImageForContainer.cpp