Repeated background images have the wrong position when using bottom/right-relative...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Feb 2016 22:26:23 +0000 (22:26 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Feb 2016 22:26:23 +0000 (22:26 +0000)
commitcc5aa869f6767266692626311a1de71d3f90bc5d
tree01cabb4748264f7013a8f0b85f3b45629c51a9cb
parent46270181451df21fd3c17cc650bf9c4b41d0e11f
Repeated background images have the wrong position when using bottom/right-relative background-position
https://bugs.webkit.org/show_bug.cgi?id=154478

Reviewed by Dave Hyatt.
Source/WebCore:

Fix RenderBoxModelObject::calculateBackgroundImageGeometry() to use the right position when
painting repeated background images when right/bottom edges are used.

Also rename BackgroundEdgeOrigin to Edge

Test: fast/images/background-position.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator Edge):
(WebCore::CSSPrimitiveValue::operator BackgroundEdgeOrigin): Deleted.
* rendering/RenderBoxModelObject.cpp:
(WebCore::resolveEdgeRelativeLength):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::FillLayer):
* rendering/style/FillLayer.h:
(WebCore::FillLayer::backgroundXOrigin):
(WebCore::FillLayer::backgroundYOrigin):
(WebCore::FillLayer::setBackgroundXOrigin):
(WebCore::FillLayer::setBackgroundYOrigin):
* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* rendering/style/RenderStyleConstants.h:

LayoutTests:

Enhanced background-position-serialize.html to test values that use right/bottom edge specifiers.

Ref test for background-position.

* fast/css/background-position-serialize-expected.txt:
* fast/css/background-position-serialize.html:
* fast/images/background-position-expected.html: Added.
* fast/images/background-position.html: Added.
* fast/images/resources/checker.png: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/background-position-serialize-expected.txt
LayoutTests/fast/css/background-position-serialize.html
LayoutTests/fast/images/background-position-expected.html [new file with mode: 0644]
LayoutTests/fast/images/background-position.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/style/FillLayer.cpp
Source/WebCore/rendering/style/FillLayer.h
Source/WebCore/rendering/style/RenderStyleConstants.cpp
Source/WebCore/rendering/style/RenderStyleConstants.h