Delete remaining masks dead code.

Removes the straggling code related to masks now that
we've removed the CSS properties.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/893093002
diff --git a/sky/engine/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/sky/engine/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
index dc55d85..59fd532 100644
--- a/sky/engine/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/sky/engine/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -174,12 +174,9 @@
 }
 
 {% macro apply_border_image_modifier(property_id, modifier_type) %}
-{% set is_mask_box = 'MaskBox' in property_id %}
-{% set getter = 'maskBoxImage' if is_mask_box else 'borderImage' %}
-{% set setter = 'setMaskBoxImage' if is_mask_box else 'setBorderImage' %}
 {{ declare_initial_function(property_id) }}
 {
-    const NinePieceImage& currentImage = state.style()->{{getter}}();
+    const NinePieceImage& currentImage = state.style()->borderImage();
     {# Check for equality in case we can bail out before creating a new NinePieceImage. #}
     {% if modifier_type == 'Outset' %}
     if (lengthTypeAndValueMatch(currentImage.outset(), Fixed, 0))
@@ -187,18 +184,10 @@
     {% elif modifier_type == 'Repeat' %}
     if (currentImage.horizontalRule() == StretchImageRule && currentImage.verticalRule() == StretchImageRule)
         return;
-    {% elif modifier_type == 'Slice' and is_mask_box %}
-    // Masks have a different initial value for slices. Preserve the value of 0 for backwards compatibility.
-    if (currentImage.fill() == true && lengthTypeAndValueMatch(currentImage.imageSlices(), Fixed, 0))
-        return;
-    {% elif modifier_type == 'Slice' and not is_mask_box %}
+    {% elif modifier_type == 'Slice' %}
     if (currentImage.fill() == false && lengthTypeAndValueMatch(currentImage.imageSlices(), Percent, 100))
         return;
-    {% elif modifier_type == 'Width' and is_mask_box %}
-    // Masks have a different initial value for widths. Preserve the value of 'auto' for backwards compatibility.
-    if (lengthTypeAndValueMatch(currentImage.borderSlices(), Auto, 0))
-        return;
-    {% elif modifier_type == 'Width' and not is_mask_box %}
+    {% elif modifier_type == 'Width' %}
     if (lengthTypeAndValueMatch(currentImage.borderSlices(), Fixed, 1))
         return;
     {% endif %}
@@ -209,36 +198,33 @@
     {% elif modifier_type == 'Repeat' %}
     image.setHorizontalRule(StretchImageRule);
     image.setVerticalRule(StretchImageRule);
-    {% elif modifier_type == 'Slice' and is_mask_box %}
-    image.setImageSlices(LengthBox({{ (['Length(0, Fixed)']*4) | join(', ') }}));
-    image.setFill(true);
-    {% elif modifier_type == 'Slice' and not is_mask_box %}
+    {% elif modifier_type == 'Slice' %}
     image.setImageSlices(LengthBox({{ (['Length(100, Percent)']*4) | join(', ') }}));
     image.setFill(false);
     {% elif modifier_type == 'Width' %}
-    image.setBorderSlices({{ 'Length(Auto)' if is_mask_box else '1.0' }});
+    image.setBorderSlices(1.0);
     {% endif %}
-    state.style()->{{setter}}(image);
+    state.style()->setBorderImage(image);
 }
 
 {{declare_inherit_function(property_id)}}
 {
-    NinePieceImage image(state.style()->{{getter}}());
+    NinePieceImage image(state.style()->borderImage());
     {% if modifier_type == 'Outset' %}
-    image.copyOutsetFrom(state.parentStyle()->{{getter}}());
+    image.copyOutsetFrom(state.parentStyle()->borderImage());
     {% elif modifier_type == 'Repeat' %}
-    image.copyRepeatFrom(state.parentStyle()->{{getter}}());
+    image.copyRepeatFrom(state.parentStyle()->borderImage());
     {% elif modifier_type == 'Slice' %}
-    image.copyImageSlicesFrom(state.parentStyle()->{{getter}}());
+    image.copyImageSlicesFrom(state.parentStyle()->borderImage());
     {% elif modifier_type == 'Width' %}
-    image.copyBorderSlicesFrom(state.parentStyle()->{{getter}}());
+    image.copyBorderSlicesFrom(state.parentStyle()->borderImage());
     {% endif %}
-    state.style()->{{setter}}(image);
+    state.style()->setBorderImage(image);
 }
 
 {{declare_value_function(property_id)}}
 {
-    NinePieceImage image(state.style()->{{getter}}());
+    NinePieceImage image(state.style()->borderImage());
     {% if modifier_type == 'Outset' %}
     image.setOutset(state.styleMap().mapNinePieceImageQuad(value));
     {% elif modifier_type == 'Repeat' %}
@@ -248,7 +234,7 @@
     {% elif modifier_type == 'Width' %}
     image.setBorderSlices(state.styleMap().mapNinePieceImageQuad(value));
     {% endif %}
-    state.style()->{{setter}}(image);
+    state.style()->setBorderImage(image);
 }
 {% endmacro %}
 {{apply_border_image_modifier('CSSPropertyBorderImageOutset', 'Outset')}}
@@ -352,14 +338,12 @@
 {% endmacro %}
 
 {% macro apply_fill_layer(property_id, fill_type) %}
-{% set layer_type = 'Background' if 'Background' in property_id else 'Mask' %}
-{% set fill_layer_type = layer_type + 'FillLayer' %}
-{% set access_layers = 'access' + layer_type + 'Layers' %}
+{% set access_layers = 'accessBackgroundLayers' %}
 {% set map_fill = 'mapFill' + fill_type %}
 {{declare_initial_function(property_id)}}
 {
     FillLayer* currChild = &state.style()->{{access_layers}}();
-    currChild->set{{fill_type}}(FillLayer::initialFill{{fill_type}}({{fill_layer_type}}));
+    currChild->set{{fill_type}}(FillLayer::initialFill{{fill_type}}(BackgroundFillLayer));
     for (currChild = currChild->next(); currChild; currChild = currChild->next())
         currChild->clear{{fill_type}}();
 }
@@ -368,7 +352,7 @@
 {
     FillLayer* currChild = &state.style()->{{access_layers}}();
     FillLayer* prevChild = 0;
-    const FillLayer* currParent = &state.parentStyle()->{{layer_type|lower}}Layers();
+    const FillLayer* currParent = &state.parentStyle()->backgroundLayers();
     while (currParent && currParent->is{{fill_type}}Set()) {
         if (!currChild)
             currChild = prevChild->ensureNext();
diff --git a/sky/engine/core/css/SVGCSSValueKeywords.in b/sky/engine/core/css/SVGCSSValueKeywords.in
index 1656bef..7f5bbb1 100644
--- a/sky/engine/core/css/SVGCSSValueKeywords.in
+++ b/sky/engine/core/css/SVGCSSValueKeywords.in
@@ -153,15 +153,10 @@
 // yellow
 yellowgreen
 
-// mask-type / mask-mode
-alpha
-luminance
-
 // CSS_PROP_CLIP_PATH
 // CSS_PROP_CLIP_RULE
 // nonzero and evenodd part of core CSS values now.
 
-// CSS_PROP_MASK
 // CSS_PROP_OPACITY
 // CSS_PROP_ENABLE_BACKGROUND
 accumulate
diff --git a/sky/engine/core/css/StylePropertySerializer.cpp b/sky/engine/core/css/StylePropertySerializer.cpp
index 8196652..86d714c 100644
--- a/sky/engine/core/css/StylePropertySerializer.cpp
+++ b/sky/engine/core/css/StylePropertySerializer.cpp
@@ -482,7 +482,7 @@
                     else
                         yValue = nextValue;
 
-                    // background-repeat-x(y) or mask-repeat-x(y) may be like this : "initial, repeat". We can omit the implicit initial values
+                    // background-repeat-x(y) may be like this : "initial, repeat". We can omit the implicit initial values
                     // before starting to compare their values.
                     if (value->isImplicitInitialValue() || yValue->isImplicitInitialValue())
                         continue;
diff --git a/sky/engine/core/css/parser/CSSPropertyParser.cpp b/sky/engine/core/css/parser/CSSPropertyParser.cpp
index 6212e8d..4beb299 100644
--- a/sky/engine/core/css/parser/CSSPropertyParser.cpp
+++ b/sky/engine/core/css/parser/CSSPropertyParser.cpp
@@ -1767,7 +1767,7 @@
         return nullptr;
 
     String attrName = a->string;
-    // CSS allows identifiers with "-" at the start, like "-webkit-mask-image".
+    // CSS allows identifiers with "-" at the start, like "-webkit-foo".
     // But HTML attribute names can't have those characters, and we should not
     // even parse them inside attr().
     if (attrName[0] == '-')
@@ -2227,9 +2227,9 @@
                 parsedValue2 = createPrimitiveNumericValue(value);
         }
     } else if (!parsedValue2 && propId == CSSPropertyWebkitBackgroundSize) {
+        // FIXME(sky): Remove webkit-background-size.
         // For backwards compatibility we set the second value to the first if it is omitted.
-        // We only need to do this for -webkit-background-size. It should be safe to let masks match
-        // the real property.
+        // We only need to do this for -webkit-background-size.
         parsedValue2 = parsedValue1;
     }
 
@@ -4656,8 +4656,8 @@
     }
 
     if (context.allowFinalCommit()) {
-        // FIXME: For backwards compatibility, -webkit-border-image, -webkit-mask-box-image and -webkit-box-reflect have to do a fill by default.
-        // FIXME: What do we do with -webkit-box-reflect and -webkit-mask-box-image? Probably just have to leave them filling...
+        // FIXME(sky): Remove this.
+        // FIXME: For backwards compatibility, -webkit-border-image has to do a fill by default.
         if (propId == CSSPropertyWebkitBorderImage)
             context.commitFill();
 
diff --git a/sky/engine/core/css/resolver/CSSToStyleMap.cpp b/sky/engine/core/css/resolver/CSSToStyleMap.cpp
index 40506ca..5129051 100644
--- a/sky/engine/core/css/resolver/CSSToStyleMap.cpp
+++ b/sky/engine/core/css/resolver/CSSToStyleMap.cpp
@@ -256,33 +256,6 @@
         layer->setBackgroundYOrigin(*(pair->first()));
 }
 
-void CSSToStyleMap::mapFillMaskSourceType(FillLayer* layer, CSSValue* value) const
-{
-    EMaskSourceType type = FillLayer::initialFillMaskSourceType(layer->type());
-    if (value->isInitialValue()) {
-        layer->setMaskSourceType(type);
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    switch (toCSSPrimitiveValue(value)->getValueID()) {
-    case CSSValueAlpha:
-        type = MaskAlpha;
-        break;
-    case CSSValueLuminance:
-        type = MaskLuminance;
-        break;
-    case CSSValueAuto:
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-
-    layer->setMaskSourceType(type);
-}
-
 double CSSToStyleMap::mapAnimationDelay(CSSValue* value)
 {
     if (value->isInitialValue())
diff --git a/sky/engine/core/css/resolver/CSSToStyleMap.h b/sky/engine/core/css/resolver/CSSToStyleMap.h
index a934b6e..f8c2bb2 100644
--- a/sky/engine/core/css/resolver/CSSToStyleMap.h
+++ b/sky/engine/core/css/resolver/CSSToStyleMap.h
@@ -61,7 +61,6 @@
     void mapFillSize(FillLayer*, CSSValue*) const;
     void mapFillXPosition(FillLayer*, CSSValue*) const;
     void mapFillYPosition(FillLayer*, CSSValue*) const;
-    void mapFillMaskSourceType(FillLayer*, CSSValue*) const;
 
     static double mapAnimationDelay(CSSValue*);
     static Timing::PlaybackDirection mapAnimationDirection(CSSValue*);
diff --git a/sky/engine/core/css/resolver/StyleAdjuster.cpp b/sky/engine/core/css/resolver/StyleAdjuster.cpp
index 20e8750..3ca4fd0 100644
--- a/sky/engine/core/css/resolver/StyleAdjuster.cpp
+++ b/sky/engine/core/css/resolver/StyleAdjuster.cpp
@@ -149,11 +149,10 @@
 
     // Auto z-index becomes 0 for the root element and transparent objects. This prevents
     // cases where objects that should be blended as a single unit end up with a non-transparent
-    // object wedged in between them. Auto z-index also becomes 0 for objects that specify transforms/masks/reflections.
+    // object wedged in between them. Auto z-index also becomes 0 for objects that specify transforms.
     if (style->hasAutoZIndex() && ((element.document().documentElement() == element)
         || style->hasOpacity()
         || style->hasTransformRelatedProperty()
-        || style->hasMask()
         || style->clipPath()
         || style->hasFilter()
         || hasWillChangeThatCreatesStackingContext(style)))
@@ -176,7 +175,6 @@
 
     // Cull out any useless layers and also repeat patterns into additional layers.
     style->adjustBackgroundLayers();
-    style->adjustMaskLayers();
 
     // If we have transitions, or animations, do not share this style.
     if (style->transitions() || style->animations())
diff --git a/sky/engine/core/rendering/RenderBlock.cpp b/sky/engine/core/rendering/RenderBlock.cpp
index 6fde31e..5f6fd6d 100644
--- a/sky/engine/core/rendering/RenderBlock.cpp
+++ b/sky/engine/core/rendering/RenderBlock.cpp
@@ -536,7 +536,7 @@
     if (isDocumentElement() || hasOverflowClip()
         || isPositioned()
         || isInlineBlock()
-        || hasTransform() || hasMask()
+        || hasTransform()
         || isFlexItem())
         return true;
 
diff --git a/sky/engine/core/rendering/RenderBoxModelObject.cpp b/sky/engine/core/rendering/RenderBoxModelObject.cpp
index 2e7f851..a032277 100644
--- a/sky/engine/core/rendering/RenderBoxModelObject.cpp
+++ b/sky/engine/core/rendering/RenderBoxModelObject.cpp
@@ -441,7 +441,6 @@
     }
 
     GraphicsContextStateSaver backgroundClipStateSaver(*context, false);
-    IntRect maskRect;
 
     switch (bgLayer.clip()) {
     case PaddingFillBox:
@@ -500,8 +499,6 @@
             CompositeOperator compositeOp = bgLayer.composite();
             RenderObject* clientForBackgroundImage = backgroundObject ? backgroundObject : this;
             RefPtr<Image> image = bgImage->image(clientForBackgroundImage, geometry.tileSize());
-            if (bgLayer.maskSourceType() == MaskLuminance)
-                context->setColorFilter(ColorFilterLuminanceToAlpha);
             InterpolationQuality previousInterpolationQuality = context->imageInterpolationQuality();
             context->setImageInterpolationQuality(InterpolationLow);
             context->drawTiledImage(image.get(), geometry.destRect(), geometry.relativePhase(), geometry.tileSize(),
diff --git a/sky/engine/core/rendering/RenderImage.cpp b/sky/engine/core/rendering/RenderImage.cpp
index 005b42f..85554f0 100644
--- a/sky/engine/core/rendering/RenderImage.cpp
+++ b/sky/engine/core/rendering/RenderImage.cpp
@@ -109,7 +109,7 @@
         return;
     }
 
-    if (hasBoxDecorationBackground() || hasMask())
+    if (hasBoxDecorationBackground())
         RenderReplaced::imageChanged(newImage, rect);
 
     ASSERT(isRooted());
diff --git a/sky/engine/core/rendering/RenderLayer.cpp b/sky/engine/core/rendering/RenderLayer.cpp
index 6e4d5ea..2d8f89d 100644
--- a/sky/engine/core/rendering/RenderLayer.cpp
+++ b/sky/engine/core/rendering/RenderLayer.cpp
@@ -474,14 +474,10 @@
 static void expandClipRectForDescendantsAndReflection(LayoutRect& clipRect, const RenderLayer* layer, const RenderLayer* rootLayer,
     TransparencyClipBoxBehavior transparencyBehavior, const LayoutSize& subPixelAccumulation)
 {
-    // If we have a mask, then the clip is limited to the border box area (and there is
-    // no need to examine child layers).
-    if (!layer->renderer()->hasMask()) {
-        // Note: we don't have to walk z-order lists since transparent elements always establish
-        // a stacking container. This means we can just walk the layer tree directly.
-        for (RenderLayer* curr = layer->firstChild(); curr; curr = curr->nextSibling())
-            clipRect.unite(transparencyClipBox(curr, rootLayer, transparencyBehavior, DescendantsOfTransparencyClipBox, subPixelAccumulation));
-    }
+    // Note: we don't have to walk z-order lists since transparent elements always establish
+    // a stacking container. This means we can just walk the layer tree directly.
+    for (RenderLayer* curr = layer->firstChild(); curr; curr = curr->nextSibling())
+        clipRect.unite(transparencyClipBox(curr, rootLayer, transparencyBehavior, DescendantsOfTransparencyClipBox, subPixelAccumulation));
 }
 
 static LayoutRect transparencyClipBox(const RenderLayer* layer, const RenderLayer* rootLayer, TransparencyClipBoxBehavior transparencyBehavior,
@@ -1580,7 +1576,7 @@
     if (hasNonEmptyChildRenderers())
         return true;
 
-    if (renderer()->isReplaced() || renderer()->hasMask())
+    if (renderer()->isReplaced())
         return true;
 
     if (hasVisibleBoxDecorations())
diff --git a/sky/engine/core/rendering/RenderLayer.h b/sky/engine/core/rendering/RenderLayer.h
index ef27192..b0f7fb8 100644
--- a/sky/engine/core/rendering/RenderLayer.h
+++ b/sky/engine/core/rendering/RenderLayer.h
@@ -96,7 +96,7 @@
 
     void setLayerType(LayerType layerType) { m_layerType = layerType; }
 
-    bool isTransparent() const { return renderer()->isTransparent() || renderer()->hasMask(); }
+    bool isTransparent() const { return renderer()->isTransparent(); }
     RenderLayer* transparentPaintingAncestor();
     void beginTransparencyLayers(GraphicsContext*, const RenderLayer* rootLayer, const LayoutRect& paintDirtyRect, const LayoutSize& subPixelAccumulation);
 
diff --git a/sky/engine/core/rendering/RenderObject.cpp b/sky/engine/core/rendering/RenderObject.cpp
index 86fe194..9846b90 100644
--- a/sky/engine/core/rendering/RenderObject.cpp
+++ b/sky/engine/core/rendering/RenderObject.cpp
@@ -1201,10 +1201,7 @@
     setStyleInternal(style);
 
     updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : 0, m_style->backgroundLayers());
-    updateFillImages(oldStyle ? &oldStyle->maskLayers() : 0, m_style->maskLayers());
-
     updateImage(oldStyle ? oldStyle->borderImage().image() : 0, m_style->borderImage().image());
-    updateImage(oldStyle ? oldStyle->maskBoxImage().image() : 0, m_style->maskBoxImage().image());
 
     bool doesNotNeedLayout = !m_parent || isText();
 
@@ -1666,16 +1663,8 @@
                 backgroundImage->removeClient(this);
         }
 
-        for (const FillLayer* maskLayer = &m_style->maskLayers(); maskLayer; maskLayer = maskLayer->next()) {
-            if (StyleImage* maskImage = maskLayer->image())
-                maskImage->removeClient(this);
-        }
-
         if (StyleImage* borderImage = m_style->borderImage().image())
             borderImage->removeClient(this);
-
-        if (StyleImage* maskBoxImage = m_style->maskBoxImage().image())
-            maskBoxImage->removeClient(this);
     }
     delete this;
 }
diff --git a/sky/engine/core/rendering/RenderObject.h b/sky/engine/core/rendering/RenderObject.h
index d85619a..d097263 100644
--- a/sky/engine/core/rendering/RenderObject.h
+++ b/sky/engine/core/rendering/RenderObject.h
@@ -372,7 +372,6 @@
     bool hasClipOrOverflowClip() const { return hasClip() || hasOverflowClip(); }
 
     bool hasTransform() const { return m_bitfields.hasTransform(); }
-    bool hasMask() const { return style() && style()->hasMask(); }
     bool hasClipPath() const { return style() && style()->clipPath(); }
     bool hasHiddenBackface() const { return style() && style()->backfaceVisibility() == BackfaceVisibilityHidden; }
 
@@ -626,7 +625,7 @@
     bool shouldUseTransformFromContainer(const RenderObject* container) const;
     void getTransformFromContainer(const RenderObject* container, const LayoutSize& offsetInContainer, TransformationMatrix&) const;
 
-    bool createsGroup() const { return isTransparent() || hasMask() || hasFilter(); }
+    bool createsGroup() const { return isTransparent() || hasFilter(); }
 
     virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& /* additionalOffset */, const RenderLayerModelObject* /* paintContainer */ = 0) const { };
 
diff --git a/sky/engine/core/rendering/style/FillLayer.cpp b/sky/engine/core/rendering/style/FillLayer.cpp
index fd565ac..3bcd159 100644
--- a/sky/engine/core/rendering/style/FillLayer.cpp
+++ b/sky/engine/core/rendering/style/FillLayer.cpp
@@ -56,7 +56,6 @@
     , m_composite(FillLayer::initialFillComposite(type))
     , m_sizeType(useInitialValues ? FillLayer::initialFillSizeType(type) : SizeNone)
     , m_blendMode(FillLayer::initialFillBlendMode(type))
-    , m_maskSourceType(FillLayer::initialFillMaskSourceType(type))
     , m_backgroundXOrigin(LeftEdge)
     , m_backgroundYOrigin(TopEdge)
     , m_imageSet(useInitialValues)
@@ -69,9 +68,8 @@
     , m_yPosSet(useInitialValues)
     , m_backgroundXOriginSet(false)
     , m_backgroundYOriginSet(false)
-    , m_compositeSet(useInitialValues || type == MaskFillLayer)
+    , m_compositeSet(useInitialValues)
     , m_blendModeSet(useInitialValues)
-    , m_maskSourceTypeSet(useInitialValues)
     , m_type(type)
 {
 }
@@ -90,7 +88,6 @@
     , m_composite(o.m_composite)
     , m_sizeType(o.m_sizeType)
     , m_blendMode(o.m_blendMode)
-    , m_maskSourceType(o.m_maskSourceType)
     , m_backgroundXOrigin(o.m_backgroundXOrigin)
     , m_backgroundYOrigin(o.m_backgroundYOrigin)
     , m_imageSet(o.m_imageSet)
@@ -105,7 +102,6 @@
     , m_backgroundYOriginSet(o.m_backgroundYOriginSet)
     , m_compositeSet(o.m_compositeSet)
     , m_blendModeSet(o.m_blendModeSet)
-    , m_maskSourceTypeSet(o.m_maskSourceTypeSet)
     , m_type(o.m_type)
 {
 }
@@ -138,7 +134,6 @@
     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;
@@ -150,7 +145,6 @@
     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;
 
@@ -165,7 +159,7 @@
             && 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_maskSourceType == o.m_maskSourceType
+            && 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);
 }
diff --git a/sky/engine/core/rendering/style/FillLayer.h b/sky/engine/core/rendering/style/FillLayer.h
index a59fbdd..9bdc1a0 100644
--- a/sky/engine/core/rendering/style/FillLayer.h
+++ b/sky/engine/core/rendering/style/FillLayer.h
@@ -80,7 +80,6 @@
     const 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; }
@@ -104,7 +103,6 @@
     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(const Length& position) { m_xPosition = position; m_xPosSet = true; m_backgroundXOriginSet = false; m_backgroundXOrigin = LeftEdge; }
@@ -121,7 +119,6 @@
     void setSizeType(EFillSizeType b) { m_sizeType = b; }
     void setSizeLength(const 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()
@@ -143,7 +140,6 @@
     void clearComposite() { m_compositeSet = false; }
     void clearBlendMode() { m_blendModeSet = false; }
     void clearSize() { m_sizeType = SizeNone; }
-    void clearMaskSourceType() { m_maskSourceTypeSet = false; }
 
     FillLayer& operator=(const FillLayer& o);
     FillLayer(const FillLayer& o);
@@ -193,7 +189,6 @@
     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 initialFillMaskSourceType(EFillLayerType) { return MaskAlpha; }
 
 private:
     friend class RenderStyle;
@@ -219,7 +214,6 @@
     unsigned m_composite : 4; // CompositeOperator
     unsigned m_sizeType : 2; // EFillSizeType
     unsigned m_blendMode : 5; // WebBlendMode
-    unsigned m_maskSourceType : 1; // EMaskSourceType
     unsigned m_backgroundXOrigin : 2; // BackgroundEdgeOrigin
     unsigned m_backgroundYOrigin : 2; // BackgroundEdgeOrigin
 
@@ -235,7 +229,6 @@
     unsigned m_backgroundYOriginSet : 1;
     unsigned m_compositeSet : 1;
     unsigned m_blendModeSet : 1;
-    unsigned m_maskSourceTypeSet : 1;
 
     unsigned m_type : 1; // EFillLayerType
 
diff --git a/sky/engine/core/rendering/style/NinePieceImage.h b/sky/engine/core/rendering/style/NinePieceImage.h
index 303c485..c9fded9 100644
--- a/sky/engine/core/rendering/style/NinePieceImage.h
+++ b/sky/engine/core/rendering/style/NinePieceImage.h
@@ -110,13 +110,6 @@
         m_data.access()->verticalRule = other.m_data->verticalRule;
     }
 
-    void setMaskDefaults()
-    {
-        m_data.access()->imageSlices = LengthBox(0);
-        m_data.access()->fill = true;
-        m_data.access()->borderSlices = BorderImageLengthBox(Length(Auto));
-    }
-
     static LayoutUnit computeOutset(const BorderImageLength& outsetSide, LayoutUnit borderSide)
     {
         if (outsetSide.isNumber())
diff --git a/sky/engine/core/rendering/style/RenderStyle.h b/sky/engine/core/rendering/style/RenderStyle.h
index 0372043..27a5100 100644
--- a/sky/engine/core/rendering/style/RenderStyle.h
+++ b/sky/engine/core/rendering/style/RenderStyle.h
@@ -343,11 +343,6 @@
         return imageOutsets(borderImage());
     }
 
-    LayoutBoxExtent maskBoxImageOutsets() const
-    {
-        return imageOutsets(maskBoxImage());
-    }
-
     bool hasFilterOutsets() const { return hasFilter() && filter().hasOutsets(); }
     FilterOutsets filterOutsets() const { return hasFilter() ? filter().outsets() : FilterOutsets(); }
 
@@ -567,26 +562,6 @@
     FillLayer& accessBackgroundLayers() { return m_background.access()->m_background; }
     const FillLayer& backgroundLayers() const { return m_background->background(); }
 
-    StyleImage* maskImage() const { return rareNonInheritedData->m_mask.image(); }
-    EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatX()); }
-    EFillRepeat maskRepeatY() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatY()); }
-    CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(rareNonInheritedData->m_mask.composite()); }
-    EFillBox maskClip() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.clip()); }
-    EFillBox maskOrigin() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.origin()); }
-    const Length& maskXPosition() const { return rareNonInheritedData->m_mask.xPosition(); }
-    const Length& maskYPosition() const { return rareNonInheritedData->m_mask.yPosition(); }
-    EFillSizeType maskSizeType() const { return rareNonInheritedData->m_mask.sizeType(); }
-    const LengthSize& maskSizeLength() const { return rareNonInheritedData->m_mask.sizeLength(); }
-    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(); }
-    const LengthBox& maskBoxImageSlices() const { return rareNonInheritedData->m_maskBoxImage.imageSlices(); }
-    bool maskBoxImageSlicesFill() const { return rareNonInheritedData->m_maskBoxImage.fill(); }
-    const BorderImageLengthBox& maskBoxImageWidth() const { return rareNonInheritedData->m_maskBoxImage.borderSlices(); }
-    const BorderImageLengthBox& maskBoxImageOutset() const { return rareNonInheritedData->m_maskBoxImage.outset(); }
-
     short horizontalBorderSpacing() const;
     short verticalBorderSpacing() const;
     EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_flags._empty_cells); }
@@ -728,8 +703,6 @@
     void applyTransform(TransformationMatrix&, const LayoutSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const;
     void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, ApplyTransformOrigin = IncludeTransformOrigin) const;
 
-    bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
-
     unsigned tabSize() const { return rareInheritedData->m_tabSize; }
 
     // End CSS3 Getters
@@ -931,38 +904,6 @@
         }
     }
 
-    void adjustMaskLayers()
-    {
-        if (maskLayers().next()) {
-            accessMaskLayers().cullEmptyLayers();
-            accessMaskLayers().fillUnsetProperties();
-        }
-    }
-
-    void setMaskImage(PassRefPtr<StyleImage> v) { rareNonInheritedData.access()->m_mask.setImage(v); }
-
-    void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(rareNonInheritedData, m_maskBoxImage, b); }
-    void setMaskBoxImageSource(PassRefPtr<StyleImage> v) { rareNonInheritedData.access()->m_maskBoxImage.setImage(v); }
-    void setMaskBoxImageSlices(const LengthBox& slices)
-    {
-        rareNonInheritedData.access()->m_maskBoxImage.setImageSlices(slices);
-    }
-    void setMaskBoxImageSlicesFill(bool fill)
-    {
-        rareNonInheritedData.access()->m_maskBoxImage.setFill(fill);
-    }
-    void setMaskBoxImageWidth(const BorderImageLengthBox& slices)
-    {
-        rareNonInheritedData.access()->m_maskBoxImage.setBorderSlices(slices);
-    }
-    void setMaskBoxImageOutset(const BorderImageLengthBox& outset)
-    {
-        rareNonInheritedData.access()->m_maskBoxImage.setOutset(outset);
-    }
-    void setMaskXPosition(const Length& length) { SET_VAR(rareNonInheritedData, m_mask.m_xPosition, length); }
-    void setMaskYPosition(const Length& length) { SET_VAR(rareNonInheritedData, m_mask.m_yPosition, length); }
-    void setMaskSize(const LengthSize& s) { SET_VAR(rareNonInheritedData, m_mask.m_sizeLength, s); }
-
     void setHorizontalBorderSpacing(short);
     void setVerticalBorderSpacing(short);
     void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
@@ -1281,7 +1222,6 @@
     static ImageResolutionSnap initialImageResolutionSnap() { return ImageResolutionNoSnap; }
     static float initialImageResolution() { return 1; }
     static StyleImage* initialBorderImageSource() { return 0; }
-    static StyleImage* initialMaskBoxImageSource() { return 0; }
     static TouchAction initialTouchAction() { return TouchActionAuto; }
     static TouchActionDelay initialTouchActionDelay() { return TouchActionDelayScript; }
     static ShadowList* initialBoxShadow() { return 0; }
diff --git a/sky/engine/core/rendering/style/RenderStyleConstants.h b/sky/engine/core/rendering/style/RenderStyleConstants.h
index 7c51802..0eb142f 100644
--- a/sky/engine/core/rendering/style/RenderStyleConstants.h
+++ b/sky/engine/core/rendering/style/RenderStyleConstants.h
@@ -88,8 +88,9 @@
     RepeatFill, NoRepeatFill, RoundFill, SpaceFill
 };
 
+// FIXME(sky): Remove this enum.
 enum EFillLayerType {
-    BackgroundFillLayer, MaskFillLayer
+    BackgroundFillLayer
 };
 
 // CSS3 Background Values
@@ -98,9 +99,6 @@
 // CSS3 Background Position
 enum BackgroundEdgeOrigin { TopEdge, RightEdge, BottomEdge, LeftEdge };
 
-// CSS Mask Source Types
-enum EMaskSourceType { MaskAlpha, MaskLuminance };
-
 // Deprecated Flexible Box Properties
 
 enum EBoxPack { Start, Center, End, Justify };
diff --git a/sky/engine/core/rendering/style/StyleRareNonInheritedData.cpp b/sky/engine/core/rendering/style/StyleRareNonInheritedData.cpp
index a8a557e..ca4c4d7 100644
--- a/sky/engine/core/rendering/style/StyleRareNonInheritedData.cpp
+++ b/sky/engine/core/rendering/style/StyleRareNonInheritedData.cpp
@@ -37,7 +37,6 @@
     , m_perspective(RenderStyle::initialPerspective())
     , m_perspectiveOriginX(RenderStyle::initialPerspectiveOriginX())
     , m_perspectiveOriginY(RenderStyle::initialPerspectiveOriginY())
-    , m_mask(MaskFillLayer, true)
     , m_pageSize()
     , m_clipPath(RenderStyle::initialClipPath())
     , m_textDecorationColor(StyleColor::currentColor())
@@ -66,7 +65,6 @@
     , m_justifySelf(RenderStyle::initialJustifySelf())
     , m_justifySelfOverflowAlignment(RenderStyle::initialJustifySelfOverflowAlignment())
 {
-    m_maskBoxImage.setMaskDefaults();
 }
 
 StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInheritedData& o)
@@ -85,8 +83,6 @@
     , m_boxShadow(o.m_boxShadow)
     , m_animations(o.m_animations ? CSSAnimationData::create(*o.m_animations) : nullptr)
     , m_transitions(o.m_transitions ? CSSTransitionData::create(*o.m_transitions) : nullptr)
-    , m_mask(o.m_mask)
-    , m_maskBoxImage(o.m_maskBoxImage)
     , m_pageSize(o.m_pageSize)
     , m_clipPath(o.m_clipPath)
     , m_textDecorationColor(o.m_textDecorationColor)
@@ -137,8 +133,6 @@
         && shadowDataEquivalent(o)
         && animationDataEquivalent(o)
         && transitionDataEquivalent(o)
-        && m_mask == o.m_mask
-        && m_maskBoxImage == o.m_maskBoxImage
         && m_pageSize == o.m_pageSize
         && m_clipPath == o.m_clipPath
         && m_textDecorationColor == o.m_textDecorationColor
diff --git a/sky/engine/core/rendering/style/StyleRareNonInheritedData.h b/sky/engine/core/rendering/style/StyleRareNonInheritedData.h
index 80b8a83..8b4c974 100644
--- a/sky/engine/core/rendering/style/StyleRareNonInheritedData.h
+++ b/sky/engine/core/rendering/style/StyleRareNonInheritedData.h
@@ -102,9 +102,6 @@
     OwnPtr<CSSAnimationData> m_animations;
     OwnPtr<CSSTransitionData> m_transitions;
 
-    FillLayer m_mask;
-    NinePieceImage m_maskBoxImage;
-
     LengthSize m_pageSize;
 
     RefPtr<ClipPathOperation> m_clipPath;
diff --git a/sky/engine/platform/graphics/GraphicsContext.cpp b/sky/engine/platform/graphics/GraphicsContext.cpp
index 9c1db22..1a8451c 100644
--- a/sky/engine/platform/graphics/GraphicsContext.cpp
+++ b/sky/engine/platform/graphics/GraphicsContext.cpp
@@ -1649,20 +1649,7 @@
 
 PassRefPtr<SkColorFilter> GraphicsContext::WebCoreColorFilterToSkiaColorFilter(ColorFilter colorFilter)
 {
-    switch (colorFilter) {
-    case ColorFilterLuminanceToAlpha:
-        return adoptRef(SkLumaColorFilter::Create());
-    case ColorFilterLinearRGBToSRGB:
-        return ImageBuffer::createColorSpaceFilter(ColorSpaceLinearRGB, ColorSpaceDeviceRGB);
-    case ColorFilterSRGBToLinearRGB:
-        return ImageBuffer::createColorSpaceFilter(ColorSpaceDeviceRGB, ColorSpaceLinearRGB);
-    case ColorFilterNone:
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-        break;
-    }
-
+    // FIXME(sky): Remove
     return nullptr;
 }
 
diff --git a/sky/engine/platform/graphics/GraphicsTypes.h b/sky/engine/platform/graphics/GraphicsTypes.h
index 9924996..b155f45 100644
--- a/sky/engine/platform/graphics/GraphicsTypes.h
+++ b/sky/engine/platform/graphics/GraphicsTypes.h
@@ -102,11 +102,9 @@
 };
 typedef unsigned TextDrawingModeFlags;
 
+// FIXME(sky): Remove this enum.
 enum ColorFilter {
     ColorFilterNone,
-    ColorFilterLuminanceToAlpha,
-    ColorFilterSRGBToLinearRGB,
-    ColorFilterLinearRGBToSRGB
 };
 
 enum WindRule {
diff --git a/sky/engine/public/platform/WebLayer.h b/sky/engine/public/platform/WebLayer.h
index fa357f5..27fb930 100644
--- a/sky/engine/public/platform/WebLayer.h
+++ b/sky/engine/public/platform/WebLayer.h
@@ -62,10 +62,6 @@
     virtual void setBounds(const WebSize&) = 0;
     virtual WebSize bounds() const = 0;
 
-    virtual void setMasksToBounds(bool) = 0;
-    virtual bool masksToBounds() const = 0;
-
-    virtual void setMaskLayer(WebLayer*) = 0;
     virtual void setReplicaLayer(WebLayer*) = 0;
 
     virtual void setOpacity(float) = 0;