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

Clean up SVGNames usage in core/rendering

Clean up SVGNames usage in core/rendering, sometimes the header is included but it is not used.
In some other spots, prefer "using namespace SVG".

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176049 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4e03d6fb
......@@ -22,14 +22,8 @@
#include "config.h"
#include "core/rendering/HitTestLocation.h"
#include "HTMLNames.h"
#include "SVGNames.h"
#include "XLinkNames.h"
namespace WebCore {
using namespace HTMLNames;
HitTestLocation::HitTestLocation()
: m_isRectBased(false)
, m_isRectilinear(true)
......
......@@ -23,7 +23,6 @@
#include "core/rendering/HitTestResult.h"
#include "HTMLNames.h"
#include "SVGNames.h"
#include "XLinkNames.h"
#include "core/dom/DocumentMarkerController.h"
#include "core/dom/NodeRenderingTraversal.h"
......
......@@ -47,7 +47,6 @@
#include "CSSPropertyNames.h"
#include "HTMLNames.h"
#include "RuntimeEnabledFeatures.h"
#include "SVGNames.h"
#include "core/animation/ActiveAnimations.h"
#include "core/css/PseudoStyleRequest.h"
#include "core/dom/Document.h"
......
......@@ -29,7 +29,6 @@
#include "core/rendering/svg/ReferenceFilterBuilder.h"
#include "SVGNames.h"
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSPrimitiveValueMappings.h"
#include "core/css/StylePropertySet.h"
......
......@@ -28,7 +28,6 @@
#include "core/rendering/svg/RenderSVGEllipse.h"
#include "SVGNames.h"
#include "core/svg/SVGCircleElement.h"
#include "core/svg/SVGEllipseElement.h"
#include "platform/graphics/GraphicsContext.h"
......
......@@ -21,15 +21,12 @@
#include "core/rendering/svg/RenderSVGGradientStop.h"
#include "SVGNames.h"
#include "core/rendering/svg/RenderSVGResourceContainer.h"
#include "core/svg/SVGGradientElement.h"
#include "core/svg/SVGStopElement.h"
namespace WebCore {
using namespace SVGNames;
RenderSVGGradientStop::RenderSVGGradientStop(SVGStopElement* element)
: RenderObject(element)
{
......
......@@ -23,7 +23,6 @@
#include "core/rendering/svg/RenderSVGInline.h"
#include "SVGNames.h"
#include "core/rendering/svg/RenderSVGText.h"
#include "core/rendering/svg/SVGInlineFlowBox.h"
#include "core/rendering/svg/SVGRenderSupport.h"
......
......@@ -31,7 +31,6 @@
#include "config.h"
#include "core/rendering/svg/RenderSVGModelObject.h"
#include "SVGNames.h"
#include "core/rendering/RenderView.h"
#include "core/rendering/svg/RenderSVGRoot.h"
#include "core/rendering/svg/SVGRenderSupport.h"
......
......@@ -30,8 +30,6 @@
#include "core/rendering/svg/RenderSVGRect.h"
#include "platform/graphics/GraphicsContext.h"
#include "SVGNames.h"
namespace WebCore {
RenderSVGRect::RenderSVGRect(SVGRectElement* node)
......
......@@ -24,7 +24,6 @@
#include "core/rendering/svg/RenderSVGTSpan.h"
#include "SVGNames.h"
#include "core/rendering/svg/SVGRenderSupport.h"
#include "core/svg/SVGAltGlyphElement.h"
......
......@@ -21,7 +21,6 @@
#include "core/rendering/svg/RenderSVGTextPath.h"
#include "SVGNames.h"
#include "core/rendering/svg/SVGPathData.h"
#include "core/rendering/svg/SVGRenderSupport.h"
#include "core/svg/SVGPathElement.h"
......
......@@ -23,7 +23,6 @@
#include "core/rendering/svg/RenderSVGTransformableContainer.h"
#include "SVGNames.h"
#include "core/rendering/svg/SVGRenderSupport.h"
#include "core/svg/SVGGElement.h"
#include "core/svg/SVGGraphicsElement.h"
......
......@@ -23,7 +23,6 @@
#include "config.h"
#include "core/rendering/svg/RenderSVGViewportContainer.h"
#include "SVGNames.h"
#include "core/rendering/PaintInfo.h"
#include "core/rendering/svg/SVGRenderSupport.h"
#include "core/svg/SVGSVGElement.h"
......
......@@ -34,6 +34,8 @@
namespace WebCore {
using namespace SVGNames;
static void updatePathFromCircleElement(SVGElement* element, Path& path)
{
SVGCircleElement* circle = toSVGCircleElement(element);
......@@ -138,13 +140,13 @@ void updatePathFromGraphicsElement(SVGElement* element, Path& path)
static HashMap<StringImpl*, PathUpdateFunction>* map = 0;
if (!map) {
map = new HashMap<StringImpl*, PathUpdateFunction>;
map->set(SVGNames::circleTag.localName().impl(), updatePathFromCircleElement);
map->set(SVGNames::ellipseTag.localName().impl(), updatePathFromEllipseElement);
map->set(SVGNames::lineTag.localName().impl(), updatePathFromLineElement);
map->set(SVGNames::pathTag.localName().impl(), updatePathFromPathElement);
map->set(SVGNames::polygonTag.localName().impl(), updatePathFromPolygonElement);
map->set(SVGNames::polylineTag.localName().impl(), updatePathFromPolylineElement);
map->set(SVGNames::rectTag.localName().impl(), updatePathFromRectElement);
map->set(circleTag.localName().impl(), updatePathFromCircleElement);
map->set(ellipseTag.localName().impl(), updatePathFromEllipseElement);
map->set(lineTag.localName().impl(), updatePathFromLineElement);
map->set(pathTag.localName().impl(), updatePathFromPathElement);
map->set(polygonTag.localName().impl(), updatePathFromPolygonElement);
map->set(polylineTag.localName().impl(), updatePathFromPolylineElement);
map->set(rectTag.localName().impl(), updatePathFromRectElement);
}
if (PathUpdateFunction pathUpdateFunction = map->get(element->localName().impl()))
......
......@@ -30,7 +30,6 @@
#include "core/rendering/svg/SVGRenderTreeAsText.h"
#include "SVGNames.h"
#include "core/rendering/InlineTextBox.h"
#include "core/rendering/RenderTreeAsText.h"
#include "core/rendering/svg/RenderSVGGradientStop.h"
......
......@@ -38,6 +38,8 @@
namespace WebCore {
using namespace SVGNames;
SVGResources::SVGResources()
: m_linkedResource(0)
{
......@@ -49,45 +51,45 @@ static HashSet<AtomicString>& clipperFilterMaskerTags()
if (s_tagList.isEmpty()) {
// "container elements": http://www.w3.org/TR/SVG11/intro.html#TermContainerElement
// "graphics elements" : http://www.w3.org/TR/SVG11/intro.html#TermGraphicsElement
s_tagList.add(SVGNames::aTag.localName());
s_tagList.add(SVGNames::circleTag.localName());
s_tagList.add(SVGNames::ellipseTag.localName());
s_tagList.add(aTag.localName());
s_tagList.add(circleTag.localName());
s_tagList.add(ellipseTag.localName());
#if ENABLE(SVG_FONTS)
s_tagList.add(SVGNames::glyphTag.localName());
s_tagList.add(glyphTag.localName());
#endif
s_tagList.add(SVGNames::gTag.localName());
s_tagList.add(SVGNames::imageTag.localName());
s_tagList.add(SVGNames::lineTag.localName());
s_tagList.add(SVGNames::markerTag.localName());
s_tagList.add(SVGNames::maskTag.localName());
s_tagList.add(gTag.localName());
s_tagList.add(imageTag.localName());
s_tagList.add(lineTag.localName());
s_tagList.add(markerTag.localName());
s_tagList.add(maskTag.localName());
#if ENABLE(SVG_FONTS)
s_tagList.add(SVGNames::missing_glyphTag.localName());
s_tagList.add(missing_glyphTag.localName());
#endif
s_tagList.add(SVGNames::pathTag.localName());
s_tagList.add(SVGNames::polygonTag.localName());
s_tagList.add(SVGNames::polylineTag.localName());
s_tagList.add(SVGNames::rectTag.localName());
s_tagList.add(SVGNames::svgTag.localName());
s_tagList.add(SVGNames::textTag.localName());
s_tagList.add(SVGNames::useTag.localName());
s_tagList.add(pathTag.localName());
s_tagList.add(polygonTag.localName());
s_tagList.add(polylineTag.localName());
s_tagList.add(rectTag.localName());
s_tagList.add(svgTag.localName());
s_tagList.add(textTag.localName());
s_tagList.add(useTag.localName());
// Not listed in the definitions is the clipPath element, the SVG spec says though:
// The "clipPath" element or any of its children can specify property "clip-path".
// So we have to add clipPathTag here, otherwhise clip-path on clipPath will fail.
// (Already mailed SVG WG, waiting for a solution)
s_tagList.add(SVGNames::clipPathTag.localName());
s_tagList.add(clipPathTag.localName());
// Not listed in the definitions are the text content elements, though filter/clipper/masker on tspan/text/.. is allowed.
// (Already mailed SVG WG, waiting for a solution)
#if ENABLE(SVG_FONTS)
s_tagList.add(SVGNames::altGlyphTag.localName());
s_tagList.add(altGlyphTag.localName());
#endif
s_tagList.add(SVGNames::textPathTag.localName());
s_tagList.add(SVGNames::tspanTag.localName());
s_tagList.add(textPathTag.localName());
s_tagList.add(tspanTag.localName());
// Not listed in the definitions is the foreignObject element, but clip-path
// is a supported attribute.
s_tagList.add(SVGNames::foreignObjectTag.localName());
s_tagList.add(foreignObjectTag.localName());
// Elements that we ignore, as it doesn't make any sense.
// defs, pattern, switch (FIXME: Mail SVG WG about these)
......@@ -101,10 +103,10 @@ bool SVGResources::supportsMarkers(const SVGElement& element)
{
DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ());
if (s_tagList.isEmpty()) {
s_tagList.add(SVGNames::lineTag.localName());
s_tagList.add(SVGNames::pathTag.localName());
s_tagList.add(SVGNames::polygonTag.localName());
s_tagList.add(SVGNames::polylineTag.localName());
s_tagList.add(lineTag.localName());
s_tagList.add(pathTag.localName());
s_tagList.add(polygonTag.localName());
s_tagList.add(polylineTag.localName());
}
return s_tagList.contains(element.localName());
......@@ -115,18 +117,18 @@ static HashSet<AtomicString>& fillAndStrokeTags()
DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ());
if (s_tagList.isEmpty()) {
#if ENABLE(SVG_FONTS)
s_tagList.add(SVGNames::altGlyphTag.localName());
s_tagList.add(altGlyphTag.localName());
#endif
s_tagList.add(SVGNames::circleTag.localName());
s_tagList.add(SVGNames::ellipseTag.localName());
s_tagList.add(SVGNames::lineTag.localName());
s_tagList.add(SVGNames::pathTag.localName());
s_tagList.add(SVGNames::polygonTag.localName());
s_tagList.add(SVGNames::polylineTag.localName());
s_tagList.add(SVGNames::rectTag.localName());
s_tagList.add(SVGNames::textTag.localName());
s_tagList.add(SVGNames::textPathTag.localName());
s_tagList.add(SVGNames::tspanTag.localName());
s_tagList.add(circleTag.localName());
s_tagList.add(ellipseTag.localName());
s_tagList.add(lineTag.localName());
s_tagList.add(pathTag.localName());
s_tagList.add(polygonTag.localName());
s_tagList.add(polylineTag.localName());
s_tagList.add(rectTag.localName());
s_tagList.add(textTag.localName());
s_tagList.add(textPathTag.localName());
s_tagList.add(tspanTag.localName());
}
return s_tagList;
......@@ -136,10 +138,10 @@ static HashSet<AtomicString>& chainableResourceTags()
{
DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ());
if (s_tagList.isEmpty()) {
s_tagList.add(SVGNames::linearGradientTag.localName());
s_tagList.add(SVGNames::filterTag.localName());
s_tagList.add(SVGNames::patternTag.localName());
s_tagList.add(SVGNames::radialGradientTag.localName());
s_tagList.add(linearGradientTag.localName());
s_tagList.add(filterTag.localName());
s_tagList.add(patternTag.localName());
s_tagList.add(radialGradientTag.localName());
}
return s_tagList;
......
......@@ -24,7 +24,6 @@
#include "config.h"
#include "core/rendering/svg/SVGRootInlineBox.h"
#include "SVGNames.h"
#include "core/rendering/svg/RenderSVGInlineText.h"
#include "core/rendering/svg/RenderSVGText.h"
#include "core/rendering/svg/SVGInlineFlowBox.h"
......
......@@ -23,7 +23,6 @@
#if ENABLE(SVG_FONTS)
#include "core/rendering/svg/SVGTextRunRenderingContext.h"
#include "SVGNames.h"
#include "core/rendering/RenderObject.h"
#include "core/rendering/svg/RenderSVGInlineText.h"
#include "core/rendering/svg/RenderSVGResourceSolidColor.h"
......
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