Title: [154414] trunk/Source/WebCore
Revision
154414
Author
[email protected]
Date
2013-08-21 14:07:32 -0700 (Wed, 21 Aug 2013)

Log Message

<https://webkit.org/b/120115> SVG elements always have custom style resolve callbacks.

Reviewed by Antti Koivisto.

Simplify SVGElement construction by making them opt in to custom style resolve callbacks
by default, and removing the ability to pass a custom ConstructionType to some subclass
constructors.

* dom/Node.h:

    Add HasCustomStyleResolveCallbacksFlag to the CreateSVGElement mask.

* svg/SVGElement.cpp:
(WebCore::SVGElement::SVGElement):
* svg/SVGElement.h:
* svg/SVGGElement.cpp:
(WebCore::SVGGElement::SVGGElement):
* svg/SVGGElement.h:
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::SVGGraphicsElement):
* svg/SVGGraphicsElement.h:
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::SVGImageElement):
* svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::SVGStyledElement):
* svg/SVGStyledElement.h:

    Remove calls to setHasCustomStyleResolveCallbacks() in SVGElement and subclasses.
    Also remove unnecessary ConstructionType argument from subclasses since nobody
    overrides it and everyone just uses CreateSVGElement.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (154413 => 154414)


--- trunk/Source/WebCore/ChangeLog	2013-08-21 21:04:57 UTC (rev 154413)
+++ trunk/Source/WebCore/ChangeLog	2013-08-21 21:07:32 UTC (rev 154414)
@@ -1,3 +1,36 @@
+2013-08-21  Andreas Kling  <[email protected]>
+
+        <https://webkit.org/b/120115> SVG elements always have custom style resolve callbacks.
+
+        Reviewed by Antti Koivisto.
+
+        Simplify SVGElement construction by making them opt in to custom style resolve callbacks
+        by default, and removing the ability to pass a custom ConstructionType to some subclass
+        constructors.
+
+        * dom/Node.h:
+
+            Add HasCustomStyleResolveCallbacksFlag to the CreateSVGElement mask.
+
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::SVGElement):
+        * svg/SVGElement.h:
+        * svg/SVGGElement.cpp:
+        (WebCore::SVGGElement::SVGGElement):
+        * svg/SVGGElement.h:
+        * svg/SVGGraphicsElement.cpp:
+        (WebCore::SVGGraphicsElement::SVGGraphicsElement):
+        * svg/SVGGraphicsElement.h:
+        * svg/SVGImageElement.cpp:
+        (WebCore::SVGImageElement::SVGImageElement):
+        * svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::SVGStyledElement):
+        * svg/SVGStyledElement.h:
+
+            Remove calls to setHasCustomStyleResolveCallbacks() in SVGElement and subclasses.
+            Also remove unnecessary ConstructionType argument from subclasses since nobody
+            overrides it and everyone just uses CreateSVGElement.
+
 2013-08-21  Tim Horton  <[email protected]>
 
         revalidateTiles and ensureTilesForRect can share a lot of code

Modified: trunk/Source/WebCore/dom/Node.h (154413 => 154414)


--- trunk/Source/WebCore/dom/Node.h	2013-08-21 21:04:57 UTC (rev 154413)
+++ trunk/Source/WebCore/dom/Node.h	2013-08-21 21:07:32 UTC (rev 154414)
@@ -661,7 +661,7 @@
         CreateDocumentFragment = CreateContainer | IsDocumentFragmentFlag,
         CreateStyledElement = CreateElement | IsStyledElementFlag, 
         CreateHTMLElement = CreateStyledElement | IsHTMLFlag,
-        CreateSVGElement = CreateStyledElement | IsSVGFlag,
+        CreateSVGElement = CreateStyledElement | IsSVGFlag | HasCustomStyleResolveCallbacksFlag,
         CreateDocument = CreateContainer | InDocumentFlag,
         CreateInsertionPoint = CreateHTMLElement | NeedsShadowTreeWalkerFlag,
         CreateEditingText = CreateText | IsEditingTextFlag,

Modified: trunk/Source/WebCore/svg/SVGElement.cpp (154413 => 154414)


--- trunk/Source/WebCore/svg/SVGElement.cpp	2013-08-21 21:04:57 UTC (rev 154413)
+++ trunk/Source/WebCore/svg/SVGElement.cpp	2013-08-21 21:07:32 UTC (rev 154414)
@@ -49,10 +49,9 @@
 
 using namespace HTMLNames;
 
-SVGElement::SVGElement(const QualifiedName& tagName, Document* document, ConstructionType constructionType)
-    : StyledElement(tagName, document, constructionType)
+SVGElement::SVGElement(const QualifiedName& tagName, Document* document)
+    : StyledElement(tagName, document, CreateSVGElement)
 {
-    setHasCustomStyleResolveCallbacks();
 }
 
 PassRefPtr<SVGElement> SVGElement::create(const QualifiedName& tagName, Document* document)

Modified: trunk/Source/WebCore/svg/SVGElement.h (154413 => 154414)


--- trunk/Source/WebCore/svg/SVGElement.h	2013-08-21 21:04:57 UTC (rev 154413)
+++ trunk/Source/WebCore/svg/SVGElement.h	2013-08-21 21:07:32 UTC (rev 154414)
@@ -125,7 +125,7 @@
 #endif
 
 protected:
-    SVGElement(const QualifiedName&, Document*, ConstructionType = CreateSVGElement);
+    SVGElement(const QualifiedName&, Document*);
 
     virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
 

Modified: trunk/Source/WebCore/svg/SVGGElement.cpp (154413 => 154414)


--- trunk/Source/WebCore/svg/SVGGElement.cpp	2013-08-21 21:04:57 UTC (rev 154413)
+++ trunk/Source/WebCore/svg/SVGGElement.cpp	2013-08-21 21:07:32 UTC (rev 154414)
@@ -39,8 +39,8 @@
     REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement)
 END_REGISTER_ANIMATED_PROPERTIES
 
-SVGGElement::SVGGElement(const QualifiedName& tagName, Document* document, ConstructionType constructionType)
-    : SVGGraphicsElement(tagName, document, constructionType)
+SVGGElement::SVGGElement(const QualifiedName& tagName, Document* document)
+    : SVGGraphicsElement(tagName, document)
 {
     ASSERT(hasTagName(SVGNames::gTag));
     registerAnimatedPropertiesForSVGGElement();

Modified: trunk/Source/WebCore/svg/SVGGElement.h (154413 => 154414)


--- trunk/Source/WebCore/svg/SVGGElement.h	2013-08-21 21:04:57 UTC (rev 154413)
+++ trunk/Source/WebCore/svg/SVGGElement.h	2013-08-21 21:07:32 UTC (rev 154414)
@@ -34,7 +34,7 @@
     static PassRefPtr<SVGGElement> create(const QualifiedName&, Document*);
 
 protected:
-    SVGGElement(const QualifiedName&, Document*, ConstructionType = CreateSVGElement);
+    SVGGElement(const QualifiedName&, Document*);
 
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
 

Modified: trunk/Source/WebCore/svg/SVGGraphicsElement.cpp (154413 => 154414)


--- trunk/Source/WebCore/svg/SVGGraphicsElement.cpp	2013-08-21 21:04:57 UTC (rev 154413)
+++ trunk/Source/WebCore/svg/SVGGraphicsElement.cpp	2013-08-21 21:07:32 UTC (rev 154414)
@@ -42,8 +42,8 @@
     REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 END_REGISTER_ANIMATED_PROPERTIES
 
-SVGGraphicsElement::SVGGraphicsElement(const QualifiedName& tagName, Document* document, ConstructionType constructionType)
-    : SVGStyledElement(tagName, document, constructionType)
+SVGGraphicsElement::SVGGraphicsElement(const QualifiedName& tagName, Document* document)
+    : SVGStyledElement(tagName, document)
 {
     registerAnimatedPropertiesForSVGGraphicsElement();
 }

Modified: trunk/Source/WebCore/svg/SVGGraphicsElement.h (154413 => 154414)


--- trunk/Source/WebCore/svg/SVGGraphicsElement.h	2013-08-21 21:04:57 UTC (rev 154413)
+++ trunk/Source/WebCore/svg/SVGGraphicsElement.h	2013-08-21 21:07:32 UTC (rev 154414)
@@ -52,7 +52,7 @@
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
 
 protected:
-    SVGGraphicsElement(const QualifiedName&, Document*, ConstructionType = CreateSVGElement);
+    SVGGraphicsElement(const QualifiedName&, Document*);
 
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;

Modified: trunk/Source/WebCore/svg/SVGImageElement.cpp (154413 => 154414)


--- trunk/Source/WebCore/svg/SVGImageElement.cpp	2013-08-21 21:04:57 UTC (rev 154413)
+++ trunk/Source/WebCore/svg/SVGImageElement.cpp	2013-08-21 21:07:32 UTC (rev 154414)
@@ -66,7 +66,6 @@
 {
     ASSERT(isSVGImageElement(this));
     registerAnimatedPropertiesForSVGImageElement();
-    setHasCustomStyleResolveCallbacks();
 }
 
 PassRefPtr<SVGImageElement> SVGImageElement::create(const QualifiedName& tagName, Document* document)

Modified: trunk/Source/WebCore/svg/SVGStyledElement.cpp (154413 => 154414)


--- trunk/Source/WebCore/svg/SVGStyledElement.cpp	2013-08-21 21:04:57 UTC (rev 154413)
+++ trunk/Source/WebCore/svg/SVGStyledElement.cpp	2013-08-21 21:07:32 UTC (rev 154414)
@@ -69,8 +69,8 @@
     propertyNameToIdMap->set(attrName.localName().impl(), propertyId);
 }
 
-SVGStyledElement::SVGStyledElement(const QualifiedName& tagName, Document* document, ConstructionType constructionType)
-    : SVGElement(tagName, document, constructionType)
+SVGStyledElement::SVGStyledElement(const QualifiedName& tagName, Document* document)
+    : SVGElement(tagName, document)
 {
     registerAnimatedPropertiesForSVGStyledElement();
 }

Modified: trunk/Source/WebCore/svg/SVGStyledElement.h (154413 => 154414)


--- trunk/Source/WebCore/svg/SVGStyledElement.h	2013-08-21 21:04:57 UTC (rev 154413)
+++ trunk/Source/WebCore/svg/SVGStyledElement.h	2013-08-21 21:07:32 UTC (rev 154414)
@@ -60,7 +60,7 @@
     virtual bool needsPendingResourceHandling() const { return true; }
 
 protected: 
-    SVGStyledElement(const QualifiedName&, Document*, ConstructionType = CreateSVGElement);
+    SVGStyledElement(const QualifiedName&, Document*);
     virtual bool rendererIsNeeded(const RenderStyle&);
 
     virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to