Commit 98ebb807 authored by akling@apple.com's avatar akling@apple.com
Browse files

<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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 30200348
2013-08-21 Andreas Kling <akling@apple.com>
<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 <timothy_horton@apple.com>
 
revalidateTiles and ensureTilesForRect can share a lot of code
......@@ -661,7 +661,7 @@ protected:
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,
......
......@@ -49,10 +49,9 @@ namespace WebCore {
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)
......
......@@ -125,7 +125,7 @@ public:
#endif
protected:
SVGElement(const QualifiedName&, Document*, ConstructionType = CreateSVGElement);
SVGElement(const QualifiedName&, Document*);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
......
......@@ -39,8 +39,8 @@ BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGGElement)
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();
......
......@@ -34,7 +34,7 @@ public:
static PassRefPtr<SVGGElement> create(const QualifiedName&, Document*);
protected:
SVGGElement(const QualifiedName&, Document*, ConstructionType = CreateSVGElement);
SVGGElement(const QualifiedName&, Document*);
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
......
......@@ -42,8 +42,8 @@ BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGGraphicsElement)
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();
}
......
......@@ -52,7 +52,7 @@ public:
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;
......
......@@ -66,7 +66,6 @@ inline SVGImageElement::SVGImageElement(const QualifiedName& tagName, Document*
{
ASSERT(isSVGImageElement(this));
registerAnimatedPropertiesForSVGImageElement();
setHasCustomStyleResolveCallbacks();
}
PassRefPtr<SVGImageElement> SVGImageElement::create(const QualifiedName& tagName, Document* document)
......
......@@ -69,8 +69,8 @@ void mapAttributeToCSSProperty(HashMap<AtomicStringImpl*, CSSPropertyID>* proper
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();
}
......
......@@ -60,7 +60,7 @@ public:
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment