border-image should not crash when the source is not specified.
authoralexis.menard@openbossa.org <alexis.menard@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 18:54:40 +0000 (18:54 +0000)
committeralexis.menard@openbossa.org <alexis.menard@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 18:54:40 +0000 (18:54 +0000)
commit248a668ef0bce632fba287bfad570c96ff2782ef
tree478dbd757ef027c6fb77288cf6cb8293ed2bd04a
parent05cf104c3d664da4377de73cd4ef4be1dfd8b015
border-image should not crash when the source is not specified.
https://bugs.webkit.org/show_bug.cgi?id=77001

Reviewed by Andreas Kling.

Source/WebCore:

This bug was introduced by r105502 but was exposed by r105738.
The image-source of a border-image is not mandatory therefore it
may happen that you have no value set for it. WebCore::createBorderImageValue
was wrongly assuming that the image is always set. This problem also required a bit
of refactoring in CSSStyleSelector::mapNinePieceImage to take into account that
the image could be optional (just like other properties).

Test: fast/css/border-image-null-image-crash.html

* css/CSSBorderImage.cpp:
(WebCore::createBorderImageValue):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::mapNinePieceImage):

LayoutTests:

Add a new test to cover this crash specifically.

* fast/css/border-image-null-image-crash-expected.txt: Added.
* fast/css/border-image-null-image-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/border-image-null-image-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/border-image-null-image-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSBorderImage.cpp
Source/WebCore/css/CSSStyleSelector.cpp