Commit ba97b179 authored by rob.buis@samsung.com's avatar rob.buis@samsung.com

Make supportsMarkers non virtual

Review URL: https://codereview.chromium.org/203193008

git-svn-id: svn://svn.chromium.org/blink/trunk@169568 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 9ec6e0ca
...@@ -196,7 +196,7 @@ bool RenderSVGShape::shouldGenerateMarkerPositions() const ...@@ -196,7 +196,7 @@ bool RenderSVGShape::shouldGenerateMarkerPositions() const
if (!style()->svgStyle()->hasMarkers()) if (!style()->svgStyle()->hasMarkers())
return false; return false;
if (!toSVGGraphicsElement(element())->supportsMarkers()) if (!SVGResources::supportsMarkers(*toSVGGraphicsElement(element())))
return false; return false;
SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this); SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this);
......
...@@ -91,7 +91,7 @@ static HashSet<AtomicString>& clipperFilterMaskerTags() ...@@ -91,7 +91,7 @@ static HashSet<AtomicString>& clipperFilterMaskerTags()
return s_tagList; return s_tagList;
} }
static HashSet<AtomicString>& markerTags() bool SVGResources::supportsMarkers(const SVGElement& element)
{ {
DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ()); DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ());
if (s_tagList.isEmpty()) { if (s_tagList.isEmpty()) {
...@@ -101,7 +101,7 @@ static HashSet<AtomicString>& markerTags() ...@@ -101,7 +101,7 @@ static HashSet<AtomicString>& markerTags()
s_tagList.add(SVGNames::polylineTag.localName()); s_tagList.add(SVGNames::polylineTag.localName());
} }
return s_tagList; return s_tagList.contains(element.localName());
} }
static HashSet<AtomicString>& fillAndStrokeTags() static HashSet<AtomicString>& fillAndStrokeTags()
...@@ -250,7 +250,7 @@ PassOwnPtr<SVGResources> SVGResources::buildResources(const RenderObject* object ...@@ -250,7 +250,7 @@ PassOwnPtr<SVGResources> SVGResources::buildResources(const RenderObject* object
} }
} }
if (markerTags().contains(tagName) && style->hasMarkers()) { if (style->hasMarkers() && supportsMarkers(*element)) {
const AtomicString& markerStartId = style->markerStartResource(); const AtomicString& markerStartId = style->markerStartResource();
if (!ensureResources(resources)->setMarkerStart(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerStartId))) if (!ensureResources(resources)->setMarkerStart(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerStartId)))
registerPendingResource(extensions, markerStartId, element); registerPendingResource(extensions, markerStartId, element);
......
...@@ -35,6 +35,7 @@ class RenderSVGResourceContainer; ...@@ -35,6 +35,7 @@ class RenderSVGResourceContainer;
class RenderSVGResourceFilter; class RenderSVGResourceFilter;
class RenderSVGResourceMarker; class RenderSVGResourceMarker;
class RenderSVGResourceMasker; class RenderSVGResourceMasker;
class SVGElement;
class SVGRenderStyle; class SVGRenderStyle;
// Holds a set of resources associated with a RenderObject // Holds a set of resources associated with a RenderObject
...@@ -46,6 +47,8 @@ public: ...@@ -46,6 +47,8 @@ public:
static PassOwnPtr<SVGResources> buildResources(const RenderObject*, const SVGRenderStyle*); static PassOwnPtr<SVGResources> buildResources(const RenderObject*, const SVGRenderStyle*);
void layoutIfNeeded(); void layoutIfNeeded();
static bool supportsMarkers(const SVGElement&);
// Ordinary resources // Ordinary resources
RenderSVGResourceClipper* clipper() const { return m_clipperFilterMaskerData ? m_clipperFilterMaskerData->clipper : 0; } RenderSVGResourceClipper* clipper() const { return m_clipperFilterMaskerData ? m_clipperFilterMaskerData->clipper : 0; }
RenderSVGResourceMarker* markerStart() const { return m_markerData ? m_markerData->markerStart : 0; } RenderSVGResourceMarker* markerStart() const { return m_markerData ? m_markerData->markerStart : 0; }
......
...@@ -55,7 +55,6 @@ public: ...@@ -55,7 +55,6 @@ public:
virtual String title() const OVERRIDE; virtual String title() const OVERRIDE;
bool hasRelativeLengths() const { return !m_elementsWithRelativeLengths.isEmpty(); } bool hasRelativeLengths() const { return !m_elementsWithRelativeLengths.isEmpty(); }
virtual bool supportsMarkers() const { return false; }
PassRefPtrWillBeRawPtr<CSSValue> getPresentationAttribute(const AtomicString& name); PassRefPtrWillBeRawPtr<CSSValue> getPresentationAttribute(const AtomicString& name);
static bool isAnimatableCSSProperty(const QualifiedName&); static bool isAnimatableCSSProperty(const QualifiedName&);
enum CTMScope { enum CTMScope {
......
...@@ -46,8 +46,6 @@ private: ...@@ -46,8 +46,6 @@ private:
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE; virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE;
virtual bool supportsMarkers() const OVERRIDE { return true; }
virtual bool selfHasRelativeLengths() const OVERRIDE; virtual bool selfHasRelativeLengths() const OVERRIDE;
RefPtr<SVGAnimatedLength> m_x1; RefPtr<SVGAnimatedLength> m_x1;
......
...@@ -103,7 +103,6 @@ private: ...@@ -103,7 +103,6 @@ private:
bool isSupportedAttribute(const QualifiedName&); bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE; virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE;
virtual bool supportsMarkers() const OVERRIDE { return true; }
virtual Node::InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; virtual Node::InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
virtual void removedFrom(ContainerNode*) OVERRIDE; virtual void removedFrom(ContainerNode*) OVERRIDE;
......
...@@ -45,8 +45,6 @@ private: ...@@ -45,8 +45,6 @@ private:
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE FINAL; virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE FINAL;
virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE FINAL; virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE FINAL;
virtual bool supportsMarkers() const OVERRIDE FINAL { return true; }
private: private:
RefPtr<SVGAnimatedPointList> m_points; RefPtr<SVGAnimatedPointList> m_points;
......
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