Kill the DeprecatedStyleBuilder
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Jan 2015 22:40:14 +0000 (22:40 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Jan 2015 22:40:14 +0000 (22:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140034

Reviewed by Darin Adler.

Move FillLayer properties to the new StyleBuilder and get rid of the
DeprecatedStyleBuilder now that all its CSS properties have been ported
to the new StyleBuilder.

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

16 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSAllInOne.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSToStyleMap.cpp
Source/WebCore/css/CSSToStyleMap.h
Source/WebCore/css/DeprecatedStyleBuilder.cpp [deleted file]
Source/WebCore/css/DeprecatedStyleBuilder.h [deleted file]
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleResolver.h
Source/WebCore/css/makeprop.pl
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/rendering/style/FillLayer.cpp
Source/WebCore/rendering/style/FillLayer.h
Source/WebCore/rendering/style/RenderStyle.h

index 3b11060..203b484 100644 (file)
@@ -1254,7 +1254,6 @@ set(WebCore_SOURCES
     css/CSSValueList.cpp
     css/CSSValuePool.cpp
     css/DOMWindowCSS.cpp
-    css/DeprecatedStyleBuilder.cpp
     css/DocumentRuleSets.cpp
     css/ElementRuleCollector.cpp
     css/FontLoader.cpp
index f01b05f..97d20ea 100644 (file)
@@ -1,5 +1,16 @@
 2015-01-02  Chris Dumez  <cdumez@apple.com>
 
+        Kill the DeprecatedStyleBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=140034
+
+        Reviewed by Darin Adler.
+
+        Move FillLayer properties to the new StyleBuilder and get rid of the
+        DeprecatedStyleBuilder now that all its CSS properties have been ported
+        to the new StyleBuilder.
+
+2015-01-02  Chris Dumez  <cdumez@apple.com>
+
         Move 'font-size' CSS property to the new StyleBuilder
         https://bugs.webkit.org/show_bug.cgi?id=140010
 
index efb98c7..7b163c2 100644 (file)
                E0FEF372B27C53EAC1C1FBEE /* EventSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E0FEF371B27C53EAC1C1FBEE /* EventSource.cpp */; };
                E0FEF372B37C53EAC1C1FBEE /* JSEventSource.h in Headers */ = {isa = PBXBuildFile; fileRef = E0FEF371B37C53EAC1C1FBEE /* JSEventSource.h */; };
                E0FEF372B47C53EAC1C1FBEE /* JSEventSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E0FEF371B47C53EAC1C1FBEE /* JSEventSource.cpp */; };
-               E100EE751546EAC100BA11D1 /* DeprecatedStyleBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E100EE731546EAC100BA11D1 /* DeprecatedStyleBuilder.cpp */; };
-               E100EE761546EAC100BA11D1 /* DeprecatedStyleBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = E100EE741546EAC100BA11D1 /* DeprecatedStyleBuilder.h */; };
                E107400D0E77BDC00033AF24 /* JSMessageChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E107400B0E77BDC00033AF24 /* JSMessageChannel.cpp */; };
                E107400E0E77BDC00033AF24 /* JSMessageChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = E107400C0E77BDC00033AF24 /* JSMessageChannel.h */; };
                E10B937C0B73C00A003ED890 /* JSCustomXPathNSResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = E10B937B0B73C00A003ED890 /* JSCustomXPathNSResolver.h */; };
                E0FEF371B27C53EAC1C1FBEE /* EventSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventSource.cpp; sourceTree = "<group>"; };
                E0FEF371B37C53EAC1C1FBEE /* JSEventSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEventSource.h; sourceTree = "<group>"; };
                E0FEF371B47C53EAC1C1FBEE /* JSEventSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEventSource.cpp; sourceTree = "<group>"; };
-               E100EE731546EAC100BA11D1 /* DeprecatedStyleBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeprecatedStyleBuilder.cpp; sourceTree = "<group>"; };
-               E100EE741546EAC100BA11D1 /* DeprecatedStyleBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedStyleBuilder.h; sourceTree = "<group>"; };
                E107400B0E77BDC00033AF24 /* JSMessageChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessageChannel.cpp; sourceTree = "<group>"; };
                E107400C0E77BDC00033AF24 /* JSMessageChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMessageChannel.h; sourceTree = "<group>"; };
                E10B937B0B73C00A003ED890 /* JSCustomXPathNSResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomXPathNSResolver.h; sourceTree = "<group>"; };
                                E49BDA0A131FD3E5003C56F0 /* CSSValuePool.cpp */,
                                E49BD9F9131FD2ED003C56F0 /* CSSValuePool.h */,
                                A80E6CE10A1989CA007FB8C5 /* DashboardRegion.h */,
-                               E100EE731546EAC100BA11D1 /* DeprecatedStyleBuilder.cpp */,
-                               E100EE741546EAC100BA11D1 /* DeprecatedStyleBuilder.h */,
                                4A4F48A716B0DFC000EDBB29 /* DocumentRuleSets.cpp */,
                                4A4F48A816B0DFC000EDBB29 /* DocumentRuleSets.h */,
                                FD677735195CAB200072E0D3 /* DOMWindowCSS.cpp */,
                                93309DDF099E64920056E581 /* DeleteFromTextNodeCommand.h in Headers */,
                                93309DE1099E64920056E581 /* DeleteSelectionCommand.h in Headers */,
                                FD1660A513787C6D001FFA7B /* DenormalDisabler.h in Headers */,
-                               E100EE761546EAC100BA11D1 /* DeprecatedStyleBuilder.h in Headers */,
                                A7C9ABF91357A3BF00F5503F /* DetailsMarkerControl.h in Headers */,
                                CCC2B51415F613060048CDD6 /* DeviceClient.h in Headers */,
                                CCC2B51615F613060048CDD6 /* DeviceController.h in Headers */,
                                FD31603012B0267600C1A359 /* DelayProcessor.cpp in Sources */,
                                93309DDE099E64920056E581 /* DeleteFromTextNodeCommand.cpp in Sources */,
                                93309DE0099E64920056E581 /* DeleteSelectionCommand.cpp in Sources */,
-                               E100EE751546EAC100BA11D1 /* DeprecatedStyleBuilder.cpp in Sources */,
                                A7C9ABF81357A3BF00F5503F /* DetailsMarkerControl.cpp in Sources */,
                                CCC2B51515F613060048CDD6 /* DeviceController.cpp in Sources */,
                                31EAF97F121435A400E7C1BF /* DeviceMotionClientIOS.mm in Sources */,
index 021ef6d..56fe54f 100644 (file)
@@ -75,7 +75,6 @@
 #include "CSSValueList.cpp"
 #include "CSSValuePool.cpp"
 #include "DOMWindowCSS.cpp"
-#include "DeprecatedStyleBuilder.cpp"
 #include "DocumentRuleSets.cpp"
 #include "ElementRuleCollector.cpp"
 #include "InspectorCSSOMWrappers.cpp"
index 0626dd6..8729db0 100644 (file)
 // * FontProperty:
 // Indicates that this CSS property is font-related. It must have corresponding
 // methods on the FontDescription class.
+//
+// * FillLayerProperty:
+// Indicates that this CSS property is a FillLayer property. It must have
+// corresponding methods on the FillLayer class.
 
 
 // high-priority property names have to be listed first, to simplify the check
@@ -129,19 +133,19 @@ animation-name [AnimationProperty, TypeName=String, NameForMethods=Name]
 animation-play-state [AnimationProperty, TypeName=EAnimPlayState, NameForMethods=PlayState]
 animation-timing-function [AnimationProperty, TypeName=PassRefPtr<TimingFunction>, NameForMethods=TimingFunction]
 background [LegacyStyleBuilder]
-background-attachment [LegacyStyleBuilder]
-background-blend-mode [LegacyStyleBuilder]
-background-clip [LegacyStyleBuilder]
+background-attachment [FillLayerProperty, TypeName=EFillAttachment, NameForMethods=Attachment]
+background-blend-mode [FillLayerProperty, TypeName=BlendMode, NameForMethods=BlendMode]
+background-clip [FillLayerProperty, TypeName=EFillBox, NameForMethods=Clip]
 background-color [VisitedLinkColorSupport, Initial=invalidColor, NoDefaultColor]
-background-image [LegacyStyleBuilder]
-background-origin [LegacyStyleBuilder]
+background-image [FillLayerProperty, TypeName=StyleImage*, NameForMethods=Image]
+background-origin [FillLayerProperty, TypeName=EFillBox, NameForMethods=Origin]
 background-position [LegacyStyleBuilder]
-background-position-x [LegacyStyleBuilder]
-background-position-y [LegacyStyleBuilder]
+background-position-x [FillLayerProperty, TypeName=Length, NameForMethods=XPosition]
+background-position-y [FillLayerProperty, TypeName=Length, NameForMethods=YPosition]
 background-repeat [LegacyStyleBuilder]
-background-repeat-x [LegacyStyleBuilder]
-background-repeat-y [LegacyStyleBuilder]
-background-size [LegacyStyleBuilder]
+background-repeat-x [FillLayerProperty, TypeName=EFillRepeat, NameForMethods=RepeatX]
+background-repeat-y [FillLayerProperty, TypeName=EFillRepeat, NameForMethods=RepeatY]
+background-size [FillLayerProperty, TypeName=EFillSize, NameForMethods=Size]
 border [LegacyStyleBuilder]
 border-bottom [LegacyStyleBuilder]
 border-bottom-color [VisitedLinkColorSupport, Initial=invalidColor]
@@ -312,13 +316,13 @@ alt [LegacyStyleBuilder]
 -webkit-appearance [TypeName=ControlPart]
 -webkit-aspect-ratio [Inherited, Custom=All]
 -webkit-backface-visibility
--webkit-background-clip [LegacyStyleBuilder]
--webkit-background-composite [LegacyStyleBuilder]
--webkit-background-origin [LegacyStyleBuilder]
+-webkit-background-clip [FillLayerProperty, TypeName=EFillBox, NameForMethods=Clip]
+-webkit-background-composite [FillLayerProperty, TypeName=CompositeOperator, NameForMethods=Composite]
+-webkit-background-origin [FillLayerProperty, TypeName=EFillBox, NameForMethods=Origin]
 // -webkit-background-size differs from background-size only in the interpretation of
 // a single value: -webkit-background-size: l; is equivalent to background-size: l l;
 // whereas background-size: l; is equivalent to background-size: l auto;
--webkit-background-size [LegacyStyleBuilder]
+-webkit-background-size [FillLayerProperty, TypeName=EFillSize, NameForMethods=Size]
 -webkit-border-after [LegacyStyleBuilder]
 -webkit-border-after-color [LegacyStyleBuilder]
 -webkit-border-after-style [LegacyStyleBuilder]
@@ -472,18 +476,18 @@ justify-content
 -webkit-mask-box-image-slice [Custom=All]
 -webkit-mask-box-image-source [Converter=StyleImage<CSSPropertyWebkitMaskBoxImageSource>]
 -webkit-mask-box-image-width [Custom=All]
--webkit-mask-clip [LegacyStyleBuilder]
--webkit-mask-composite [LegacyStyleBuilder]
+-webkit-mask-clip [FillLayerProperty, TypeName=EFillBox, NameForMethods=Clip]
+-webkit-mask-composite [FillLayerProperty, TypeName=CompositeOperator, NameForMethods=Composite]
 -webkit-mask-image [LegacyStyleBuilder]
--webkit-mask-origin [LegacyStyleBuilder]
+-webkit-mask-origin [FillLayerProperty, TypeName=EFillBox, NameForMethods=Origin]
 -webkit-mask-position [LegacyStyleBuilder]
--webkit-mask-position-x [LegacyStyleBuilder]
--webkit-mask-position-y [LegacyStyleBuilder]
+-webkit-mask-position-x [FillLayerProperty, TypeName=Length, NameForMethods=XPosition]
+-webkit-mask-position-y [FillLayerProperty, TypeName=Length, NameForMethods=YPosition]
 -webkit-mask-repeat [LegacyStyleBuilder]
--webkit-mask-repeat-x [LegacyStyleBuilder]
--webkit-mask-repeat-y [LegacyStyleBuilder]
--webkit-mask-size [LegacyStyleBuilder]
--webkit-mask-source-type [LegacyStyleBuilder]
+-webkit-mask-repeat-x [FillLayerProperty, TypeName=EFillRepeat, NameForMethods=RepeatX]
+-webkit-mask-repeat-y [FillLayerProperty, TypeName=EFillRepeat, NameForMethods=RepeatY]
+-webkit-mask-size [FillLayerProperty, TypeName=FillSize, NameForMethods=Size]
+-webkit-mask-source-type [FillLayerProperty, TypeName=EMaskSourceType, NameForMethods=MaskSourceType]
 -webkit-max-logical-width [LegacyStyleBuilder]
 -webkit-max-logical-height [LegacyStyleBuilder]
 -webkit-min-logical-width [LegacyStyleBuilder]
index 16a7dd7..0719abd 100644 (file)
@@ -70,145 +70,139 @@ PassRefPtr<StyleImage> CSSToStyleMap::styleImage(CSSPropertyID propertyId, CSSVa
     return m_resolver->styleImage(propertyId, value);
 }
 
-void CSSToStyleMap::mapFillAttachment(CSSPropertyID, FillLayer* layer, CSSValue* value)
+void CSSToStyleMap::mapFillAttachment(CSSPropertyID, FillLayer& layer, CSSValue& value)
 {
-    if (value->isInitialValue()) {
-        layer->setAttachment(FillLayer::initialFillAttachment(layer->type()));
+    if (value.isInitialValue()) {
+        layer.setAttachment(FillLayer::initialFillAttachment(layer.type()));
         return;
     }
 
-    if (!is<CSSPrimitiveValue>(*value))
+    if (!is<CSSPrimitiveValue>(value))
         return;
 
-    switch (downcast<CSSPrimitiveValue>(*value).getValueID()) {
+    switch (downcast<CSSPrimitiveValue>(value).getValueID()) {
     case CSSValueFixed:
-        layer->setAttachment(FixedBackgroundAttachment);
+        layer.setAttachment(FixedBackgroundAttachment);
         break;
     case CSSValueScroll:
-        layer->setAttachment(ScrollBackgroundAttachment);
+        layer.setAttachment(ScrollBackgroundAttachment);
         break;
     case CSSValueLocal:
-        layer->setAttachment(LocalBackgroundAttachment);
+        layer.setAttachment(LocalBackgroundAttachment);
         break;
     default:
         return;
     }
 }
 
-void CSSToStyleMap::mapFillClip(CSSPropertyID, FillLayer* layer, CSSValue* value)
+void CSSToStyleMap::mapFillClip(CSSPropertyID, FillLayer& layer, CSSValue& value)
 {
-    if (value->isInitialValue()) {
-        layer->setClip(FillLayer::initialFillClip(layer->type()));
+    if (value.isInitialValue()) {
+        layer.setClip(FillLayer::initialFillClip(layer.type()));
         return;
     }
 
-    if (!is<CSSPrimitiveValue>(*value))
+    if (!is<CSSPrimitiveValue>(value))
         return;
 
-    CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
-    layer->setClip(primitiveValue);
+    layer.setClip(downcast<CSSPrimitiveValue>(value));
 }
 
-void CSSToStyleMap::mapFillComposite(CSSPropertyID, FillLayer* layer, CSSValue* value)
+void CSSToStyleMap::mapFillComposite(CSSPropertyID, FillLayer& layer, CSSValue& value)
 {
-    if (value->isInitialValue()) {
-        layer->setComposite(FillLayer::initialFillComposite(layer->type()));
+    if (value.isInitialValue()) {
+        layer.setComposite(FillLayer::initialFillComposite(layer.type()));
         return;
     }
 
-    if (!is<CSSPrimitiveValue>(*value))
+    if (!is<CSSPrimitiveValue>(value))
         return;
 
-    CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
-    layer->setComposite(primitiveValue);
+    layer.setComposite(downcast<CSSPrimitiveValue>(value));
 }
 
-void CSSToStyleMap::mapFillBlendMode(CSSPropertyID, FillLayer* layer, CSSValue* value)
+void CSSToStyleMap::mapFillBlendMode(CSSPropertyID, FillLayer& layer, CSSValue& value)
 {
-    if (value->isInitialValue()) {
-        layer->setBlendMode(FillLayer::initialFillBlendMode(layer->type()));
+    if (value.isInitialValue()) {
+        layer.setBlendMode(FillLayer::initialFillBlendMode(layer.type()));
         return;
     }
 
-    if (!is<CSSPrimitiveValue>(*value))
+    if (!is<CSSPrimitiveValue>(value))
         return;
 
-    CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
-    layer->setBlendMode(primitiveValue);
+    layer.setBlendMode(downcast<CSSPrimitiveValue>(value));
 }
 
-void CSSToStyleMap::mapFillOrigin(CSSPropertyID, FillLayer* layer, CSSValue* value)
+void CSSToStyleMap::mapFillOrigin(CSSPropertyID, FillLayer& layer, CSSValue& value)
 {
-    if (value->isInitialValue()) {
-        layer->setOrigin(FillLayer::initialFillOrigin(layer->type()));
+    if (value.isInitialValue()) {
+        layer.setOrigin(FillLayer::initialFillOrigin(layer.type()));
         return;
     }
 
-    if (!is<CSSPrimitiveValue>(*value))
+    if (!is<CSSPrimitiveValue>(value))
         return;
 
-    CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
-    layer->setOrigin(primitiveValue);
+    layer.setOrigin(downcast<CSSPrimitiveValue>(value));
 }
 
 
-void CSSToStyleMap::mapFillImage(CSSPropertyID property, FillLayer* layer, CSSValue* value)
+void CSSToStyleMap::mapFillImage(CSSPropertyID property, FillLayer& layer, CSSValue& value)
 {
-    if (value->isInitialValue()) {
-        layer->setImage(FillLayer::initialFillImage(layer->type()));
+    if (value.isInitialValue()) {
+        layer.setImage(FillLayer::initialFillImage(layer.type()));
         return;
     }
 
-    layer->setImage(styleImage(property, *value));
+    layer.setImage(styleImage(property, value));
 }
 
-void CSSToStyleMap::mapFillRepeatX(CSSPropertyID, FillLayer* layer, CSSValue* value)
+void CSSToStyleMap::mapFillRepeatX(CSSPropertyID, FillLayer& layer, CSSValue& value)
 {
-    if (value->isInitialValue()) {
-        layer->setRepeatX(FillLayer::initialFillRepeatX(layer->type()));
+    if (value.isInitialValue()) {
+        layer.setRepeatX(FillLayer::initialFillRepeatX(layer.type()));
         return;
     }
 
-    if (!is<CSSPrimitiveValue>(*value))
+    if (!is<CSSPrimitiveValue>(value))
         return;
 
-    CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
-    layer->setRepeatX(primitiveValue);
+    layer.setRepeatX(downcast<CSSPrimitiveValue>(value));
 }
 
-void CSSToStyleMap::mapFillRepeatY(CSSPropertyID, FillLayer* layer, CSSValue* value)
+void CSSToStyleMap::mapFillRepeatY(CSSPropertyID, FillLayer& layer, CSSValue& value)
 {
-    if (value->isInitialValue()) {
-        layer->setRepeatY(FillLayer::initialFillRepeatY(layer->type()));
+    if (value.isInitialValue()) {
+        layer.setRepeatY(FillLayer::initialFillRepeatY(layer.type()));
         return;
     }
 
-    if (!is<CSSPrimitiveValue>(*value))
+    if (!is<CSSPrimitiveValue>(value))
         return;
 
-    CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
-    layer->setRepeatY(primitiveValue);
+    layer.setRepeatY(downcast<CSSPrimitiveValue>(value));
 }
 
-void CSSToStyleMap::mapFillSize(CSSPropertyID, FillLayer* layer, CSSValue* value)
+void CSSToStyleMap::mapFillSize(CSSPropertyID, FillLayer& layer, CSSValue& value)
 {
-    if (!is<CSSPrimitiveValue>(*value)) {
-        layer->setSizeType(SizeNone);
+    if (!is<CSSPrimitiveValue>(value)) {
+        layer.setSizeType(SizeNone);
         return;
     }
 
-    CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
+    auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
     if (primitiveValue.getValueID() == CSSValueContain)
-        layer->setSizeType(Contain);
+        layer.setSizeType(Contain);
     else if (primitiveValue.getValueID() == CSSValueCover)
-        layer->setSizeType(Cover);
+        layer.setSizeType(Cover);
     else
-        layer->setSizeType(SizeLength);
+        layer.setSizeType(SizeLength);
 
-    LengthSize b = FillLayer::initialFillSizeLength(layer->type());
+    LengthSize b = FillLayer::initialFillSizeLength(layer.type());
 
-    if (value->isInitialValue() || primitiveValue.getValueID() == CSSValueContain || primitiveValue.getValueID() == CSSValueCover) {
-        layer->setSizeLength(b);
+    if (value.isInitialValue() || primitiveValue.getValueID() == CSSValueContain || primitiveValue.getValueID() == CSSValueCover) {
+        layer.setSizeLength(b);
         return;
     }
 
@@ -230,20 +224,20 @@ void CSSToStyleMap::mapFillSize(CSSPropertyID, FillLayer* layer, CSSValue* value
 
     b.setWidth(firstLength);
     b.setHeight(secondLength);
-    layer->setSizeLength(b);
+    layer.setSizeLength(b);
 }
 
-void CSSToStyleMap::mapFillXPosition(CSSPropertyID propertyID, FillLayer* layer, CSSValue* value)
+void CSSToStyleMap::mapFillXPosition(CSSPropertyID propertyID, FillLayer& layer, CSSValue& value)
 {
-    if (value->isInitialValue()) {
-        layer->setXPosition(FillLayer::initialFillXPosition(layer->type()));
+    if (value.isInitialValue()) {
+        layer.setXPosition(FillLayer::initialFillXPosition(layer.type()));
         return;
     }
 
-    if (!is<CSSPrimitiveValue>(*value))
+    if (!is<CSSPrimitiveValue>(value))
         return;
 
-    CSSPrimitiveValue* primitiveValue = downcast<CSSPrimitiveValue>(value);
+    auto* primitiveValue = &downcast<CSSPrimitiveValue>(value);
     Pair* pair = primitiveValue->getPairValue();
     if (pair) {
         ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionX || propertyID == CSSPropertyWebkitMaskPositionX);
@@ -260,22 +254,22 @@ void CSSToStyleMap::mapFillXPosition(CSSPropertyID propertyID, FillLayer* layer,
     else
         return;
 
-    layer->setXPosition(length);
+    layer.setXPosition(length);
     if (pair)
-        layer->setBackgroundXOrigin(*(pair->first()));
+        layer.setBackgroundXOrigin(*pair->first());
 }
 
-void CSSToStyleMap::mapFillYPosition(CSSPropertyID propertyID, FillLayer* layer, CSSValue* value)
+void CSSToStyleMap::mapFillYPosition(CSSPropertyID propertyID, FillLayer& layer, CSSValue& value)
 {
-    if (value->isInitialValue()) {
-        layer->setYPosition(FillLayer::initialFillYPosition(layer->type()));
+    if (value.isInitialValue()) {
+        layer.setYPosition(FillLayer::initialFillYPosition(layer.type()));
         return;
     }
 
-    if (!is<CSSPrimitiveValue>(*value))
+    if (!is<CSSPrimitiveValue>(value))
         return;
 
-    CSSPrimitiveValue* primitiveValue = downcast<CSSPrimitiveValue>(value);
+    auto* primitiveValue = &downcast<CSSPrimitiveValue>(value);
     Pair* pair = primitiveValue->getPairValue();
     if (pair) {
         ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionY || propertyID == CSSPropertyWebkitMaskPositionY);
@@ -292,24 +286,23 @@ void CSSToStyleMap::mapFillYPosition(CSSPropertyID propertyID, FillLayer* layer,
     else
         return;
 
-    layer->setYPosition(length);
+    layer.setYPosition(length);
     if (pair)
-        layer->setBackgroundYOrigin(*(pair->first()));
+        layer.setBackgroundYOrigin(*pair->first());
 }
 
-void CSSToStyleMap::mapFillMaskSourceType(CSSPropertyID, FillLayer* layer, CSSValue* value)
+void CSSToStyleMap::mapFillMaskSourceType(CSSPropertyID, FillLayer& layer, CSSValue& value)
 {
-    EMaskSourceType type = FillLayer::initialMaskSourceType(layer->type());
-    if (value->isInitialValue()) {
-        layer->setMaskSourceType(type);
+    EMaskSourceType type = FillLayer::initialFillMaskSourceType(layer.type());
+    if (value.isInitialValue()) {
+        layer.setMaskSourceType(type);
         return;
     }
 
-    if (!is<CSSPrimitiveValue>(*value))
+    if (!is<CSSPrimitiveValue>(value))
         return;
 
-    CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
-    switch (primitiveValue.getValueID()) {
+    switch (downcast<CSSPrimitiveValue>(value).getValueID()) {
     case CSSValueAlpha:
         type = EMaskSourceType::MaskAlpha;
         break;
@@ -322,7 +315,7 @@ void CSSToStyleMap::mapFillMaskSourceType(CSSPropertyID, FillLayer* layer, CSSVa
         ASSERT_NOT_REACHED();
     }
 
-    layer->setMaskSourceType(type);
+    layer.setMaskSourceType(type);
 }
 
 void CSSToStyleMap::mapAnimationDelay(Animation& animation, CSSValue& value)
index 80f03c5..aa1b486 100644 (file)
@@ -45,18 +45,18 @@ class CSSToStyleMap {
 public:
     CSSToStyleMap(StyleResolver*);
 
-    void mapFillAttachment(CSSPropertyID, FillLayer*, CSSValue*);
-    void mapFillClip(CSSPropertyID, FillLayer*, CSSValue*);
-    void mapFillComposite(CSSPropertyID, FillLayer*, CSSValue*);
-    void mapFillBlendMode(CSSPropertyID, FillLayer*, CSSValue*);
-    void mapFillOrigin(CSSPropertyID, FillLayer*, CSSValue*);
-    void mapFillImage(CSSPropertyID, FillLayer*, CSSValue*);
-    void mapFillRepeatX(CSSPropertyID, FillLayer*, CSSValue*);
-    void mapFillRepeatY(CSSPropertyID, FillLayer*, CSSValue*);
-    void mapFillSize(CSSPropertyID, FillLayer*, CSSValue*);
-    void mapFillXPosition(CSSPropertyID, FillLayer*, CSSValue*);
-    void mapFillYPosition(CSSPropertyID, FillLayer*, CSSValue*);
-    void mapFillMaskSourceType(CSSPropertyID, FillLayer*, CSSValue*);
+    void mapFillAttachment(CSSPropertyID, FillLayer&, CSSValue&);
+    void mapFillClip(CSSPropertyID, FillLayer&, CSSValue&);
+    void mapFillComposite(CSSPropertyID, FillLayer&, CSSValue&);
+    void mapFillBlendMode(CSSPropertyID, FillLayer&, CSSValue&);
+    void mapFillOrigin(CSSPropertyID, FillLayer&, CSSValue&);
+    void mapFillImage(CSSPropertyID, FillLayer&, CSSValue&);
+    void mapFillRepeatX(CSSPropertyID, FillLayer&, CSSValue&);
+    void mapFillRepeatY(CSSPropertyID, FillLayer&, CSSValue&);
+    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&);
diff --git a/Source/WebCore/css/DeprecatedStyleBuilder.cpp b/Source/WebCore/css/DeprecatedStyleBuilder.cpp
deleted file mode 100644 (file)
index 53ca597..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
- * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "DeprecatedStyleBuilder.h"
-
-#include "CSSImageSetValue.h"
-#include "CSSPrimitiveValue.h"
-#include "CSSPrimitiveValueMappings.h"
-#include "CSSToStyleMap.h"
-#include "CSSValueList.h"
-#include "HTMLElement.h"
-#include "RenderStyle.h"
-#include "StyleResolver.h"
-
-namespace WebCore {
-
-template <typename T>
-struct FillLayerAccessorTypes {
-    typedef T Setter;
-    typedef T Getter;
-    typedef T InitialGetter;
-};
-
-template <>
-struct FillLayerAccessorTypes<StyleImage*> {
-    typedef PassRefPtr<StyleImage> Setter;
-    typedef StyleImage* Getter;
-    typedef StyleImage* InitialGetter;
-};
-
-template<>
-struct FillLayerAccessorTypes<Length>
-{
-    typedef Length Setter;
-    typedef const Length& Getter;
-    typedef Length InitialGetter;
-};
-
-template <typename T,
-          CSSPropertyID propertyId,
-          EFillLayerType fillLayerType,
-          FillLayer* (RenderStyle::*accessLayersFunction)(),
-          const FillLayer* (RenderStyle::*layersFunction)() const,
-          bool (FillLayer::*testFunction)() const,
-          typename FillLayerAccessorTypes<T>::Getter (FillLayer::*getFunction)() const,
-          void (FillLayer::*setFunction)(typename FillLayerAccessorTypes<T>::Setter),
-          void (FillLayer::*clearFunction)(),
-          typename FillLayerAccessorTypes<T>::InitialGetter (*initialFunction)(EFillLayerType),
-          void (CSSToStyleMap::*mapFillFunction)(CSSPropertyID, FillLayer*, CSSValue*)>
-class ApplyPropertyFillLayer {
-public:
-    static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
-    {
-        // Check for no-op before copying anything.
-        if (*(styleResolver->parentStyle()->*layersFunction)() == *(styleResolver->style()->*layersFunction)())
-            return;
-
-        auto* child = (styleResolver->style()->*accessLayersFunction)();
-        FillLayer* previousChild = nullptr;
-        for (auto* parent = (styleResolver->parentStyle()->*layersFunction)(); parent && (parent->*testFunction)(); parent = parent->next()) {
-            if (!child) {
-                previousChild->setNext(std::make_unique<FillLayer>(fillLayerType));
-                child = previousChild->next();
-            }
-            (child->*setFunction)((parent->*getFunction)());
-            previousChild = child;
-            child = previousChild->next();
-        }
-        for (; child; child = child->next())
-            (child->*clearFunction)();
-    }
-
-    static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
-    {
-        // Check for (single-layer) no-op before clearing anything.
-        const FillLayer& layers = *(styleResolver->style()->*layersFunction)();
-        if (!layers.next() && (!(layers.*testFunction)() || (layers.*getFunction)() == (*initialFunction)(fillLayerType)))
-            return;
-
-        FillLayer* child = (styleResolver->style()->*accessLayersFunction)();
-        (child->*setFunction)((*initialFunction)(fillLayerType));
-        for (child = child->next(); child; child = child->next())
-            (child->*clearFunction)();
-    }
-
-    static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
-    {
-        FillLayer* child = (styleResolver->style()->*accessLayersFunction)();
-        FillLayer* previousChild = nullptr;
-        if (is<CSSValueList>(*value)
-#if ENABLE(CSS_IMAGE_SET)
-        && !is<CSSImageSetValue>(*value)
-#endif
-        ) {
-            // Walk each value and put it into a layer, creating new layers as needed.
-            CSSValueList& valueList = downcast<CSSValueList>(*value);
-            for (unsigned i = 0; i < valueList.length(); i++) {
-                if (!child) {
-                    previousChild->setNext(std::make_unique<FillLayer>(fillLayerType));
-                    child = previousChild->next();
-                }
-                (styleResolver->styleMap()->*mapFillFunction)(propertyId, child, valueList.itemWithoutBoundsCheck(i));
-                previousChild = child;
-                child = child->next();
-            }
-        } else {
-            (styleResolver->styleMap()->*mapFillFunction)(propertyId, child, value);
-            child = child->next();
-        }
-        for (; child; child = child->next())
-            (child->*clearFunction)();
-    }
-
-    static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
-};
-
-const DeprecatedStyleBuilder& DeprecatedStyleBuilder::sharedStyleBuilder()
-{
-    static NeverDestroyed<DeprecatedStyleBuilder> styleBuilderInstance;
-    return styleBuilderInstance;
-}
-
-DeprecatedStyleBuilder::DeprecatedStyleBuilder()
-{
-    for (int i = 0; i < numCSSProperties; ++i)
-        m_propertyMap[i] = PropertyHandler();
-
-    // Please keep CSS property list in alphabetical order.
-    setPropertyHandler(CSSPropertyBackgroundAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyBackgroundAttachment, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSToStyleMap::mapFillAttachment>::createHandler());
-    setPropertyHandler(CSSPropertyBackgroundBlendMode, ApplyPropertyFillLayer<BlendMode, CSSPropertyBackgroundBlendMode, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isBlendModeSet, &FillLayer::blendMode, &FillLayer::setBlendMode, &FillLayer::clearBlendMode, &FillLayer::initialFillBlendMode, &CSSToStyleMap::mapFillBlendMode>::createHandler());
-    setPropertyHandler(CSSPropertyBackgroundClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundClip, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSToStyleMap::mapFillClip>::createHandler());
-    setPropertyHandler(CSSPropertyBackgroundImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyBackgroundImage, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSToStyleMap::mapFillImage>::createHandler());
-    setPropertyHandler(CSSPropertyBackgroundOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundOrigin, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSToStyleMap::mapFillOrigin>::createHandler());
-    setPropertyHandler(CSSPropertyBackgroundPositionX, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSToStyleMap::mapFillXPosition>::createHandler());
-    setPropertyHandler(CSSPropertyBackgroundPositionY, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSToStyleMap::mapFillYPosition>::createHandler());
-    setPropertyHandler(CSSPropertyBackgroundRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSToStyleMap::mapFillRepeatX>::createHandler());
-    setPropertyHandler(CSSPropertyBackgroundRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSToStyleMap::mapFillRepeatY>::createHandler());
-    setPropertyHandler(CSSPropertyBackgroundSize, ApplyPropertyFillLayer<FillSize, CSSPropertyBackgroundSize, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSToStyleMap::mapFillSize>::createHandler());
-    setPropertyHandler(CSSPropertyWebkitBackgroundClip, CSSPropertyBackgroundClip);
-    setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());
-    setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
-    setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
-    setPropertyHandler(CSSPropertyWebkitMaskClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSToStyleMap::mapFillClip>::createHandler());
-    setPropertyHandler(CSSPropertyWebkitMaskComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());
-    setPropertyHandler(CSSPropertyWebkitMaskOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskOrigin, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSToStyleMap::mapFillOrigin>::createHandler());
-    setPropertyHandler(CSSPropertyWebkitMaskPositionX, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSToStyleMap::mapFillXPosition>::createHandler());
-    setPropertyHandler(CSSPropertyWebkitMaskPositionY, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSToStyleMap::mapFillYPosition>::createHandler());
-    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());
-}
-
-}
diff --git a/Source/WebCore/css/DeprecatedStyleBuilder.h b/Source/WebCore/css/DeprecatedStyleBuilder.h
deleted file mode 100644 (file)
index 15bf82e..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef DeprecatedStyleBuilder_h
-#define DeprecatedStyleBuilder_h
-
-#include "CSSPropertyNames.h"
-#include "StylePropertyShorthand.h"
-#include <wtf/NeverDestroyed.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-class CSSValue;
-class DeprecatedStyleBuilder;
-class StyleResolver;
-
-class PropertyHandler {
-public:
-    typedef void (*InheritFunction)(CSSPropertyID, StyleResolver*);
-    typedef void (*InitialFunction)(CSSPropertyID, StyleResolver*);
-    typedef void (*ApplyFunction)(CSSPropertyID, StyleResolver*, CSSValue*);
-    PropertyHandler() : m_inherit(0), m_initial(0), m_apply(0) { }
-    PropertyHandler(InheritFunction inherit, InitialFunction initial, ApplyFunction apply) : m_inherit(inherit), m_initial(initial), m_apply(apply) { }
-    void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver) const { ASSERT(m_inherit); (*m_inherit)(propertyID, styleResolver); }
-    void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver) const { ASSERT(m_initial); (*m_initial)(propertyID, styleResolver); }
-    void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value) const { ASSERT(m_apply); (*m_apply)(propertyID, styleResolver, value); }
-    bool isValid() const { return m_inherit && m_initial && m_apply; }
-    InheritFunction inheritFunction() const { return m_inherit; }
-    InitialFunction initialFunction() { return m_initial; }
-    ApplyFunction applyFunction() { return m_apply; }
-private:
-    InheritFunction m_inherit;
-    InitialFunction m_initial;
-    ApplyFunction m_apply;
-};
-
-class DeprecatedStyleBuilder {
-    WTF_MAKE_NONCOPYABLE(DeprecatedStyleBuilder); WTF_MAKE_FAST_ALLOCATED;
-public:
-    static const DeprecatedStyleBuilder& sharedStyleBuilder();
-
-    const PropertyHandler& propertyHandler(CSSPropertyID property) const
-    {
-        ASSERT(valid(property));
-        return m_propertyMap[index(property)];
-    }
-private:
-    DeprecatedStyleBuilder();
-    static int index(CSSPropertyID property)
-    {
-        return property - firstCSSProperty;
-    }
-
-    static bool valid(CSSPropertyID property)
-    {
-        int i = index(property);
-        return i >= 0 && i < numCSSProperties;
-    }
-
-    void setPropertyHandler(CSSPropertyID property, const PropertyHandler& handler)
-    {
-        ASSERT(valid(property));
-        ASSERT(!propertyHandler(property).isValid());
-        ASSERT_WITH_MESSAGE(!isExpandedShorthand(property), "Shorthand property id = %d shouldn't be inserted into StyleBuilder. Shorthands should be expanded at parsing time.", property);
-        m_propertyMap[index(property)] = handler;
-    }
-
-    void setPropertyHandler(CSSPropertyID newProperty, CSSPropertyID equivalentProperty)
-    {
-        ASSERT(valid(newProperty));
-        ASSERT(valid(equivalentProperty));
-        ASSERT(!propertyHandler(newProperty).isValid());
-        ASSERT_WITH_MESSAGE(!isExpandedShorthand(newProperty), "Shorthand property id = %d shouldn't be inserted into StyleBuilder. Shorthands should be expanded at parsing time.", newProperty);
-        ASSERT_WITH_MESSAGE(!isExpandedShorthand(equivalentProperty), "Shorthand property id = %d shouldn't be inserted into StyleBuilder. Shorthands should be expanded at parsing time.", equivalentProperty);
-        m_propertyMap[index(newProperty)] = m_propertyMap[index(equivalentProperty)];
-    }
-
-    PropertyHandler m_propertyMap[numCSSProperties];
-
-    friend class WTF::NeverDestroyed<DeprecatedStyleBuilder>;
-};
-
-}
-
-#endif // DeprecatedStyleBuilder_h
index 5aa01e8..bb604dc 100644 (file)
@@ -65,7 +65,6 @@
 #include "Counter.h"
 #include "CounterContent.h"
 #include "CursorList.h"
-#include "DeprecatedStyleBuilder.h"
 #include "DocumentStyleSheetCollection.h"
 #include "ElementRuleCollector.h"
 #include "FilterOperation.h"
@@ -260,7 +259,6 @@ StyleResolver::StyleResolver(Document& document, bool matchAuthorAndUserStyles)
 #if ENABLE(CSS_DEVICE_ADAPTATION)
     , m_viewportStyleResolver(ViewportStyleResolver::create(&document))
 #endif
-    , m_deprecatedStyleBuilder(DeprecatedStyleBuilder::sharedStyleBuilder())
     , m_styleMap(this)
 {
     Element* root = m_document.documentElement();
@@ -1182,7 +1180,7 @@ void StyleResolver::adjustStyleForMaskImages()
         // Try to match the new mask objects through the list from the old style.
         // This should work perfectly and optimal when the list of masks remained
         // the same and also work correctly (but slower) when they were reordered.
-        FillLayer* newMaskLayer = newStyle->accessMaskLayers();
+        FillLayer* newMaskLayer = &newStyle->ensureMaskLayers();
         int countOldStyleMaskImages = oldStyleMaskImages.size();
         while (newMaskLayer && countOldStyleMaskImages) {
             RefPtr<MaskImageOperation> newMaskImage = newMaskLayer->maskImage();
@@ -2181,19 +2179,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
     if (isInherit && !state.parentStyle()->hasExplicitlyInheritedProperties() && !CSSProperty::isInheritedProperty(id))
         state.parentStyle()->setHasExplicitlyInheritedProperties();
 
-    // Check lookup table for implementations and use when available.
-    const PropertyHandler& handler = m_deprecatedStyleBuilder.propertyHandler(id);
-    if (handler.isValid()) {
-        if (isInherit)
-            handler.applyInheritValue(id, this);
-        else if (isInitial)
-            handler.applyInitialValue(id, this);
-        else
-            handler.applyValue(id, this, value);
-        return;
-    }
-
-    // Use the new StyleBuilder.
+    // Use the StyleBuilder.
     if (StyleBuilder::applyProperty(id, *this, *value, isInitial, isInherit))
         return;
 
@@ -2814,7 +2800,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
     }
 #endif
     
-    // These properties are aliased and DeprecatedStyleBuilder already applied the property on the prefixed version.
+    // These properties are aliased and StyleBuilder already applied the property on the prefixed version.
     case CSSPropertyAnimationDelay:
     case CSSPropertyAnimationDirection:
     case CSSPropertyAnimationDuration:
@@ -2828,7 +2814,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
     case CSSPropertyTransitionProperty:
     case CSSPropertyTransitionTimingFunction:
         return;
-    // These properties are implemented in the DeprecatedStyleBuilder lookup table or in the new StyleBuilder.
+    // These properties are implemented in the StyleBuilder lookup table or in the new StyleBuilder.
     case CSSPropertyBackgroundAttachment:
     case CSSPropertyBackgroundClip:
     case CSSPropertyBackgroundColor:
@@ -3660,7 +3646,7 @@ void StyleResolver::loadPendingImages()
 
         switch (currentProperty) {
         case CSSPropertyBackgroundImage: {
-            for (FillLayer* backgroundLayer = m_state.style()->accessBackgroundLayers(); backgroundLayer; backgroundLayer = backgroundLayer->next()) {
+            for (FillLayer* backgroundLayer = &m_state.style()->ensureBackgroundLayers(); backgroundLayer; backgroundLayer = backgroundLayer->next()) {
                 auto* styleImage = backgroundLayer->image();
                 if (is<StylePendingImage>(styleImage))
                     backgroundLayer->setImage(loadPendingImage(downcast<StylePendingImage>(*styleImage)));
@@ -3720,7 +3706,7 @@ void StyleResolver::loadPendingImages()
             break;
         }
         case CSSPropertyWebkitMaskImage: {
-            for (FillLayer* maskLayer = m_state.style()->accessMaskLayers(); maskLayer; maskLayer = maskLayer->next()) {
+            for (FillLayer* maskLayer = &m_state.style()->ensureMaskLayers(); maskLayer; maskLayer = maskLayer->next()) {
                 RefPtr<MaskImageOperation> maskImage = maskLayer->maskImage();
                 auto* styleImage = maskImage.get() ? maskImage->image() : nullptr;
                 if (is<StylePendingImage>(styleImage))
index d88678e..0d6a577 100644 (file)
@@ -64,7 +64,6 @@ class CSSStyleSheet;
 class CSSValue;
 class ContainerNode;
 class Document;
-class DeprecatedStyleBuilder;
 class Element;
 class Frame;
 class FrameView;
@@ -533,14 +532,11 @@ private:
     RefPtr<ViewportStyleResolver> m_viewportStyleResolver;
 #endif
 
-    const DeprecatedStyleBuilder& m_deprecatedStyleBuilder;
-
     CSSToStyleMap m_styleMap;
     InspectorCSSOMWrappers m_inspectorCSSOMWrappers;
 
     State m_state;
 
-    friend class DeprecatedStyleBuilder;
     friend bool operator==(const MatchedProperties&, const MatchedProperties&);
     friend bool operator!=(const MatchedProperties&, const MatchedProperties&);
     friend bool operator==(const MatchRanges&, const MatchRanges&);
index cb41eb0..7411a18 100755 (executable)
@@ -47,6 +47,7 @@ my %styleBuilderOptions = (
   AutoFunctions => 1,
   Converter => 1,
   Custom => 1,
+  FillLayerProperty => 1,
   FontProperty => 1,
   Getter => 1,
   Initial => 1,
@@ -374,7 +375,7 @@ sub getVisitedLinkSetter {
   return $renderStyle . "->setVisitedLink" . getNameForMethods($name);
 }
 
-sub getAnimationClearMethod {
+sub getClearFunction {
   my $name = shift;
 
   return "clear" . getNameForMethods($name);
@@ -396,7 +397,7 @@ sub getAnimationsOrTransitionsMethod {
   die "Unrecognized animation property name.";
 }
 
-sub getAnimationTestMethod {
+sub getTestFunction {
   my $name = shift;
 
   return "is" . getNameForMethods($name) . "Set";
@@ -408,6 +409,36 @@ sub getAnimationMapfunction {
   return "mapAnimation" . getNameForMethods($name);
 }
 
+sub getLayersFunction {
+  my $name = shift;
+
+  return "backgroundLayers" if $name =~ /background-/;
+  return "maskLayers" if $name =~ /mask-/;
+  die "Unrecognized FillLayer property name.";
+}
+
+sub getLayersAccessorFunction {
+  my $name = shift;
+
+  return "ensureBackgroundLayers" if $name =~ /background-/;
+  return "ensureMaskLayers" if $name =~ /mask-/;
+  die "Unrecognized FillLayer property name.";
+}
+
+sub getFillLayerType {
+my $name = shift;
+
+  return "BackgroundFillLayer" if $name =~ /background-/;
+  return "MaskFillLayer" if $name =~ /mask-/;
+}
+
+sub getFillLayerMapfunction {
+  my $name = shift;
+
+  return "mapFill" . getNameForMethods($name);
+}
+
+
 foreach my $name (@names) {
   # Skip properties still using the legacy style builder.
   next unless exists($propertiesWithStyleBuilderOptions{$name});
@@ -428,7 +459,11 @@ foreach my $name (@names) {
     $propertiesWithStyleBuilderOptions{$name}{"Setter"} = "set" . $nameForMethods;
   }
   if (!exists($propertiesWithStyleBuilderOptions{$name}{"Initial"})) {
-    $propertiesWithStyleBuilderOptions{$name}{"Initial"} = "initial" . $nameForMethods;
+    if (exists($propertiesWithStyleBuilderOptions{$name}{"FillLayerProperty"})) {
+      $propertiesWithStyleBuilderOptions{$name}{"Initial"} = "initialFill" . $nameForMethods;
+    } else {
+      $propertiesWithStyleBuilderOptions{$name}{"Initial"} = "initial" . $nameForMethods;
+    }
   }
   if (!exists($propertiesWithStyleBuilderOptions{$name}{"Custom"})) {
     $propertiesWithStyleBuilderOptions{$name}{"Custom"} = "";
@@ -501,7 +536,7 @@ sub generateAnimationPropertyInitialValueSetter {
     $setterContent .= $indent . "list.animation(0).setAnimationMode(Animation::AnimateAll);\n";
   }
   $setterContent .= $indent . "for (size_t i = 1; i < list.size(); ++i)\n";
-  $setterContent .= $indent . "    list.animation(i)." . getAnimationClearMethod($name) . "();\n";
+  $setterContent .= $indent . "    list.animation(i)." . getClearFunction($name) . "();\n";
 
   return $setterContent;
 }
@@ -514,7 +549,7 @@ sub generateAnimationPropertyInheritValueSetter {
   $setterContent .= $indent . "AnimationList& list = styleResolver.style()->" . getEnsureAnimationsOrTransitionsMethod($name) . "();\n";
   $setterContent .= $indent . "const AnimationList* parentList = styleResolver.parentStyle()->" . getAnimationsOrTransitionsMethod($name) . "();\n";
   $setterContent .= $indent . "size_t i = 0, parentSize = parentList ? parentList->size() : 0;\n";
-  $setterContent .= $indent . "for ( ; i < parentSize && parentList->animation(i)." . getAnimationTestMethod($name) . "(); ++i) {\n";
+  $setterContent .= $indent . "for ( ; i < parentSize && parentList->animation(i)." . getTestFunction($name) . "(); ++i) {\n";
   $setterContent .= $indent . "    if (list.size() <= i)\n";
   $setterContent .= $indent . "        list.append(Animation::create());\n";
   my $getter = $propertiesWithStyleBuilderOptions{$name}{"Getter"};
@@ -525,7 +560,7 @@ sub generateAnimationPropertyInheritValueSetter {
   $setterContent .= "\n";
   $setterContent .= $indent . "/* Reset any remaining animations to not have the property set. */\n";
   $setterContent .= $indent . "for ( ; i < list.size(); ++i)\n";
-  $setterContent .= $indent . "    list.animation(i)." . getAnimationClearMethod($name) . "();\n";
+  $setterContent .= $indent . "    list.animation(i)." . getClearFunction($name) . "();\n";
 
   return $setterContent;
 }
@@ -553,12 +588,101 @@ sub generateAnimationPropertyValueSetter {
   $setterContent .= $indent . "}\n";
   $setterContent .= $indent . "for ( ; childIndex < list.size(); ++childIndex) {\n";
   $setterContent .= $indent . "    /* Reset all remaining animations to not have the property set. */\n";
-  $setterContent .= $indent . "    list.animation(childIndex)." . getAnimationClearMethod($name) . "();\n";
+  $setterContent .= $indent . "    list.animation(childIndex)." . getClearFunction($name) . "();\n";
   $setterContent .= $indent . "}\n";
 
   return $setterContent;
 }
 
+sub generateFillLayerPropertyInitialValueSetter {
+  my $name = shift;
+  my $indent = shift;
+
+  my $getter = $propertiesWithStyleBuilderOptions{$name}{"Getter"};
+  my $setter = $propertiesWithStyleBuilderOptions{$name}{"Setter"};
+  my $clearFunction = getClearFunction($name);
+  my $testFunction = getTestFunction($name);
+  my $initial = "FillLayer::" . $propertiesWithStyleBuilderOptions{$name}{"Initial"} . "(" . getFillLayerType($name) . ")";
+
+  my $setterContent = "";
+  $setterContent .= $indent . "// Check for (single-layer) no-op before clearing anything.\n";
+  $setterContent .= $indent . "const FillLayer& layers = *styleResolver.style()->" . getLayersFunction($name) . "();\n";
+  $setterContent .= $indent . "if (!layers.next() && (!layers." . $testFunction . "() || layers." . $getter . "() == $initial))\n";
+  $setterContent .= $indent . "    return;\n";
+  $setterContent .= "\n";
+  $setterContent .= $indent . "FillLayer* child = &styleResolver.style()->" . getLayersAccessorFunction($name) . "();\n";
+  $setterContent .= $indent . "child->" . $setter . "(" . $initial . ");\n";
+  $setterContent .= $indent . "for (child = child->next(); child; child = child->next())\n";
+  $setterContent .= $indent . "    child->" . $clearFunction . "();\n";
+
+  return $setterContent;
+}
+
+sub generateFillLayerPropertyInheritValueSetter {
+  my $name = shift;
+  my $indent = shift;
+
+  my $getter = $propertiesWithStyleBuilderOptions{$name}{"Getter"};
+  my $setter = $propertiesWithStyleBuilderOptions{$name}{"Setter"};
+  my $clearFunction = getClearFunction($name);
+  my $testFunction = getTestFunction($name);
+
+  my $setterContent = "";
+  $setterContent .= $indent . "// Check for no-op before copying anything.\n";
+  $setterContent .= $indent . "if (*styleResolver.parentStyle()->" . getLayersFunction($name) ."() == *styleResolver.style()->" . getLayersFunction($name) . "())\n";
+  $setterContent .= $indent . "    return;\n";
+  $setterContent .= "\n";
+  $setterContent .= $indent . "auto* child = &styleResolver.style()->" . getLayersAccessorFunction($name) . "();\n";
+  $setterContent .= $indent . "FillLayer* previousChild = nullptr;\n";
+  $setterContent .= $indent . "for (auto* parent = styleResolver.parentStyle()->" . getLayersFunction($name) . "(); parent && parent->" . $testFunction . "(); parent = parent->next()) {\n";
+  $setterContent .= $indent . "    if (!child) {\n";
+  $setterContent .= $indent . "        previousChild->setNext(std::make_unique<FillLayer>(" . getFillLayerType($name) . "));\n";
+  $setterContent .= $indent . "        child = previousChild->next();\n";
+  $setterContent .= $indent . "    }\n";
+  $setterContent .= $indent . "    child->" . $setter . "(parent->" . $getter . "());\n";
+  $setterContent .= $indent . "    previousChild = child;\n";
+  $setterContent .= $indent . "    child = previousChild->next();\n";
+  $setterContent .= $indent . "}\n";
+  $setterContent .= $indent . "for (; child; child = child->next())\n";
+  $setterContent .= $indent . "    child->" . $clearFunction . "();\n";
+
+  return $setterContent;
+}
+
+sub generateFillLayerPropertyValueSetter {
+  my $name = shift;
+  my $indent = shift;
+
+  my $CSSPropertyId = "CSSProperty" . $nameToId{$name};
+
+  my $setterContent = "";
+  $setterContent .= $indent . "FillLayer* child = &styleResolver.style()->" . getLayersAccessorFunction($name) . "();\n";
+  $setterContent .= $indent . "FillLayer* previousChild = nullptr;\n";
+  $setterContent .= $indent . "if (is<CSSValueList>(value)\n";
+  $setterContent .= "#if ENABLE(CSS_IMAGE_SET)\n";
+  $setterContent .= $indent . "&& !is<CSSImageSetValue>(value)\n";
+  $setterContent .= "#endif\n";
+  $setterContent .= $indent . ") {\n";
+  $setterContent .= $indent . "    // Walk each value and put it into a layer, creating new layers as needed.\n";
+  $setterContent .= $indent . "    for (auto& item : downcast<CSSValueList>(value)) {\n";
+  $setterContent .= $indent . "        if (!child) {\n";
+  $setterContent .= $indent . "            previousChild->setNext(std::make_unique<FillLayer>(" . getFillLayerType($name) . "));\n";
+  $setterContent .= $indent . "            child = previousChild->next();\n";
+  $setterContent .= $indent . "        }\n";
+  $setterContent .= $indent . "        styleResolver.styleMap()->" . getFillLayerMapfunction($name) . "(" . $CSSPropertyId . ", *child, item);\n";
+  $setterContent .= $indent . "        previousChild = child;\n";
+  $setterContent .= $indent . "        child = child->next();\n";
+  $setterContent .= $indent . "    }\n";
+  $setterContent .= $indent . "} else {\n";
+  $setterContent .= $indent . "    styleResolver.styleMap()->" . getFillLayerMapfunction($name) . "(" . $CSSPropertyId . ", *child, value);\n";
+  $setterContent .= $indent . "    child = child->next();\n";
+  $setterContent .= $indent . "}\n";
+  $setterContent .= $indent . "for (; child; child = child->next())\n";
+  $setterContent .= $indent . "    child->" . getClearFunction($name) . "();\n";
+
+  return $setterContent;
+}
+
 sub generateInitialValueSetter {
   my $name = shift;
   my $indent = shift;
@@ -580,6 +704,8 @@ sub generateInitialValueSetter {
     $setterContent .= $indent . "    FontDescription fontDescription = styleResolver.fontDescription();\n";
     $setterContent .= $indent . "    fontDescription." . $setter . "(FontDescription::" . $initial . "());\n";
     $setterContent .= $indent . "    styleResolver.setFontDescription(fontDescription);\n";
+  } elsif (exists $propertiesWithStyleBuilderOptions{$name}{"FillLayerProperty"}) {
+    $setterContent .= generateFillLayerPropertyInitialValueSetter($name, $indent . "    ");
   } else {
     my $setValue = $style . "->" . $setter;
     $setterContent .= $indent . "    " . $setValue . "(RenderStyle::" . $initial . "());\n";
@@ -622,6 +748,9 @@ sub generateInheritValueSetter {
     $setterContent .= $indent . "    fontDescription." . $setter . "(styleResolver.parentFontDescription()." . $getter . "());\n";
     $setterContent .= $indent . "    styleResolver.setFontDescription(fontDescription);\n";
     $didCallSetValue = 1;
+  } elsif (exists $propertiesWithStyleBuilderOptions{$name}{"FillLayerProperty"}) {
+    $setterContent .= generateFillLayerPropertyInheritValueSetter($name, $indent . "    ");
+    $didCallSetValue = 1;
   }
   if (!$didCallSetValue) {
     my $inheritedValue = $parentStyle . "->" .  $getter . "()";
@@ -671,6 +800,9 @@ sub generateValueSetter {
     $setterContent .= $indent . "    fontDescription." . $setter . "(" . $convertedValue . ");\n";
     $setterContent .= $indent . "    styleResolver.setFontDescription(fontDescription);\n";
     $didCallSetValue = 1;
+  } elsif (exists $propertiesWithStyleBuilderOptions{$name}{"FillLayerProperty"}) {
+    $setterContent .= generateFillLayerPropertyValueSetter($name, $indent . "    ");
+    $didCallSetValue = 1;
   }
   if (!$didCallSetValue) {
     my $setValue = $style . "->" . $setter;
index 354354f..1d16e86 100644 (file)
@@ -920,7 +920,7 @@ public:
 class FillLayersPropertyWrapper : public AnimationPropertyWrapperBase {
 public:
     typedef const FillLayer* (RenderStyle::*LayersGetter)() const;
-    typedef FillLayer* (RenderStyle::*LayersAccessor)();
+    typedef FillLayer& (RenderStyle::*LayersAccessor)();
 
     FillLayersPropertyWrapper(CSSPropertyID prop, LayersGetter getter, LayersAccessor accessor)
         : AnimationPropertyWrapperBase(prop)
@@ -969,7 +969,7 @@ public:
     {
         const FillLayer* aLayer = (a->*m_layersGetter)();
         const FillLayer* bLayer = (b->*m_layersGetter)();
-        FillLayer* dstLayer = (dst->*m_layersAccessor)();
+        FillLayer* dstLayer = &(dst->*m_layersAccessor)();
 
         while (aLayer && bLayer && dstLayer) {
             m_fillLayerPropertyWrapper->blend(anim, dstLayer, aLayer, bLayer, progress);
@@ -1188,7 +1188,7 @@ CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap()
 
         new PropertyWrapperVisitedAffectedColor(CSSPropertyBackgroundColor, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::visitedLinkBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor),
 
-        new FillLayersPropertyWrapper(CSSPropertyBackgroundImage, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers),
+        new FillLayersPropertyWrapper(CSSPropertyBackgroundImage, &RenderStyle::backgroundLayers, &RenderStyle::ensureBackgroundLayers),
         new StyleImagePropertyWrapper(CSSPropertyListStyleImage, &RenderStyle::listStyleImage, &RenderStyle::setListStyleImage),
         new MaskImagePropertyWrapper(),
 
@@ -1200,14 +1200,14 @@ CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap()
         new StyleImagePropertyWrapper(CSSPropertyWebkitMaskBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImageSource),
         new PropertyWrapper<const NinePieceImage&>(CSSPropertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImage),
 
-        new FillLayersPropertyWrapper(CSSPropertyBackgroundPositionX, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers),
-        new FillLayersPropertyWrapper(CSSPropertyBackgroundPositionY, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers),
-        new FillLayersPropertyWrapper(CSSPropertyBackgroundSize, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers),
-        new FillLayersPropertyWrapper(CSSPropertyWebkitBackgroundSize, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers),
+        new FillLayersPropertyWrapper(CSSPropertyBackgroundPositionX, &RenderStyle::backgroundLayers, &RenderStyle::ensureBackgroundLayers),
+        new FillLayersPropertyWrapper(CSSPropertyBackgroundPositionY, &RenderStyle::backgroundLayers, &RenderStyle::ensureBackgroundLayers),
+        new FillLayersPropertyWrapper(CSSPropertyBackgroundSize, &RenderStyle::backgroundLayers, &RenderStyle::ensureBackgroundLayers),
+        new FillLayersPropertyWrapper(CSSPropertyWebkitBackgroundSize, &RenderStyle::backgroundLayers, &RenderStyle::ensureBackgroundLayers),
 
-        new FillLayersPropertyWrapper(CSSPropertyWebkitMaskPositionX, &RenderStyle::maskLayers, &RenderStyle::accessMaskLayers),
-        new FillLayersPropertyWrapper(CSSPropertyWebkitMaskPositionY, &RenderStyle::maskLayers, &RenderStyle::accessMaskLayers),
-        new FillLayersPropertyWrapper(CSSPropertyWebkitMaskSize, &RenderStyle::maskLayers, &RenderStyle::accessMaskLayers),
+        new FillLayersPropertyWrapper(CSSPropertyWebkitMaskPositionX, &RenderStyle::maskLayers, &RenderStyle::ensureMaskLayers),
+        new FillLayersPropertyWrapper(CSSPropertyWebkitMaskPositionY, &RenderStyle::maskLayers, &RenderStyle::ensureMaskLayers),
+        new FillLayersPropertyWrapper(CSSPropertyWebkitMaskSize, &RenderStyle::maskLayers, &RenderStyle::ensureMaskLayers),
 
         new PropertyWrapper<float>(CSSPropertyFontSize,
             // Must pass a specified size to setFontSize if Text Autosizing is enabled, but a computed size
index 555e028..fc11593 100644 (file)
@@ -54,7 +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_maskSourceType(FillLayer::initialFillMaskSourceType(type))
     , m_imageSet(false)
     , m_attachmentSet(false)
     , m_clipSet(false)
index a6385a2..2f840f0 100644 (file)
@@ -172,7 +172,7 @@ public:
     static Length initialFillXPosition(EFillLayerType) { return Length(0.0f, Percent); }
     static Length initialFillYPosition(EFillLayerType) { return Length(0.0f, Percent); }
     static StyleImage* initialFillImage(EFillLayerType) { return 0; }
-    static EMaskSourceType initialMaskSourceType(EFillLayerType) { return MaskAlpha; }
+    static EMaskSourceType initialFillMaskSourceType(EFillLayerType) { return MaskAlpha; }
 
 private:
     friend class RenderStyle;
index 08da271..522e06a 100644 (file)
@@ -123,7 +123,6 @@ typedef Vector<RefPtr<RenderStyle>, 4> PseudoStyleCache;
 class RenderStyle: public RefCounted<RenderStyle> {
     friend class CSSPropertyAnimationWrapperMap; // Used by CSS animations. We can't allow them to animate based off visited colors.
     friend class ApplyStyleCommand; // Editing has to only reveal unvisited info.
-    friend class DeprecatedStyleBuilder; // Sets members directly.
     friend class EditingStyle; // Editing has to only reveal unvisited info.
     friend class ComputedStyleExtractor; // Ignores visited styles, so needs to be able to see unvisited info.
     friend class PropertyWrapperMaybeInvalidColor; // Used by CSS animations. We can't allow them to animate based off visited colors.
@@ -797,7 +796,7 @@ public:
     const Length& backgroundYPosition() const { return m_background->background().yPosition(); }
     EFillSizeType backgroundSizeType() const { return m_background->background().sizeType(); }
     const LengthSize& backgroundSizeLength() const { return m_background->background().sizeLength(); }
-    FillLayer* accessBackgroundLayers() { return &(m_background.access()->m_background); }
+    FillLayer& ensureBackgroundLayers() { return m_background.access()->m_background; }
     const FillLayer* backgroundLayers() const { return &(m_background->background()); }
 
     EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatX()); }
@@ -809,7 +808,7 @@ public:
     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); }
+    FillLayer& ensureMaskLayers() { 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(); }
@@ -1364,8 +1363,8 @@ public:
     void adjustBackgroundLayers()
     {
         if (backgroundLayers()->next()) {
-            accessBackgroundLayers()->cullEmptyLayers();
-            accessBackgroundLayers()->fillUnsetProperties();
+            ensureBackgroundLayers().cullEmptyLayers();
+            ensureBackgroundLayers().fillUnsetProperties();
         }
     }
 
@@ -1375,8 +1374,8 @@ public:
     void adjustMaskLayers()
     {
         if (maskLayers()->next()) {
-            accessMaskLayers()->cullEmptyLayers();
-            accessMaskLayers()->fillUnsetProperties();
+            ensureMaskLayers().cullEmptyLayers();
+            ensureMaskLayers().fillUnsetProperties();
         }
     }