border-image should be implemented like a shorthand.
authoralexis.menard@openbossa.org <alexis.menard@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 19:11:10 +0000 (19:11 +0000)
committeralexis.menard@openbossa.org <alexis.menard@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 19:11:10 +0000 (19:11 +0000)
commit2d9de4187863998426a5c6fb24fb62341d3a1760
tree9b48cfc6e3f84a2a06691332ed62b52e25115372
parent61860a45690305425873ad953bd18ac712448861
border-image should be implemented like a shorthand.
https://bugs.webkit.org/show_bug.cgi?id=76697

Reviewed by Tony Chang.

Source/WebCore:

Make sure that border-image is implemented like a shorthand : when we parse
it we set the correct value to its longhands. The code was not doing it
previously as we inherited the old implementation of -webkit-border-image which
is not a shorthand but a regular property. It will then increase
style.length for a given element as we now expand the longhands.
The behavior stays the same for -webkit-border-image.

Test: fast/css/border-image-style-length.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::BorderImageParseContext::BorderImageParseContext):
(WebCore::BorderImageParseContext::commitWebKitBorderImage):
(WebCore::BorderImageParseContext::commitBorderImage):
(BorderImageParseContext):
(WebCore::BorderImageParseContext::commitBorderImageProperty):
(WebCore::CSSParser::parseBorderImage):
* css/CSSParser.h:
():
* css/CSSPropertyLonghand.cpp:
(WebCore::initShorthandMap):
* css/CSSStyleApplyProperty.cpp:
():
(WebCore::ApplyPropertyExpanding::applyInheritValue):
(WebCore::ApplyPropertyExpanding::applyInitialValue):
(WebCore::ApplyPropertyExpanding::applyValue):
(WebCore::ApplyPropertyBorderImageModifier::applyInitialValue):
(WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::mapNinePieceImage):
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::ensurePropertyMap):
(WebCore::addShorthandProperties):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyleBitfields::borderImageSlices):
(WebCore::RenderStyleBitfields::borderImageWidth):
(WebCore::RenderStyleBitfields::borderImageOutset):
(RenderStyleBitfields):
(WebCore::RenderStyleBitfields::setBorderImageSlices):
(WebCore::RenderStyleBitfields::setBorderImageWidth):
(WebCore::RenderStyleBitfields::setBorderImageOutset):

LayoutTests:

Make sure we cover that border-image correctly expands its longhands.

* fast/css/border-image-style-length-expected.txt: Added.
* fast/css/border-image-style-length.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105901 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/border-image-style-length-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/border-image-style-length.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSPropertyLonghand.cpp
Source/WebCore/css/CSSStyleApplyProperty.cpp
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/page/animation/AnimationBase.cpp
Source/WebCore/rendering/style/RenderStyle.h