Eliminate CSSElementStyleDeclaration subclasses
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Jan 2012 16:49:10 +0000 (16:49 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Jan 2012 16:49:10 +0000 (16:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=76827

Reviewed by Andreas Kling.

CSSInlineStyleDeclaration and FontFaceStyleDeclaration serve no real purpose.

* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSElementStyleDeclaration.cpp:
(WebCore::CSSElementStyleDeclaration::createForSVGFontFaceElement):
(WebCore::CSSElementStyleDeclaration::styleSheet):
* css/CSSElementStyleDeclaration.h:
(WebCore::CSSElementStyleDeclaration::createInline):
(WebCore::toCSSElementStyleDeclaration):
* css/CSSInlineStyleDeclaration.h: Removed.
* css/CSSMutableStyleDeclaration.cpp:
* dom/StyledElement.cpp:
(WebCore::StyledElement::createInlineStyleDecl):
(WebCore::StyledElement::ensureInlineStyleDecl):
(WebCore::StyledElement::copyNonAttributeProperties):
* dom/StyledElement.h:
(WebCore::StyledElement::inlineStyleDecl):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
(WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
* editing/DeleteButtonController.cpp:
(WebCore::DeleteButtonController::createDeletionUI):
* html/ValidationMessage.cpp:
(WebCore::adjustBubblePosition):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::setPosition):
(WebCore::MediaControlPanelElement::resetPosition):
(WebCore::MediaControlPanelElement::makeOpaque):
(WebCore::MediaControlPanelElement::makeTransparent):
* html/shadow/SliderThumbElement.cpp:
(WebCore::TrackLimiterElement::create):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::SVGFontFaceElement):

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

18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSElementStyleDeclaration.cpp
Source/WebCore/css/CSSElementStyleDeclaration.h
Source/WebCore/css/CSSInlineStyleDeclaration.h [deleted file]
Source/WebCore/css/CSSMutableStyleDeclaration.cpp
Source/WebCore/dom/StyledElement.cpp
Source/WebCore/dom/StyledElement.h
Source/WebCore/editing/ApplyStyleCommand.cpp
Source/WebCore/editing/DeleteButtonController.cpp
Source/WebCore/html/ValidationMessage.cpp
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/svg/SVGFontFaceElement.cpp

index 8281520..0ee7369 100644 (file)
@@ -1,3 +1,48 @@
+2012-01-23  Antti Koivisto  <antti@apple.com>
+
+        Eliminate CSSElementStyleDeclaration subclasses
+        https://bugs.webkit.org/show_bug.cgi?id=76827
+
+        Reviewed by Andreas Kling.
+
+        CSSInlineStyleDeclaration and FontFaceStyleDeclaration serve no real purpose.
+
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSElementStyleDeclaration.cpp:
+        (WebCore::CSSElementStyleDeclaration::createForSVGFontFaceElement):
+        (WebCore::CSSElementStyleDeclaration::styleSheet):
+        * css/CSSElementStyleDeclaration.h:
+        (WebCore::CSSElementStyleDeclaration::createInline):
+        (WebCore::toCSSElementStyleDeclaration):
+        * css/CSSInlineStyleDeclaration.h: Removed.
+        * css/CSSMutableStyleDeclaration.cpp:
+        * dom/StyledElement.cpp:
+        (WebCore::StyledElement::createInlineStyleDecl):
+        (WebCore::StyledElement::ensureInlineStyleDecl):
+        (WebCore::StyledElement::copyNonAttributeProperties):
+        * dom/StyledElement.h:
+        (WebCore::StyledElement::inlineStyleDecl):
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
+        (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
+        * editing/DeleteButtonController.cpp:
+        (WebCore::DeleteButtonController::createDeletionUI):
+        * html/ValidationMessage.cpp:
+        (WebCore::adjustBubblePosition):
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlPanelElement::setPosition):
+        (WebCore::MediaControlPanelElement::resetPosition):
+        (WebCore::MediaControlPanelElement::makeOpaque):
+        (WebCore::MediaControlPanelElement::makeTransparent):
+        * html/shadow/SliderThumbElement.cpp:
+        (WebCore::TrackLimiterElement::create):
+        * svg/SVGFontFaceElement.cpp:
+        (WebCore::SVGFontFaceElement::SVGFontFaceElement):
+
 2012-01-23  Pavel Feldman  <pfeldman@google.com>
 
         Not reviewed: annotate inspector's js so that it compiled.
index 01f3a81..7152078 100644 (file)
@@ -1317,7 +1317,6 @@ webcore_sources += \
        Source/WebCore/css/CSSInheritedValue.h \
        Source/WebCore/css/CSSInitialValue.cpp \
        Source/WebCore/css/CSSInitialValue.h \
-       Source/WebCore/css/CSSInlineStyleDeclaration.h \
        Source/WebCore/css/CSSLineBoxContainValue.cpp \
        Source/WebCore/css/CSSLineBoxContainValue.h \
        Source/WebCore/css/CSSMediaRule.cpp \
index 1ca09e6..a0e3e62 100644 (file)
@@ -1527,7 +1527,6 @@ HEADERS += \
     css/CSSImportRule.h \
     css/CSSInheritedValue.h \
     css/CSSInitialValue.h \
-    css/CSSInlineStyleDeclaration.h \
     css/CSSMediaRule.h \
     css/CSSMutableStyleDeclaration.h \
     css/CSSOMUtils.h \
index e21fbb4..029e45d 100644 (file)
             'css/CSSHelper.h',
             'css/CSSImageGeneratorValue.h',
             'css/CSSImageValue.h',
-            'css/CSSInlineStyleDeclaration.h',
             'css/CSSLineBoxContainValue.h',
             'css/CSSMutableStyleDeclaration.h',
             'css/CSSParserValues.h',
index 1ba6ab1..30803f7 100755 (executable)
                                >
                        </File>
                        <File
-                               RelativePath="..\css\CSSInlineStyleDeclaration.h"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\css\CSSLineBoxContainValue.cpp"
                                >
                                <FileConfiguration
index 41fc02c..51f1987 100644 (file)
                8CADF2AB135C7B36009EF43F /* LevelDBDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CADF2A5135C7B36009EF43F /* LevelDBDatabase.h */; };
                8CADF2AD135C7B36009EF43F /* LevelDBIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CADF2A7135C7B36009EF43F /* LevelDBIterator.h */; };
                8CADF2AE135C7B36009EF43F /* LevelDBSlice.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CADF2A8135C7B36009EF43F /* LevelDBSlice.h */; };
-               8CF7DDE4147ECF940041A6F2 /* CSSInlineStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CF7DDE1147E432D0041A6F2 /* CSSInlineStyleDeclaration.h */; settings = {ATTRIBUTES = (Private, ); }; };
                8F67561B1288B17B0047ACA3 /* EventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 8F6756191288B17B0047ACA3 /* EventQueue.h */; settings = {ATTRIBUTES = (Private, ); }; };
                8FAC774D119872CB0015AE94 /* JSMainThreadExecState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */; };
                9001774012E0347800648462 /* OESStandardDerivatives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9001773D12E0347800648462 /* OESStandardDerivatives.cpp */; };
                8CADF2A5135C7B36009EF43F /* LevelDBDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LevelDBDatabase.h; sourceTree = "<group>"; };
                8CADF2A7135C7B36009EF43F /* LevelDBIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LevelDBIterator.h; sourceTree = "<group>"; };
                8CADF2A8135C7B36009EF43F /* LevelDBSlice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LevelDBSlice.h; sourceTree = "<group>"; };
-               8CF7DDE1147E432D0041A6F2 /* CSSInlineStyleDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSInlineStyleDeclaration.h; sourceTree = "<group>"; };
                8F6756191288B17B0047ACA3 /* EventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventQueue.h; sourceTree = "<group>"; };
                8F934D831189F1EE00508D5D /* JSMainThreadExecState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMainThreadExecState.h; sourceTree = "<group>"; };
                8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMainThreadExecState.cpp; sourceTree = "<group>"; };
                                A80E6CD70A1989CA007FB8C5 /* CSSInheritedValue.h */,
                                A80E6CD80A1989CA007FB8C5 /* CSSInitialValue.cpp */,
                                A80E6CDE0A1989CA007FB8C5 /* CSSInitialValue.h */,
-                               8CF7DDE1147E432D0041A6F2 /* CSSInlineStyleDeclaration.h */,
                                BC772E15133162C2001EC9CE /* CSSLineBoxContainValue.cpp */,
                                BC772E121331620C001EC9CE /* CSSLineBoxContainValue.h */,
                                A80E6CD20A1989CA007FB8C5 /* CSSMediaRule.cpp */,
                                A80E6CF60A1989CA007FB8C5 /* CSSImportRule.h in Headers */,
                                A80E6D010A1989CA007FB8C5 /* CSSInheritedValue.h in Headers */,
                                A80E6D080A1989CA007FB8C5 /* CSSInitialValue.h in Headers */,
-                               8CF7DDE4147ECF940041A6F2 /* CSSInlineStyleDeclaration.h in Headers */,
                                BC772E131331620C001EC9CE /* CSSLineBoxContainValue.h in Headers */,
                                A8C4A80909D563270003AC8D /* CSSMappedAttributeDeclaration.h in Headers */,
                                A80E6D030A1989CA007FB8C5 /* CSSMediaRule.h in Headers */,
index 8178261..f0c85ef 100644 (file)
 #include "config.h"
 #include "CSSElementStyleDeclaration.h"
 
+#include "SVGFontFaceElement.h"
 #include "StyledElement.h"
 
 namespace WebCore {
 
+PassRefPtr<CSSElementStyleDeclaration> CSSElementStyleDeclaration::createForSVGFontFaceElement(SVGFontFaceElement* element) 
+{ 
+    return adoptRef(new CSSElementStyleDeclaration(element, false)); 
+}
+
 CSSStyleSheet* CSSElementStyleDeclaration::styleSheet() const
 {
-    if (m_element && m_element->document())
-        return m_element->document()->elementSheet();
-    return 0;
+    if (!m_element)
+        return 0;
+    Document* document = m_element->document();
+    if (!document)
+        return 0;
+    // If this is not an inline declaration then it is an SVG font face declaration.
+    return m_isInlineStyleDeclaration ? document->elementSheet() : document->mappedElementSheet();
 }
 
 } // namespace WebCore
index 71ca518..b39c7b7 100644 (file)
 #define CSSElementStyleDeclaration_h
 
 #include "CSSMutableStyleDeclaration.h"
+#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
+class SVGFontFaceElement;
 class StyledElement;
 
-// Base class for CSSInlineStyleDeclaration and FontFaceStyleDeclaration (SVG).
-
 class CSSElementStyleDeclaration : public CSSMutableStyleDeclaration {
 public:
+    static PassRefPtr<CSSElementStyleDeclaration> createInline(StyledElement* element) { return adoptRef(new CSSElementStyleDeclaration(element, true)); }
+    static PassRefPtr<CSSElementStyleDeclaration> createForSVGFontFaceElement(SVGFontFaceElement*);
+
     StyledElement* element() const { return m_element; }
     void clearElement() { m_element = 0; }
 
     virtual CSSStyleSheet* styleSheet() const;
 
-protected:
+private:
     CSSElementStyleDeclaration(StyledElement* element, bool isInline)
         : CSSMutableStyleDeclaration()
         , m_element(element)
@@ -56,6 +59,12 @@ private:
     StyledElement* m_element;
 };
 
+inline CSSElementStyleDeclaration* toCSSElementStyleDeclaration(CSSMutableStyleDeclaration* decl)
+{
+    ASSERT(!decl || decl->isElementStyleDeclaration());
+    return static_cast<CSSElementStyleDeclaration*>(decl);
+}
+
 } // namespace WebCore
 
 #endif // CSSElementStyleDeclaration_h
diff --git a/Source/WebCore/css/CSSInlineStyleDeclaration.h b/Source/WebCore/css/CSSInlineStyleDeclaration.h
deleted file mode 100644 (file)
index 718e409..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2008, 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2011 Andreas Kling (kling@webkit.org)
- *
- * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR
- * 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 CSSInlineStyleDeclaration_h
-#define CSSInlineStyleDeclaration_h
-
-#include "CSSElementStyleDeclaration.h"
-
-namespace WebCore {
-
-class CSSInlineStyleDeclaration : public CSSElementStyleDeclaration {
-public:
-    virtual ~CSSInlineStyleDeclaration() { }
-
-    static PassRefPtr<CSSInlineStyleDeclaration> create(StyledElement* element)
-    {
-        return adoptRef(new CSSInlineStyleDeclaration(element));
-    }
-
-private:
-    CSSInlineStyleDeclaration(StyledElement* element)
-        : CSSElementStyleDeclaration(element, /* isInline */ true)
-    {
-    }
-};
-
-inline CSSInlineStyleDeclaration* toCSSInlineStyleDeclaration(CSSMutableStyleDeclaration* decl)
-{
-    ASSERT(!decl || decl->isInlineStyleDeclaration());
-    return static_cast<CSSInlineStyleDeclaration*>(decl);
-}
-
-} // namespace WebCore
-
-#endif // CSSInlineStyleDeclaration_h
index c831b07..6ac3f47 100644 (file)
@@ -22,8 +22,8 @@
 #include "config.h"
 #include "CSSMutableStyleDeclaration.h"
 
+#include "CSSElementStyleDeclaration.h"
 #include "CSSImageValue.h"
-#include "CSSInlineStyleDeclaration.h"
 #include "CSSParser.h"
 #include "CSSPropertyLonghand.h"
 #include "CSSPropertyNames.h"
@@ -67,7 +67,7 @@ public:
         if (!s_currentDecl->isInlineStyleDeclaration())
             return;
 
-        CSSInlineStyleDeclaration* inlineDecl = toCSSInlineStyleDeclaration(s_currentDecl);
+        CSSElementStyleDeclaration* inlineDecl = toCSSElementStyleDeclaration(s_currentDecl);
         if (!inlineDecl->element())
             return;
 
@@ -97,7 +97,7 @@ public:
             return;
         }
 
-        CSSInlineStyleDeclaration* inlineDecl = toCSSInlineStyleDeclaration(s_currentDecl);
+        CSSElementStyleDeclaration* inlineDecl = toCSSElementStyleDeclaration(s_currentDecl);
         s_currentDecl = 0;
         s_shouldNotifyInspector = false;
         if (inlineDecl->element() && inlineDecl->element()->document())
index 1e51313..6507538 100644 (file)
@@ -25,7 +25,7 @@
 #include "StyledElement.h"
 
 #include "Attribute.h"
-#include "CSSInlineStyleDeclaration.h"
+#include "CSSElementStyleDeclaration.h"
 #include "CSSStyleSelector.h"
 #include "CSSStyleSheet.h"
 #include "CSSValueKeywords.h"
@@ -130,7 +130,7 @@ PassRefPtr<Attribute> StyledElement::createAttribute(const QualifiedName& name,
 void StyledElement::createInlineStyleDecl()
 {
     ASSERT(!m_inlineStyleDecl);
-    m_inlineStyleDecl = CSSInlineStyleDeclaration::create(this);
+    m_inlineStyleDecl = CSSElementStyleDeclaration::createInline(this);
     m_inlineStyleDecl->setStrictParsing(isHTMLElement() && !document()->inQuirksMode());
 }
 
@@ -240,7 +240,7 @@ void StyledElement::parseMappedAttribute(Attribute* attr)
     }
 }
 
-CSSInlineStyleDeclaration* StyledElement::ensureInlineStyleDecl()
+CSSElementStyleDeclaration* StyledElement::ensureInlineStyleDecl()
 {
     if (!m_inlineStyleDecl)
         createInlineStyleDecl();
@@ -431,7 +431,7 @@ void StyledElement::copyNonAttributeProperties(const Element* sourceElement)
     if (!source->inlineStyleDecl())
         return;
 
-    CSSInlineStyleDeclaration* inlineStyle = ensureInlineStyleDecl();
+    CSSElementStyleDeclaration* inlineStyle = ensureInlineStyleDecl();
     inlineStyle->copyPropertiesFrom(*source->inlineStyleDecl());
     inlineStyle->setStrictParsing(source->inlineStyleDecl()->useStrictParsing());
 
index ce695ff..65f570e 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef StyledElement_h
 #define StyledElement_h
 
-#include "CSSInlineStyleDeclaration.h"
+#include "CSSElementStyleDeclaration.h"
 #include "Element.h"
 #include "MappedAttributeEntry.h"
 
@@ -59,8 +59,8 @@ public:
     virtual void additionalAttributeStyleDecls(Vector<CSSMutableStyleDeclaration*>&) { }
     void invalidateStyleAttribute();
 
-    CSSInlineStyleDeclaration* inlineStyleDecl() const { return m_inlineStyleDecl.get(); }
-    CSSInlineStyleDeclaration* ensureInlineStyleDecl();
+    CSSElementStyleDeclaration* inlineStyleDecl() const { return m_inlineStyleDecl.get(); }
+    CSSElementStyleDeclaration* ensureInlineStyleDecl();
     virtual CSSStyleDeclaration* style() OVERRIDE;
 
     const SpaceSplitString& classNames() const;
@@ -93,7 +93,7 @@ private:
     void destroyInlineStyleDecl();
     virtual void updateStyleAttribute() const;
 
-    RefPtr<CSSInlineStyleDeclaration> m_inlineStyleDecl;
+    RefPtr<CSSElementStyleDeclaration> m_inlineStyleDecl;
 };
 
 inline const SpaceSplitString& StyledElement::classNames() const
index 54d2163..b0aa698 100644 (file)
@@ -385,7 +385,7 @@ void ApplyStyleCommand::applyRelativeFontStyleChange(EditingStyle* style)
         }
         lastStyledNode = node;
 
-        CSSInlineStyleDeclaration* inlineStyleDecl = element->ensureInlineStyleDecl();
+        CSSElementStyleDeclaration* inlineStyleDecl = element->ensureInlineStyleDecl();
         float currentFontSize = computedFontSize(node);
         float desiredFontSize = max(MinimumFontSize, startingFontSizes.get(node) + style->fontSizeDelta());
         RefPtr<CSSValue> value = inlineStyleDecl->getPropertyCSSValue(CSSPropertyFontSize);
@@ -1376,7 +1376,7 @@ void ApplyStyleCommand::addInlineStyleIfNeeded(EditingStyle* style, PassRefPtr<N
 
     if (styleChange.cssStyle().length()) {
         if (styleContainer) {
-            if (CSSInlineStyleDeclaration* existingStyle = styleContainer->inlineStyleDecl())
+            if (CSSElementStyleDeclaration* existingStyle = styleContainer->inlineStyleDecl())
                 setNodeAttribute(styleContainer, styleAttr, existingStyle->cssText() + styleChange.cssStyle());
             else
                 setNodeAttribute(styleContainer, styleAttr, styleChange.cssStyle());
index ed34fe8..6c77e19 100644 (file)
@@ -205,7 +205,7 @@ void DeleteButtonController::createDeletionUI()
     RefPtr<HTMLDivElement> container = HTMLDivElement::create(m_target->document());
     container->setIdAttribute(containerElementIdentifier);
 
-    CSSInlineStyleDeclaration* style = container->ensureInlineStyleDecl();
+    CSSElementStyleDeclaration* style = container->ensureInlineStyleDecl();
     style->setProperty(CSSPropertyWebkitUserDrag, CSSValueNone);
     style->setProperty(CSSPropertyWebkitUserSelect, CSSValueNone);
     style->setProperty(CSSPropertyWebkitUserModify, CSSValueReadOnly);
index b69b2b4..479e8dc 100644 (file)
@@ -119,7 +119,7 @@ static void adjustBubblePosition(const LayoutRect& hostRect, HTMLElement* bubble
         hostY -= containerLocation.y() + container->borderTop();
     }
 
-    CSSInlineStyleDeclaration* style = bubble->ensureInlineStyleDecl();
+    CSSElementStyleDeclaration* style = bubble->ensureInlineStyleDecl();
     style->setProperty(CSSPropertyTop, hostY + hostRect.height(), CSSPrimitiveValue::CSS_PX);
     // The 'left' value of ::-webkit-validation-bubble-arrow.
     const int bubbleArrowTopOffset = 32;
index 45b9631..f40988a 100644 (file)
@@ -175,7 +175,7 @@ void MediaControlPanelElement::endDrag()
 
 void MediaControlPanelElement::setPosition(const LayoutPoint& position)
 {
-    CSSInlineStyleDeclaration* style = ensureInlineStyleDecl();
+    CSSElementStyleDeclaration* style = ensureInlineStyleDecl();
 
     double left = position.x();
     double top = position.y();
@@ -193,7 +193,7 @@ void MediaControlPanelElement::setPosition(const LayoutPoint& position)
 
 void MediaControlPanelElement::resetPosition()
 {
-    CSSInlineStyleDeclaration* style = ensureInlineStyleDecl();
+    CSSElementStyleDeclaration* style = ensureInlineStyleDecl();
 
     style->removeProperty(CSSPropertyLeft);
     style->removeProperty(CSSPropertyTop);
@@ -211,7 +211,7 @@ void MediaControlPanelElement::makeOpaque()
 
     double duration = document()->page() ? document()->page()->theme()->mediaControlsFadeInDuration() : 0;
 
-    CSSInlineStyleDeclaration* style = ensureInlineStyleDecl();
+    CSSElementStyleDeclaration* style = ensureInlineStyleDecl();
     style->setProperty(CSSPropertyWebkitTransitionProperty, CSSPropertyOpacity);
     style->setProperty(CSSPropertyWebkitTransitionDuration, duration, CSSPrimitiveValue::CSS_S);
     style->setProperty(CSSPropertyOpacity, 1.0, CSSPrimitiveValue::CSS_NUMBER);
@@ -224,7 +224,7 @@ void MediaControlPanelElement::makeTransparent()
     if (!m_opaque)
         return;
 
-    CSSInlineStyleDeclaration* style = ensureInlineStyleDecl();
+    CSSElementStyleDeclaration* style = ensureInlineStyleDecl();
     style->setProperty(CSSPropertyWebkitTransitionProperty, CSSPropertyOpacity);
     style->setProperty(CSSPropertyWebkitTransitionDuration, document()->page()->theme()->mediaControlsFadeOutDuration(), CSSPrimitiveValue::CSS_S);
     style->setProperty(CSSPropertyOpacity, 0.0, CSSPrimitiveValue::CSS_NUMBER);
index 1cf4de7..ef58de4 100644 (file)
@@ -334,7 +334,7 @@ PassRefPtr<TrackLimiterElement> TrackLimiterElement::create(Document* document)
 {
     RefPtr<TrackLimiterElement> element = adoptRef(new TrackLimiterElement(document));
 
-    CSSInlineStyleDeclaration* style = element->ensureInlineStyleDecl();
+    CSSElementStyleDeclaration* style = element->ensureInlineStyleDecl();
     style->setProperty(CSSPropertyVisibility, CSSValueHidden);
     style->setProperty(CSSPropertyPosition, CSSValueStatic);
 
index aea9b07..8856e62 100644 (file)
@@ -46,37 +46,10 @@ namespace WebCore {
 
 using namespace SVGNames;
 
-// FIXME: This class is needed because CSSElementStyleDeclaration normally resolves
-//        the parentStyleSheet() to its document's elementSheet(). For SVG font-face
-//        elements however, we want the mappedElementSheet().
-//        With the planned refactoring to decouple WebKit's internal CSS structures
-//        from the CSSOM, the need for parent style sheet pointers, and thus also this
-//        class, goes away.
-class FontFaceStyleDeclaration : public CSSElementStyleDeclaration {
-public:
-    static PassRefPtr<FontFaceStyleDeclaration> create(SVGFontFaceElement* element)
-    {
-        return adoptRef(new FontFaceStyleDeclaration(element));
-    }
-
-    virtual ~FontFaceStyleDeclaration() { }
-
-    virtual CSSStyleSheet* styleSheet() const
-    {
-        return element()->document() ? element()->document()->mappedElementSheet() : 0;
-    }
-
-private:
-    FontFaceStyleDeclaration(SVGFontFaceElement* element)
-        : CSSElementStyleDeclaration(element, /* isInline */ false)
-    {
-    }
-};
-
 inline SVGFontFaceElement::SVGFontFaceElement(const QualifiedName& tagName, Document* document)
     : SVGElement(tagName, document)
     , m_fontFaceRule(CSSFontFaceRule::create())
-    , m_styleDeclaration(FontFaceStyleDeclaration::create(this))
+    , m_styleDeclaration(CSSElementStyleDeclaration::createForSVGFontFaceElement(this))
 {
     ASSERT(hasTagName(font_faceTag));
     m_styleDeclaration->setStrictParsing(true);