[CSS Masking] Add -webkit-mask-source-type property, with auto, alpha and luminance...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2013 11:41:57 +0000 (11:41 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2013 11:41:57 +0000 (11:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=119614

Source/WebCore:

Added the -webkit-mask-source-type property, which can have a value of auto, alpha or
luminance. The default value is auto. This patch contains only the parsing of the property,
not the actual implementation of the types of masks. The parsing of mask-source-type in the
-webkit-mask property will be handled in a separate patch.

Patch by Andrei Parvu <parvu@adobe.com> on 2013-08-16
Reviewed by Dirk Schulze.

Test: fast/masking/parsing-mask-source-type.html

* css/CSSComputedStyleDeclaration.cpp: Added case for CSSPropertyWebkitMaskType.
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp: Parsed the values for CSSPropertyWebkitMaskType.
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFillProperty):
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty):
* css/CSSPropertyNames.in: Added -webkit-mask-type property.
* css/CSSToStyleMap.cpp: map the provided mask type to the FillLayer class.
(WebCore::CSSToStyleMap::mapFillMaskType):
* css/CSSToStyleMap.h:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
* rendering/style/FillLayer.cpp: Added the m_maskType property to the FillLayer class.
(WebCore::FillLayer::FillLayer):
(WebCore::FillLayer::operator=):
(WebCore::FillLayer::operator==):
* rendering/style/FillLayer.h: Added methods for working with m_maskType.
(WebCore::FillLayer::maskType):
(WebCore::FillLayer::isMaskTypeSet):
(WebCore::FillLayer::setMaskType):
(WebCore::FillLayer::clearMaskType):
(WebCore::FillLayer::initialMaskType):
* rendering/style/RenderStyleConstants.h: Added the EMaskSourceType enum.

LayoutTests:

Added tests for the parsing of the -webkit-mask-source-type property

Patch by Andrei Parvu <parvu@adobe.com> on 2013-08-16
Reviewed by Dirk Schulze.

* fast/masking/parsing-mask-expected.txt:
* fast/masking/parsing-mask-source-type-expected.txt: Added.
* fast/masking/parsing-mask-source-type.html: Added.
* fast/masking/parsing-mask.html:

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

17 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/masking/parsing-mask-expected.txt
LayoutTests/fast/masking/parsing-mask-source-type-expected.txt [new file with mode: 0644]
LayoutTests/fast/masking/parsing-mask-source-type.html [new file with mode: 0644]
LayoutTests/fast/masking/parsing-mask.html
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSToStyleMap.cpp
Source/WebCore/css/CSSToStyleMap.h
Source/WebCore/css/DeprecatedStyleBuilder.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/rendering/style/FillLayer.cpp
Source/WebCore/rendering/style/FillLayer.h
Source/WebCore/rendering/style/RenderStyleConstants.h

index 8131324..bd3014c 100644 (file)
@@ -1,3 +1,17 @@
+2013-08-16  Andrei Parvu  <parvu@adobe.com>
+
+        [CSS Masking] Add -webkit-mask-source-type property, with auto, alpha and luminance values
+        https://bugs.webkit.org/show_bug.cgi?id=119614
+
+        Added tests for the parsing of the -webkit-mask-source-type property
+
+        Reviewed by Dirk Schulze.
+
+        * fast/masking/parsing-mask-expected.txt:
+        * fast/masking/parsing-mask-source-type-expected.txt: Added.
+        * fast/masking/parsing-mask-source-type.html: Added.
+        * fast/masking/parsing-mask.html:
+
 2013-08-16  Simon Pena  <simon.pena@samsung.com>
 
         [GTK] Unreviewed gardening. Rebaseline after r154127 and add new baseline after r153647.
index 9e9476f..98c0fd8 100644 (file)
@@ -39,6 +39,13 @@ PASS innerStyle("-webkit-mask-position", "left 10px center") is "left 10px top 5
 PASS innerStyle("-webkit-mask-position", "center top 20px") is "left 50% top 20px"
 PASS innerStyle("-webkit-mask-position", "center left 30px") is "left 30px top 50%"
 PASS innerStyle("-webkit-mask-position", "left 20% top") is "left 20% top 0%"
+PASS innerStyle("-webkit-mask-source-type", "alpha") is "alpha"
+PASS innerStyle("-webkit-mask-source-type", "luminance") is "luminance"
+PASS innerStyle("-webkit-mask-source-type", "auto") is "auto"
+PASS computedStyle("-webkit-mask-source-type", "alpha") is "alpha"
+PASS computedStyle("-webkit-mask-source-type", "auto") is "alpha"
+PASS computedStyle("-webkit-mask-source-type", "luminance") is "luminance"
+PASS computedStyle("-webkit-mask-source-type", "") is "alpha"
 PASS innerStyle("-webkit-mask", "repeat-x") is "repeat-x"
 PASS innerStyle("-webkit-mask", "repeat-y") is "repeat-y"
 PASS innerStyle("-webkit-mask", "repeat") is "repeat"
@@ -109,6 +116,10 @@ PASS innerStyle("-webkit-mask", "none center center 20px / auto repeat-x scroll
 PASS innerStyle("-webkit-mask", "none top 20px right 30px center / auto repeat-x scroll border-box border-box") is null
 PASS innerStyle("-webkit-mask", "none top 20px top 30px / auto repeat-x scroll border-box border-box") is null
 PASS innerStyle("-webkit-mask", "none top 20px bottom / auto repeat-x scroll border-box border-box") is null
+PASS innerStyle("-webkit-mask-source-type", "rubbish") is null
+PASS innerStyle("-webkit-mask-source-type", "") is null
+PASS innerStyle("-webkit-mask-source-type", "center") is null
+PASS innerStyle("-webkit-mask-source-type", "repeat") is null
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/fast/masking/parsing-mask-source-type-expected.txt b/LayoutTests/fast/masking/parsing-mask-source-type-expected.txt
new file mode 100644 (file)
index 0000000..c540f5f
--- /dev/null
@@ -0,0 +1,8 @@
+PASS setProperty("alpha, alpha, alpha, alpha") is "alpha, alpha, alpha, alpha"
+PASS setProperty("luminance, alpha") is "luminance, alpha, alpha, alpha"
+PASS setProperty("luminance, luminance, luminance, luminance") is "luminance, luminance, luminance, luminance"
+PASS setProperty("auto, alpha, luminance, luminance") is "alpha, alpha, luminance, luminance"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/masking/parsing-mask-source-type.html b/LayoutTests/fast/masking/parsing-mask-source-type.html
new file mode 100644 (file)
index 0000000..01dd33b
--- /dev/null
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+    <style>
+        * { font-size: 16px; }
+        div { font-size: 8px; }
+    </style>
+    <body>
+        <script src="../js/resources/js-test-pre.js"></script>
+        <script>
+            function setProperty(value) {
+                var div = document.createElement('div');
+                document.body.appendChild(div);
+                div.style.setProperty("-webkit-mask-image", "none, none, none, none");
+                div.style.setProperty("-webkit-mask-source-type", value);
+
+                var computedValue = getComputedStyle(div).getPropertyValue("-webkit-mask-source-type");
+                document.body.removeChild(div);
+
+                return computedValue;
+            }
+
+            function test(value, expected) {
+                shouldBeEqualToString('setProperty("' + value + '")', expected);
+            }
+
+            test("alpha, alpha, alpha, alpha", "alpha, alpha, alpha, alpha");
+            test("luminance, alpha", "luminance, alpha, alpha, alpha");
+            test("luminance, luminance, luminance, luminance", "luminance, luminance, luminance, luminance");
+            test("auto, alpha, luminance, luminance", "alpha, alpha, luminance, luminance");
+        </script>
+        <script src="../js/resources/js-test-post.js"></script>
+    </body>
+</html>
index 60f53f3..430e901 100644 (file)
@@ -83,6 +83,15 @@ testInner("-webkit-mask-position", "center top 20px", "left 50% top 20px");
 testInner("-webkit-mask-position", "center left 30px", "left 30px top 50%");
 testInner("-webkit-mask-position", "left 20% top", "left 20% top 0%");
 
+// test mask-source-type
+testInner("-webkit-mask-source-type", "alpha", "alpha");
+testInner("-webkit-mask-source-type", "luminance", "luminance");
+testInner("-webkit-mask-source-type", "auto", "auto");
+testComputed("-webkit-mask-source-type", "alpha", "alpha");
+testComputed("-webkit-mask-source-type", "auto", "alpha");
+testComputed("-webkit-mask-source-type", "luminance", "luminance");
+testComputed("-webkit-mask-source-type", "", "alpha");
+
 // test mask-repeat
 testInner("-webkit-mask", "repeat-x", "repeat-x");
 testInner("-webkit-mask", "repeat-y", "repeat-y");
@@ -166,6 +175,10 @@ negativeTest("-webkit-mask", "none center center 20px / auto repeat-x scroll bor
 negativeTest("-webkit-mask", "none top 20px right 30px center / auto repeat-x scroll border-box border-box");
 negativeTest("-webkit-mask", "none top 20px top 30px / auto repeat-x scroll border-box border-box");
 negativeTest("-webkit-mask", "none top 20px bottom / auto repeat-x scroll border-box border-box");
+negativeTest("-webkit-mask-source-type", "rubbish");
+negativeTest("-webkit-mask-source-type", "");
+negativeTest("-webkit-mask-source-type", "center");
+negativeTest("-webkit-mask-source-type", "repeat");
 
 </script>
 <script src="../js/resources/js-test-post.js"></script>
index 481f631..dd2b1e2 100644 (file)
@@ -1,3 +1,44 @@
+2013-08-16  Andrei Parvu  <parvu@adobe.com>
+
+        [CSS Masking] Add -webkit-mask-source-type property, with auto, alpha and luminance values
+        https://bugs.webkit.org/show_bug.cgi?id=119614
+
+        Added the -webkit-mask-source-type property, which can have a value of auto, alpha or
+        luminance. The default value is auto. This patch contains only the parsing of the property,
+        not the actual implementation of the types of masks. The parsing of mask-source-type in the
+        -webkit-mask property will be handled in a separate patch.
+
+        Reviewed by Dirk Schulze.
+
+        Test: fast/masking/parsing-mask-source-type.html
+
+        * css/CSSComputedStyleDeclaration.cpp: Added case for CSSPropertyWebkitMaskType.
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        * css/CSSParser.cpp: Parsed the values for CSSPropertyWebkitMaskType.
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::parseFillProperty):
+        * css/CSSProperty.cpp:
+        (WebCore::CSSProperty::isInheritedProperty):
+        * css/CSSPropertyNames.in: Added -webkit-mask-type property.
+        * css/CSSToStyleMap.cpp: map the provided mask type to the FillLayer class.
+        (WebCore::CSSToStyleMap::mapFillMaskType):
+        * css/CSSToStyleMap.h:
+        * css/DeprecatedStyleBuilder.cpp:
+        (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::applyProperty):
+        * rendering/style/FillLayer.cpp: Added the m_maskType property to the FillLayer class.
+        (WebCore::FillLayer::FillLayer):
+        (WebCore::FillLayer::operator=):
+        (WebCore::FillLayer::operator==):
+        * rendering/style/FillLayer.h: Added methods for working with m_maskType.
+        (WebCore::FillLayer::maskType):
+        (WebCore::FillLayer::isMaskTypeSet):
+        (WebCore::FillLayer::setMaskType):
+        (WebCore::FillLayer::clearMaskType):
+        (WebCore::FillLayer::initialMaskType):
+        * rendering/style/RenderStyleConstants.h: Added the EMaskSourceType enum.
+
 2013-08-16  Raphael Kubo da Costa  <raphael.kubo.da.costa@intel.com>
 
         <https://webkit.org/b/119885> [CMake] Always build our generated versions of ANGLE's glslang.cpp and glslang_tab.cpp
index 715e39c..7058edb 100644 (file)
@@ -329,6 +329,7 @@ static const CSSPropertyID computedProperties[] = {
     CSSPropertyWebkitMaskPosition,
     CSSPropertyWebkitMaskRepeat,
     CSSPropertyWebkitMaskSize,
+    CSSPropertyWebkitMaskSourceType,
     CSSPropertyWebkitNbspMode,
     CSSPropertyWebkitOrder,
 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
@@ -1423,6 +1424,19 @@ static PassRefPtr<CSSValue> fillRepeatToCSSValue(EFillRepeat xRepeat, EFillRepea
     return list.release();
 }
 
+static PassRefPtr<CSSValue> fillSourceTypeToCSSValue(EMaskSourceType type)
+{
+    switch (type) {
+    case MaskAlpha:
+        return cssValuePool().createValue(CSSValueAlpha);
+    case MaskLuminance:
+        return cssValuePool().createValue(CSSValueLuminance);
+    }
+
+    ASSERT_NOT_REACHED();
+
+    return 0;
+}
 static PassRefPtr<CSSValue> fillSizeToCSSValue(const FillSize& fillSize, const RenderStyle* style)
 {
     if (fillSize.type == Contain)
@@ -1765,6 +1779,21 @@ PassRefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propert
 
             return list.release();
         }
+        case CSSPropertyWebkitMaskSourceType: {
+            const FillLayer* layers = style->maskLayers();
+
+            if (!layers)
+                return cssValuePool().createIdentifierValue(CSSValueNone);
+
+            if (!layers->next())
+                return fillSourceTypeToCSSValue(layers->maskSourceType());
+
+            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+            for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next())
+                list->append(fillSourceTypeToCSSValue(currLayer->maskSourceType()));
+
+            return list.release();
+        }
         case CSSPropertyWebkitBackgroundComposite:
         case CSSPropertyWebkitMaskComposite: {
             const FillLayer* layers = propertyID == CSSPropertyWebkitMaskComposite ? style->maskLayers() : style->backgroundLayers();
index 168fe80..38989b7 100644 (file)
@@ -2148,6 +2148,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
     case CSSPropertyWebkitMaskPositionX:
     case CSSPropertyWebkitMaskPositionY:
     case CSSPropertyWebkitMaskSize:
+    case CSSPropertyWebkitMaskSourceType:
     case CSSPropertyWebkitMaskRepeat:
     case CSSPropertyWebkitMaskRepeatX:
     case CSSPropertyWebkitMaskRepeatY:
@@ -4428,6 +4429,14 @@ bool CSSParser::parseFillProperty(CSSPropertyID propId, CSSPropertyID& propId1,
                         m_valueList->next();
                     break;
                 }
+                case CSSPropertyWebkitMaskSourceType: {
+                    if (val->id == CSSValueAuto || val->id == CSSValueAlpha || val->id == CSSValueLuminance) {
+                        currValue = cssValuePool().createIdentifierValue(val->id);
+                        m_valueList->next();
+                    } else
+                        currValue = 0;
+                    break;
+                }
                 default:
                     break;
             }
index 166f7b4..4aa8d14 100644 (file)
@@ -642,6 +642,7 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
     case CSSPropertyWebkitMaskRepeatX:
     case CSSPropertyWebkitMaskRepeatY:
     case CSSPropertyWebkitMaskSize:
+    case CSSPropertyWebkitMaskSourceType:
     case CSSPropertyWebkitMaxLogicalWidth:
     case CSSPropertyWebkitMaxLogicalHeight:
     case CSSPropertyWebkitMinLogicalWidth:
index f068f59..b9b95d5 100644 (file)
@@ -359,6 +359,7 @@ z-index
 -webkit-mask-repeat-x
 -webkit-mask-repeat-y
 -webkit-mask-size
+-webkit-mask-source-type
 -webkit-max-logical-width
 -webkit-max-logical-height
 -webkit-min-logical-width
index 17a79fd..54b1cca 100644 (file)
@@ -299,6 +299,34 @@ void CSSToStyleMap::mapFillYPosition(CSSPropertyID propertyID, FillLayer* layer,
         layer->setBackgroundYOrigin(*(pair->first()));
 }
 
+void CSSToStyleMap::mapFillMaskSourceType(CSSPropertyID, FillLayer* layer, CSSValue* value)
+{
+    EMaskSourceType type = FillLayer::initialMaskSourceType(layer->type());
+    if (value->isInitialValue()) {
+        layer->setMaskSourceType(type);
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    switch (primitiveValue->getValueID()) {
+    case CSSValueAlpha:
+        type = EMaskSourceType::MaskAlpha;
+        break;
+    case CSSValueLuminance:
+        type = EMaskSourceType::MaskLuminance;
+        break;
+    case CSSValueAuto:
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+
+    layer->setMaskSourceType(type);
+}
+
 void CSSToStyleMap::mapAnimationDelay(Animation* animation, CSSValue* value)
 {
     if (value->isInitialValue()) {
index 3cb1215..cf50c85 100644 (file)
@@ -53,6 +53,7 @@ public:
     void mapFillSize(CSSPropertyID, FillLayer*, CSSValue*);
     void mapFillXPosition(CSSPropertyID, FillLayer*, CSSValue*);
     void mapFillYPosition(CSSPropertyID, FillLayer*, CSSValue*);
+    void mapFillMaskSourceType(CSSPropertyID, FillLayer*, CSSValue*);
 
     void mapAnimationDelay(Animation*, CSSValue*);
     void mapAnimationDirection(Animation*, CSSValue*);
index 755a955..07314e1 100644 (file)
@@ -2311,6 +2311,7 @@ DeprecatedStyleBuilder::DeprecatedStyleBuilder()
     setPropertyHandler(CSSPropertyWebkitMaskRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSToStyleMap::mapFillRepeatX>::createHandler());
     setPropertyHandler(CSSPropertyWebkitMaskRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSToStyleMap::mapFillRepeatY>::createHandler());
     setPropertyHandler(CSSPropertyWebkitMaskSize, ApplyPropertyFillLayer<FillSize, CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSToStyleMap::mapFillSize>::createHandler());
+    setPropertyHandler(CSSPropertyWebkitMaskSourceType, ApplyPropertyFillLayer<EMaskSourceType, CSSPropertyWebkitMaskSourceType, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isMaskSourceTypeSet, &FillLayer::maskSourceType, &FillLayer::setMaskSourceType, &FillLayer::clearMaskSourceType, &FillLayer::initialMaskSourceType, &CSSToStyleMap::mapFillMaskSourceType>::createHandler());
     setPropertyHandler(CSSPropertyWebkitNbspMode, ApplyPropertyDefault<ENBSPMode, &RenderStyle::nbspMode, ENBSPMode, &RenderStyle::setNBSPMode, ENBSPMode, &RenderStyle::initialNBSPMode>::createHandler());
     setPropertyHandler(CSSPropertyWebkitPerspectiveOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitPerspectiveOriginX, CSSPropertyWebkitPerspectiveOriginY>::createHandler());
     setPropertyHandler(CSSPropertyWebkitPerspectiveOriginX, ApplyPropertyLength<&RenderStyle::perspectiveOriginX, &RenderStyle::setPerspectiveOriginX, &RenderStyle::initialPerspectiveOriginX>::createHandler());
index a2fab68..0340cdf 100644 (file)
@@ -2964,6 +2964,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
     case CSSPropertyWebkitMaskRepeatX:
     case CSSPropertyWebkitMaskRepeatY:
     case CSSPropertyWebkitMaskSize:
+    case CSSPropertyWebkitMaskSourceType:
     case CSSPropertyWebkitNbspMode:
     case CSSPropertyWebkitPerspectiveOrigin:
     case CSSPropertyWebkitPerspectiveOriginX:
index b11e24c..5307471 100644 (file)
@@ -54,6 +54,7 @@ FillLayer::FillLayer(EFillLayerType type)
     , m_composite(FillLayer::initialFillComposite(type))
     , m_sizeType(FillLayer::initialFillSizeType(type))
     , m_blendMode(FillLayer::initialFillBlendMode(type))
+    , m_maskSourceType(FillLayer::initialMaskSourceType(type))
     , m_imageSet(false)
     , m_attachmentSet(false)
     , m_clipSet(false)
@@ -67,6 +68,7 @@ FillLayer::FillLayer(EFillLayerType type)
     , m_backgroundYOrigin(TopEdge)
     , m_compositeSet(type == MaskFillLayer)
     , m_blendModeSet(false)
+    , m_maskSourceTypeSet(false)
     , m_type(type)
 {
 }
@@ -85,6 +87,7 @@ FillLayer::FillLayer(const FillLayer& o)
     , m_composite(o.m_composite)
     , m_sizeType(o.m_sizeType)
     , m_blendMode(o.m_blendMode)
+    , m_maskSourceType(o.m_maskSourceType)
     , m_imageSet(o.m_imageSet)
     , m_attachmentSet(o.m_attachmentSet)
     , m_clipSet(o.m_clipSet)
@@ -98,6 +101,7 @@ FillLayer::FillLayer(const FillLayer& o)
     , m_backgroundYOrigin(o.m_backgroundYOrigin)
     , m_compositeSet(o.m_compositeSet)
     , m_blendModeSet(o.m_blendModeSet)
+    , m_maskSourceTypeSet(o.m_maskSourceTypeSet)
     , m_type(o.m_type)
 {
 }
@@ -129,6 +133,7 @@ FillLayer& FillLayer::operator=(const FillLayer& o)
     m_repeatX = o.m_repeatX;
     m_repeatY = o.m_repeatY;
     m_sizeType = o.m_sizeType;
+    m_maskSourceType = o.m_maskSourceType;
 
     m_imageSet = o.m_imageSet;
     m_attachmentSet = o.m_attachmentSet;
@@ -140,7 +145,8 @@ FillLayer& FillLayer::operator=(const FillLayer& o)
     m_repeatYSet = o.m_repeatYSet;
     m_xPosSet = o.m_xPosSet;
     m_yPosSet = o.m_yPosSet;
-    
+    m_maskSourceTypeSet = o.m_maskSourceTypeSet;
+
     m_type = o.m_type;
 
     return *this;
@@ -154,8 +160,9 @@ bool FillLayer::operator==(const FillLayer& o) const
             && m_backgroundXOrigin == o.m_backgroundXOrigin && m_backgroundYOrigin == o.m_backgroundYOrigin
             && m_attachment == o.m_attachment && m_clip == o.m_clip && m_composite == o.m_composite
             && m_blendMode == o.m_blendMode && m_origin == o.m_origin && m_repeatX == o.m_repeatX
-            && m_repeatY == o.m_repeatY && m_sizeType == o.m_sizeType && m_sizeLength == o.m_sizeLength
-            && m_type == o.m_type && ((m_next && o.m_next) ? *m_next == *o.m_next : m_next == o.m_next);
+            && m_repeatY == o.m_repeatY && m_sizeType == o.m_sizeType && m_maskSourceType == o.m_maskSourceType
+            && m_sizeLength == o.m_sizeLength && m_type == o.m_type
+            && ((m_next && o.m_next) ? *m_next == *o.m_next : m_next == o.m_next);
 }
 
 void FillLayer::fillUnsetProperties()
index 040a3f1..b48f077 100644 (file)
@@ -80,6 +80,7 @@ public:
     LengthSize sizeLength() const { return m_sizeLength; }
     EFillSizeType sizeType() const { return static_cast<EFillSizeType>(m_sizeType); }
     FillSize size() const { return FillSize(static_cast<EFillSizeType>(m_sizeType), m_sizeLength); }
+    EMaskSourceType maskSourceType() const { return static_cast<EMaskSourceType>(m_maskSourceType); }
 
     const FillLayer* next() const { return m_next; }
     FillLayer* next() { return m_next; }
@@ -96,7 +97,8 @@ public:
     bool isCompositeSet() const { return m_compositeSet; }
     bool isBlendModeSet() const { return m_blendModeSet; }
     bool isSizeSet() const { return m_sizeType != SizeNone; }
-    
+    bool isMaskSourceTypeSet() const { return m_maskSourceTypeSet; }
+
     void setImage(PassRefPtr<StyleImage> i) { m_image = i; m_imageSet = true; }
     void setXPosition(Length l) { m_xPosition = l; m_xPosSet = true; }
     void setYPosition(Length l) { m_yPosition = l; m_yPosSet = true; }
@@ -112,7 +114,8 @@ public:
     void setSizeType(EFillSizeType b) { m_sizeType = b; }
     void setSizeLength(LengthSize l) { m_sizeLength = l; }
     void setSize(FillSize f) { m_sizeType = f.type; m_sizeLength = f.size; }
-    
+    void setMaskSourceType(EMaskSourceType m) { m_maskSourceType = m; m_maskSourceTypeSet = true; }
+
     void clearImage() { m_image.clear(); m_imageSet = false; }
     void clearXPosition()
     {
@@ -133,6 +136,7 @@ public:
     void clearComposite() { m_compositeSet = false; }
     void clearBlendMode() { m_blendModeSet = false; }
     void clearSize() { m_sizeType = SizeNone; }
+    void clearMaskSourceType() { m_maskSourceTypeSet = false; }
 
     void setNext(FillLayer* n) { if (m_next != n) { delete m_next; m_next = n; } }
 
@@ -184,6 +188,7 @@ public:
     static Length initialFillXPosition(EFillLayerType) { return Length(0.0, Percent); }
     static Length initialFillYPosition(EFillLayerType) { return Length(0.0, Percent); }
     static StyleImage* initialFillImage(EFillLayerType) { return 0; }
+    static EMaskSourceType initialMaskSourceType(EFillLayerType) { return MaskAlpha; }
 
 private:
     friend class RenderStyle;
@@ -209,7 +214,8 @@ private:
     unsigned m_composite : 4; // CompositeOperator
     unsigned m_sizeType : 2; // EFillSizeType
     unsigned m_blendMode : 5; // BlendMode
-    
+    unsigned m_maskSourceType : 1; // EMaskSourceType
+
     unsigned m_imageSet : 1;
     unsigned m_attachmentSet : 1;
     unsigned m_clipSet : 1;
@@ -223,7 +229,8 @@ private:
     unsigned m_backgroundYOrigin : 2; // BackgroundEdgeOrigin
     unsigned m_compositeSet : 1;
     unsigned m_blendModeSet : 1;
-    
+    unsigned m_maskSourceTypeSet : 1;
+
     unsigned m_type : 1; // EFillLayerType
 
     mutable unsigned m_clipMax : 2; // EFillBox, maximum m_clip value from this to bottom layer
index 830612e..a5a79d6 100644 (file)
@@ -163,6 +163,9 @@ enum EFillSizeType { Contain, Cover, SizeLength, SizeNone };
 // CSS3 Background Position
 enum BackgroundEdgeOrigin { TopEdge, RightEdge, BottomEdge, LeftEdge };
 
+// CSS3 Mask Source Types
+enum EMaskSourceType { MaskAlpha, MaskLuminance };
+
 // CSS3 Marquee Properties
 
 enum EMarqueeBehavior { MNONE, MSCROLL, MSLIDE, MALTERNATE };