https://bugs.webkit.org/show_bug.cgi?id=67300
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Aug 2011 18:11:35 +0000 (18:11 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Aug 2011 18:11:35 +0000 (18:11 +0000)
Add the new border-image-source property (and its corresponding analogue for masks, mask-box-image-source).
Change the border-image parsing code to no longer consider "none" to represent the entire border-image
expression, but instead to just mean "none" for the image component of the expression.

Change the pending image code for border-image and mask-box-image to use the new *-source properties when
loading the image so that they're considered the same.

This is the first step towards eliminating the border-image parsing code in favor of just parsing it as
a shorthand instead, but for now I'm implementing each property one by one, and once they're all there,
we can cut over to border-image as a true shorthand.

Reviewed by Beth Dakin.

Added fast/borders/border-image-source.html.

Source/WebCore:

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseBorderImage):
* css/CSSPropertyNames.in:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
(WebCore::CSSStyleSelector::mapNinePieceImage):
(WebCore::CSSStyleSelector::loadPendingImages):
* rendering/style/NinePieceImage.h:
(WebCore::NinePieceImage::setImage):
* rendering/style/RenderStyle.h:
(WebCore::InheritedFlags::borderImageSource):
(WebCore::InheritedFlags::maskBoxImageSource):
(WebCore::InheritedFlags::setBorderImageSource):
(WebCore::InheritedFlags::setMaskBoxImageSource):
(WebCore::InheritedFlags::initialBorderImageSource):
(WebCore::InheritedFlags::initialMaskBoxImageSource):

LayoutTests:

* fast/borders/border-image-source.html: Added.
* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* svg/css/getComputedStyle-basic-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94206 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/borders/border-image-source.html [new file with mode: 0644]
LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt
LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
LayoutTests/platform/mac/fast/borders/border-image-source-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/borders/border-image-source-expected.txt [new file with mode: 0644]
LayoutTests/svg/css/getComputedStyle-basic-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/rendering/style/NinePieceImage.h
Source/WebCore/rendering/style/RenderStyle.h

index 4062f89..a12aaa5 100644 (file)
@@ -1,3 +1,27 @@
+2011-08-31  David Hyatt  <hyatt@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=67300
+        
+        Add the new border-image-source property (and its corresponding analogue for masks, mask-box-image-source).
+        Change the border-image parsing code to no longer consider "none" to represent the entire border-image
+        expression, but instead to just mean "none" for the image component of the expression.
+        
+        Change the pending image code for border-image and mask-box-image to use the new *-source properties when
+        loading the image so that they're considered the same.
+        
+        This is the first step towards eliminating the border-image parsing code in favor of just parsing it as
+        a shorthand instead, but for now I'm implementing each property one by one, and once they're all there,
+        we can cut over to border-image as a true shorthand.
+
+        Reviewed by Beth Dakin.
+
+        Added fast/borders/border-image-source.html.
+
+        * fast/borders/border-image-source.html: Added.
+        * fast/css/getComputedStyle/computed-style-expected.txt:
+        * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
+        * svg/css/getComputedStyle-basic-expected.txt:
+
 2011-08-31  Cary Clark  <caryclark@google.com>
 
         Unreviewed; new baselines (Skia on Mac, remainder of fast directory)
diff --git a/LayoutTests/fast/borders/border-image-source.html b/LayoutTests/fast/borders/border-image-source.html
new file mode 100644 (file)
index 0000000..c044698
--- /dev/null
@@ -0,0 +1,37 @@
+<html>
+<head>
+    <style>
+        div {
+            border-width: 21px 30px 30px 21px;
+            width: 75px;
+            height: 75px;
+            margin: 10px;
+            display: inline-block;
+            border-image-source: url("resources/border-image.png") !important
+        }
+
+        div.rr {
+            -webkit-border-image: none 21 30 30 21 repeat repeat;
+        }
+
+        div.rs {
+            -webkit-border-image: none 21 30 30 21 repeat stretch;
+        }
+
+        div.sr {
+            -webkit-border-image: none 21 30 30 21 stretch repeat;
+        }
+
+        div.ss {
+            -webkit-border-image: none 21 30 30 21 stretch stretch;
+        }
+    </style>
+</head>
+<body>
+    <div class="rr"></div>
+    <div class="rs"></div>
+    <br>
+    <div class="sr"></div>
+    <div class="ss"></div>
+</body>
+</html>
index b3d9307..6ad6586 100644 (file)
@@ -14,6 +14,7 @@ border-bottom-right-radius: 0px;
 border-bottom-style: none;
 border-bottom-width: 0px;
 border-collapse: separate;
+border-image-source: none;
 border-left-color: rgb(0, 0, 0);
 border-left-style: none;
 border-left-width: 0px;
@@ -154,6 +155,7 @@ zoom: 1;
 -webkit-marquee-style: scroll;
 -webkit-mask-attachment: scroll;
 -webkit-mask-box-image: none;
+-webkit-mask-box-image-source: none;
 -webkit-mask-clip: border-box;
 -webkit-mask-composite: source-over;
 -webkit-mask-image: none;
index f2f4daa..553afa1 100644 (file)
@@ -13,6 +13,7 @@ Computed style of an element whose parent's 'display' value is 'none':
     border-bottom-style: none
     border-bottom-width: 0px
     border-collapse: separate
+    border-image-source: none
     border-left-color: rgb(0, 0, 0)
     border-left-style: none
     border-left-width: 0px
@@ -153,6 +154,7 @@ Computed style of an element whose parent's 'display' value is 'none':
     -webkit-marquee-style: scroll
     -webkit-mask-attachment: scroll
     -webkit-mask-box-image: none
+    -webkit-mask-box-image-source: none
     -webkit-mask-clip: border-box
     -webkit-mask-composite: source-over
     -webkit-mask-image: none
diff --git a/LayoutTests/platform/mac/fast/borders/border-image-source-expected.png b/LayoutTests/platform/mac/fast/borders/border-image-source-expected.png
new file mode 100644 (file)
index 0000000..3807c6d
Binary files /dev/null and b/LayoutTests/platform/mac/fast/borders/border-image-source-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/borders/border-image-source-expected.txt b/LayoutTests/platform/mac/fast/borders/border-image-source-expected.txt
new file mode 100644 (file)
index 0000000..37927aa
--- /dev/null
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (10,10) size 126x126 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
+      RenderText {#text} at (146,132) size 4x18
+        text run at (146,132) width 4: " "
+      RenderBlock {DIV} at (160,10) size 126x126 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
+      RenderText {#text} at (296,132) size 4x18
+        text run at (296,132) width 4: " "
+      RenderBR {BR} at (0,0) size 0x0
+      RenderBlock {DIV} at (10,160) size 126x126 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
+      RenderText {#text} at (146,282) size 4x18
+        text run at (146,282) width 4: " "
+      RenderBlock {DIV} at (160,160) size 126x126 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
+      RenderText {#text} at (0,0) size 0x0
index fa52528..a5995e7 100644 (file)
@@ -26,6 +26,8 @@ rect: style.getPropertyValue(border-bottom-width) : 0px
 rect: style.getPropertyCSSValue(border-bottom-width) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(border-collapse) : separate
 rect: style.getPropertyCSSValue(border-collapse) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(border-image-source) : none
+rect: style.getPropertyCSSValue(border-image-source) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(border-left-color) : rgb(0, 0, 0)
 rect: style.getPropertyCSSValue(border-left-color) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(border-left-style) : none
@@ -306,6 +308,8 @@ rect: style.getPropertyValue(-webkit-mask-attachment) : scroll
 rect: style.getPropertyCSSValue(-webkit-mask-attachment) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-mask-box-image) : none
 rect: style.getPropertyCSSValue(-webkit-mask-box-image) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(-webkit-mask-box-image-source) : none
+rect: style.getPropertyCSSValue(-webkit-mask-box-image-source) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-mask-clip) : border-box
 rect: style.getPropertyCSSValue(-webkit-mask-clip) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-mask-composite) : source-over
@@ -484,6 +488,8 @@ g: style.getPropertyValue(border-bottom-width) : 0px
 g: style.getPropertyCSSValue(border-bottom-width) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(border-collapse) : separate
 g: style.getPropertyCSSValue(border-collapse) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(border-image-source) : none
+g: style.getPropertyCSSValue(border-image-source) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(border-left-color) : rgb(0, 0, 0)
 g: style.getPropertyCSSValue(border-left-color) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(border-left-style) : none
@@ -764,6 +770,8 @@ g: style.getPropertyValue(-webkit-mask-attachment) : scroll
 g: style.getPropertyCSSValue(-webkit-mask-attachment) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-mask-box-image) : none
 g: style.getPropertyCSSValue(-webkit-mask-box-image) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(-webkit-mask-box-image-source) : none
+g: style.getPropertyCSSValue(-webkit-mask-box-image-source) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-mask-clip) : border-box
 g: style.getPropertyCSSValue(-webkit-mask-clip) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-mask-composite) : source-over
index 58a1c0f..d510135 100644 (file)
@@ -1,3 +1,42 @@
+2011-08-31  David Hyatt  <hyatt@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=67300
+        
+        Add the new border-image-source property (and its corresponding analogue for masks, mask-box-image-source).
+        Change the border-image parsing code to no longer consider "none" to represent the entire border-image
+        expression, but instead to just mean "none" for the image component of the expression.
+        
+        Change the pending image code for border-image and mask-box-image to use the new *-source properties when
+        loading the image so that they're considered the same.
+        
+        This is the first step towards eliminating the border-image parsing code in favor of just parsing it as
+        a shorthand instead, but for now I'm implementing each property one by one, and once they're all there,
+        we can cut over to border-image as a true shorthand.
+
+        Reviewed by Beth Dakin.
+
+        Added fast/borders/border-image-source.html.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::parseBorderImage):
+        * css/CSSPropertyNames.in:
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::applyProperty):
+        (WebCore::CSSStyleSelector::mapNinePieceImage):
+        (WebCore::CSSStyleSelector::loadPendingImages):
+        * rendering/style/NinePieceImage.h:
+        (WebCore::NinePieceImage::setImage):
+        * rendering/style/RenderStyle.h:
+        (WebCore::InheritedFlags::borderImageSource):
+        (WebCore::InheritedFlags::maskBoxImageSource):
+        (WebCore::InheritedFlags::setBorderImageSource):
+        (WebCore::InheritedFlags::setMaskBoxImageSource):
+        (WebCore::InheritedFlags::initialBorderImageSource):
+        (WebCore::InheritedFlags::initialMaskBoxImageSource):
+
 2011-08-31  Stephen White  <senorblanco@chromium.org>
 
         [chromium] Set the GrContext before SkGpuDevice is destroyed.
index 23a9f30..c6a956f 100644 (file)
@@ -73,6 +73,7 @@ static const int computedProperties[] = {
     CSSPropertyBorderBottomStyle,
     CSSPropertyBorderBottomWidth,
     CSSPropertyBorderCollapse,
+    CSSPropertyBorderImageSource,
     CSSPropertyBorderLeftColor,
     CSSPropertyBorderLeftStyle,
     CSSPropertyBorderLeftWidth,
@@ -223,6 +224,7 @@ static const int computedProperties[] = {
     CSSPropertyWebkitMarqueeStyle,
     CSSPropertyWebkitMaskAttachment,
     CSSPropertyWebkitMaskBoxImage,
+    CSSPropertyWebkitMaskBoxImageSource,
     CSSPropertyWebkitMaskClip,
     CSSPropertyWebkitMaskComposite,
     CSSPropertyWebkitMaskImage,
@@ -990,6 +992,10 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
             return zoomAdjustedPixelValue(style->horizontalBorderSpacing(), style.get(), primitiveValueCache);
         case CSSPropertyWebkitBorderVerticalSpacing:
             return zoomAdjustedPixelValue(style->verticalBorderSpacing(), style.get(), primitiveValueCache);
+        case CSSPropertyBorderImageSource:
+            if (style->borderImageSource())
+                return style->borderImageSource()->cssValue();
+            return primitiveValueCache->createIdentifierValue(CSSValueNone);
         case CSSPropertyBorderTopColor:
             return m_allowVisitedStyle ? primitiveValueCache->createColorValue(style->visitedDependentColor(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidColor(style.get(), style->borderTopColor());
         case CSSPropertyBorderRightColor:
@@ -1581,6 +1587,10 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
             return valueForNinePieceImage(style->borderImage(), primitiveValueCache);
         case CSSPropertyWebkitMaskBoxImage:
             return valueForNinePieceImage(style->maskBoxImage(), primitiveValueCache);
+        case CSSPropertyWebkitMaskBoxImageSource:
+            if (style->maskBoxImageSource())
+                return style->maskBoxImageSource()->cssValue();
+            return primitiveValueCache->createIdentifierValue(CSSValueNone);
         case CSSPropertyWebkitFontSizeDelta:
             // Not a real style property -- used by the editing engine -- so has no computed value.
             break;
index 85c2369..5707618 100644 (file)
@@ -1205,6 +1205,8 @@ bool CSSParser::parseValue(int propId, bool important)
         return result;
     }
     case CSSPropertyListStyleImage:     // <uri> | none | inherit
+    case CSSPropertyBorderImageSource:
+    case CSSPropertyWebkitMaskBoxImageSource:
         if (id == CSSValueNone) {
             parsedValue = CSSImageValue::create();
             m_valueList->next();
@@ -1441,17 +1443,14 @@ bool CSSParser::parseValue(int propId, bool important)
         break;
 
     case CSSPropertyWebkitBorderImage:
-    case CSSPropertyWebkitMaskBoxImage:
-        if (id == CSSValueNone)
-            validPrimitive = true;
-        else {
-            RefPtr<CSSValue> result;
-            if (parseBorderImage(propId, important, result)) {
-                addProperty(propId, result, important);
-                return true;
-            }
+    case CSSPropertyWebkitMaskBoxImage: {
+        RefPtr<CSSValue> result;
+        if (parseBorderImage(propId, important, result)) {
+            addProperty(propId, result, important);
+            return true;
         }
         break;
+    }
     case CSSPropertyBorderTopRightRadius:
     case CSSPropertyBorderTopLeftRadius:
     case CSSPropertyBorderBottomLeftRadius:
@@ -5257,7 +5256,7 @@ struct BorderImageParseContext {
 
 bool CSSParser::parseBorderImage(int propId, bool important, RefPtr<CSSValue>& result)
 {
-    // Look for an image initially.  If the first value is not a URI, then we're done.
+    // Look for an image initially. If the first value is not a URI or the keyword "none", then we're done.
     BorderImageParseContext context(primitiveValueCache());
     CSSParserValue* val = m_valueList->current();
     if (val->unit == CSSPrimitiveValue::CSS_URI && m_styleSheet) {
@@ -5270,7 +5269,9 @@ bool CSSParser::parseBorderImage(int propId, bool important, RefPtr<CSSValue>& r
             context.commitImage(value);
         else
             return false;
-    } else
+    } else if (val->id == CSSValueNone)
+        context.commitImage(CSSImageValue::create());
+    else
         return false;
 
     while ((val = m_valueList->next())) {
index a8226dd..4a0cd6e 100644 (file)
@@ -58,6 +58,7 @@ border-bottom-style
 border-bottom-width
 border-collapse
 border-color
+border-image-source
 border-left
 border-left-color
 border-left-style
@@ -278,6 +279,7 @@ z-index
 -webkit-mask
 -webkit-mask-attachment
 -webkit-mask-box-image
+-webkit-mask-box-image-source
 -webkit-mask-clip
 -webkit-mask-composite
 -webkit-mask-image
index 81b2ce1..e02165e 100644 (file)
@@ -3681,6 +3681,18 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
         m_style->setListStyleImage(styleImage(CSSPropertyListStyleImage, value));
         return;
     }
+    case CSSPropertyBorderImageSource:
+    {
+        HANDLE_INHERIT_AND_INITIAL(borderImageSource, BorderImageSource)
+        m_style->setBorderImageSource(styleImage(CSSPropertyBorderImageSource, value));
+        return;
+    }
+    case CSSPropertyWebkitMaskBoxImageSource:
+    {
+        HANDLE_INHERIT_AND_INITIAL(maskBoxImageSource, MaskBoxImageSource)
+        m_style->setMaskBoxImageSource(styleImage(CSSPropertyWebkitMaskBoxImageSource, value));
+        return;
+    }
     case CSSPropertyWordBreak:
         HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(wordBreak, WordBreak)
         return;
@@ -5650,7 +5662,14 @@ void CSSStyleSelector::mapNinePieceImage(CSSPropertyID property, CSSValue* value
     CSSBorderImageValue* borderImage = static_cast<CSSBorderImageValue*>(value);
     
     // Set the image (this kicks off the load).
-    image.setImage(styleImage(property, borderImage->imageValue()));
+    CSSPropertyID imageProperty;
+    if (property == CSSPropertyWebkitBorderImage)
+        imageProperty = CSSPropertyBorderImageSource;
+    else if (property == CSSPropertyWebkitMaskBoxImage)
+        imageProperty = CSSPropertyWebkitMaskBoxImageSource;
+    else
+        imageProperty = property;
+    image.setImage(styleImage(imageProperty, borderImage->imageValue()));
 
     // Set up a length box to represent our image slices.
     LengthBox l;
@@ -6389,15 +6408,14 @@ void CSSStyleSelector::loadPendingImages()
                 break;
             }
 
-            case CSSPropertyWebkitBorderImage: {
-                const NinePieceImage& borderImage = m_style->borderImage();
-                if (borderImage.image() && borderImage.image()->isPendingImage()) {
-                    CSSImageValue* imageValue = static_cast<StylePendingImage*>(borderImage.image())->cssImageValue();
-                    m_style->setBorderImage(NinePieceImage(imageValue->cachedImage(cachedResourceLoader), borderImage.slices(), borderImage.horizontalRule(), borderImage.verticalRule()));
+            case CSSPropertyBorderImageSource: {
+                if (m_style->borderImageSource() && m_style->borderImageSource()->isPendingImage()) {
+                    CSSImageValue* imageValue = static_cast<StylePendingImage*>(m_style->borderImageSource())->cssImageValue();
+                    m_style->setBorderImageSource(imageValue->cachedImage(cachedResourceLoader));
                 }
                 break;
             }
-            
+
             case CSSPropertyWebkitBoxReflect: {
                 if (StyleReflection* reflection = m_style->boxReflect()) {
                     const NinePieceImage& maskImage = reflection->mask();
@@ -6409,15 +6427,14 @@ void CSSStyleSelector::loadPendingImages()
                 break;
             }
 
-            case CSSPropertyWebkitMaskBoxImage: {
-                const NinePieceImage& maskBoxImage = m_style->maskBoxImage();
-                if (maskBoxImage.image() && maskBoxImage.image()->isPendingImage()) {
-                    CSSImageValue* imageValue = static_cast<StylePendingImage*>(maskBoxImage.image())->cssImageValue();
-                    m_style->setMaskBoxImage(NinePieceImage(imageValue->cachedImage(cachedResourceLoader), maskBoxImage.slices(), maskBoxImage.horizontalRule(), maskBoxImage.verticalRule()));
+            case CSSPropertyWebkitMaskBoxImageSource: {
+                if (m_style->maskBoxImageSource() && m_style->maskBoxImageSource()->isPendingImage()) {
+                    CSSImageValue* imageValue = static_cast<StylePendingImage*>(m_style->maskBoxImageSource())->cssImageValue();
+                    m_style->setMaskBoxImageSource(imageValue->cachedImage(cachedResourceLoader));
                 }
                 break;
             }
-            
+
             case CSSPropertyWebkitMaskImage: {
                 for (FillLayer* maskLayer = m_style->accessMaskLayers(); maskLayer; maskLayer = maskLayer->next()) {
                     if (maskLayer->image() && maskLayer->image()->isPendingImage()) {
index c400551..656dbd0 100644 (file)
@@ -55,7 +55,7 @@ public:
 
     bool hasImage() const { return m_image != 0; }
     StyleImage* image() const { return m_image.get(); }
-    void setImage(StyleImage* image) { m_image = image; }
+    void setImage(PassRefPtr<StyleImage> image) { m_image = image; }
     
     const LengthBox& slices() const { return m_slices; }
     void setSlices(const LengthBox& l) { m_slices = l; }
@@ -66,6 +66,8 @@ public:
     ENinePieceImageRule verticalRule() const { return static_cast<ENinePieceImageRule>(m_verticalRule); }
     void setVerticalRule(ENinePieceImageRule rule) { m_verticalRule = rule; }
 
+friend class RenderStyle;
+
 private:
     RefPtr<StyleImage> m_image;
     LengthBox m_slices;
index bd4fada..85088bf 100644 (file)
@@ -421,7 +421,8 @@ public:
     const BorderValue& borderEnd() const;
 
     const NinePieceImage& borderImage() const { return surround->border.image(); }
-
+    StyleImage* borderImageSource() const { return surround->border.image().image(); }
     LengthSize borderTopLeftRadius() const { return surround->border.topLeft(); }
     LengthSize borderTopRightRadius() const { return surround->border.topRight(); }
     LengthSize borderBottomLeftRadius() const { return surround->border.bottomLeft(); }
@@ -593,7 +594,8 @@ public:
     FillLayer* accessMaskLayers() { return &(rareNonInheritedData.access()->m_mask); }
     const FillLayer* maskLayers() const { return &(rareNonInheritedData->m_mask); }
     const NinePieceImage& maskBoxImage() const { return rareNonInheritedData->m_maskBoxImage; }
-
+    StyleImage* maskBoxImageSource() const { return rareNonInheritedData->m_maskBoxImage.image(); }
     EBorderCollapse borderCollapse() const { return static_cast<EBorderCollapse>(inherited_flags._border_collapse); }
     short horizontalBorderSpacing() const { return inherited->horizontal_border_spacing; }
     short verticalBorderSpacing() const { return inherited->vertical_border_spacing; }
@@ -869,6 +871,7 @@ public:
     void setBackgroundSizeLength(LengthSize l) { SET_VAR(m_background, m_background.m_sizeLength, l) }
     
     void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.m_image, b) }
+    void setBorderImageSource(PassRefPtr<StyleImage> v) { surround.access()->border.m_image.setImage(v); }
 
     void setBorderTopLeftRadius(LengthSize s) { SET_VAR(surround, border.m_topLeft, s) }
     void setBorderTopRightRadius(LengthSize s) { SET_VAR(surround, border.m_topRight, s) }
@@ -984,6 +987,7 @@ public:
     }
 
     void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(rareNonInheritedData, m_maskBoxImage, b) }
+    void setMaskBoxImageSource(PassRefPtr<StyleImage> v) { rareNonInheritedData.access()->m_maskBoxImage.setImage(v); }
     void setMaskXPosition(Length l) { SET_VAR(rareNonInheritedData, m_mask.m_xPosition, l) }
     void setMaskYPosition(Length l) { SET_VAR(rareNonInheritedData, m_mask.m_yPosition, l) }
     void setMaskSize(LengthSize l) { SET_VAR(rareNonInheritedData, m_mask.m_sizeLength, l) }
@@ -1399,6 +1403,8 @@ public:
     static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmphasisPositionOver; }
     static LineBoxContain initialLineBoxContain() { return LineBoxContainBlock | LineBoxContainInline | LineBoxContainReplaced; }
     static EImageRendering initialImageRendering() { return ImageRenderingAuto; }
+    static StyleImage* initialBorderImageSource() { return 0; }
+    static StyleImage* initialMaskBoxImageSource() { return 0; }
 
     static const AtomicString& initialFlowThread() { return nullAtom; }
     static const AtomicString& initialRegionThread() { return nullAtom; }