REGRESSION (r184895): Vertical border elements ([-webkit]-border-image set to 'repeat...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Jun 2015 23:50:33 +0000 (23:50 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Jun 2015 23:50:33 +0000 (23:50 +0000)
commit3495413b92f8488222ca83933f12f60dead7d2a7
treec4d9ee4c1dfe3bb6722bfd3468b6e727b19dd914
parentb328ec40e1272faecc8d2a4a6cd6ef291b5583f2
REGRESSION (r184895): Vertical border elements ([-webkit]-border-image set to 'repeat') that used to render perfectly are now rendering incorrectly.
https://bugs.webkit.org/show_bug.cgi?id=145801

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-06-10
Reviewed by Simon Fraser.

Source/WebCore:

When using the tiling to draw the sides of an image-border, the image slice
is repeated only in one direction. For top and bottom sides, the slice is
repeated horizontally and for left and right sides, it's repeated vertically.
The tile might be scaled in the other direction of the tiling if the border
extent and the slice extent are different in this direction.

The bug happens because we were scaling the tile in the tiling direction.

Test: fast/borders/border-image-repeat-stretch.html

* rendering/style/NinePieceImage.cpp:
(WebCore::NinePieceImage::scaleSlicesIfNeeded): Fix the type and the name
of deviceScaleFactor.

(WebCore::NinePieceImage::computeIntrinsicSideTileScale): Fix the scaling
direction of the border image side tiling.

* rendering/style/NinePieceImage.h:

LayoutTests:

* fast/borders/border-image-repeat-stretch-expected.html: Added.
* fast/borders/border-image-repeat-stretch.html: Added.
* fast/borders/resources/border-image-repeat-stretch-expected.svg: Added.
* fast/borders/resources/border-image.svg: Added.
Ensure that the sides of a border-images are drawn correctly in the cases
of 'repeat' and 'stretch'.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/borders/border-image-repeat-stretch-expected.html [new file with mode: 0644]
LayoutTests/fast/borders/border-image-repeat-stretch.html [new file with mode: 0644]
LayoutTests/fast/borders/resources/border-image-repeat-stretch-expected.svg [new file with mode: 0644]
LayoutTests/fast/borders/resources/border-image.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/style/NinePieceImage.cpp
Source/WebCore/rendering/style/NinePieceImage.h