From 42a624a4cc3f6a77db0e494a9bd5d24dfe2dca8c Mon Sep 17 00:00:00 2001 From: "rob.buis@samsung.com" Date: Wed, 11 Dec 2013 19:13:02 +0000 Subject: SVGLangSpace interface should be removed Remove the SVGLangSpace interface as dictated by the SVG2 specification: https://svgwg.org/svg2-draft/types.html#InterfaceSVGElement The xml:lang handling is handled purely through get/setAttribute. The xml:space uses the same approach, but care has to be taken in SVGTextContentElement to deal with xml:space as we want to react to attribute value changes. BUG=253477 Review URL: https://codereview.chromium.org/109433003 git-svn-id: svn://svn.chromium.org/blink/trunk@163723 bbb929c8-8fbe-4397-9dbb-9b2b20218538 --- third_party/WebKit/Source/core/core.gypi | 2 - .../WebKit/Source/core/svg/SVGCircleElement.cpp | 6 +- third_party/WebKit/Source/core/svg/SVGElement.cpp | 26 +++++-- third_party/WebKit/Source/core/svg/SVGElement.h | 10 ++- .../WebKit/Source/core/svg/SVGEllipseElement.cpp | 6 +- third_party/WebKit/Source/core/svg/SVGGElement.cpp | 3 - .../WebKit/Source/core/svg/SVGImageElement.cpp | 5 +- .../WebKit/Source/core/svg/SVGLangSpace.cpp | 81 ---------------------- third_party/WebKit/Source/core/svg/SVGLangSpace.h | 50 ------------- .../WebKit/Source/core/svg/SVGLineElement.cpp | 6 +- .../WebKit/Source/core/svg/SVGPolyElement.cpp | 5 +- .../WebKit/Source/core/svg/SVGRectElement.cpp | 6 +- .../WebKit/Source/core/svg/SVGSVGElement.cpp | 4 +- .../Source/core/svg/SVGTextContentElement.cpp | 4 +- .../WebKit/Source/core/svg/SVGUseElement.cpp | 7 +- third_party/WebKit/Source/core/xml/xmlattrs.in | 1 + 16 files changed, 44 insertions(+), 178 deletions(-) delete mode 100644 third_party/WebKit/Source/core/svg/SVGLangSpace.cpp delete mode 100644 third_party/WebKit/Source/core/svg/SVGLangSpace.h (limited to 'third_party/WebKit/Source/core') diff --git a/third_party/WebKit/Source/core/core.gypi b/third_party/WebKit/Source/core/core.gypi index 4a974c5..55c7e6f 100644 --- a/third_party/WebKit/Source/core/core.gypi +++ b/third_party/WebKit/Source/core/core.gypi @@ -2995,8 +2995,6 @@ 'svg/SVGImageElement.h', 'svg/SVGImageLoader.cpp', 'svg/SVGImageLoader.h', - 'svg/SVGLangSpace.cpp', - 'svg/SVGLangSpace.h', 'svg/SVGLength.cpp', 'svg/SVGLengthContext.cpp', 'svg/SVGLengthList.cpp', diff --git a/third_party/WebKit/Source/core/svg/SVGCircleElement.cpp b/third_party/WebKit/Source/core/svg/SVGCircleElement.cpp index 6c66614..e1d6ba3 100644 --- a/third_party/WebKit/Source/core/svg/SVGCircleElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGCircleElement.cpp @@ -62,7 +62,6 @@ bool SVGCircleElement::isSupportedAttribute(const QualifiedName& attrName) { DEFINE_STATIC_LOCAL(HashSet, supportedAttributes, ()); if (supportedAttributes.isEmpty()) { - SVGLangSpace::addSupportedAttributes(supportedAttributes); SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes); supportedAttributes.add(SVGNames::cxAttr); supportedAttributes.add(SVGNames::cyAttr); @@ -83,8 +82,7 @@ void SVGCircleElement::parseAttribute(const QualifiedName& name, const AtomicStr setCyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)); else if (name == SVGNames::rAttr) setRBaseValue(SVGLength::construct(LengthModeOther, value, parseError, ForbidNegativeLengths)); - else if (SVGLangSpace::parseAttribute(name, value) - || SVGExternalResourcesRequired::parseAttribute(name, value)) { + else if (SVGExternalResourcesRequired::parseAttribute(name, value)) { } else ASSERT_NOT_REACHED(); @@ -117,7 +115,7 @@ void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName) return; } - if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) { + if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) { RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); return; } diff --git a/third_party/WebKit/Source/core/svg/SVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGElement.cpp index 0f940ab..0ab482d 100644 --- a/third_party/WebKit/Source/core/svg/SVGElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGElement.cpp @@ -295,10 +295,6 @@ PassRefPtr SVGElement::getPresentationAttribute(const String& name) return cssValue ? cssValue->cloneForCSSOM() : 0; } -bool SVGElement::isKnownAttribute(const QualifiedName& attrName) -{ - return isIdAttributeName(attrName); -} bool SVGElement::instanceUpdatesBlocked() const { @@ -327,6 +323,26 @@ void SVGElement::setXMLbase(const String& value) setAttribute(XMLNames::baseAttr, value); } +String SVGElement::xmllang() const +{ + return fastGetAttribute(XMLNames::langAttr); +} + +void SVGElement::setXMLlang(const String& value) +{ + setAttribute(XMLNames::langAttr, value); +} + +String SVGElement::xmlspace() const +{ + return fastGetAttribute(XMLNames::spaceAttr); +} + +void SVGElement::setXMLspace(const String& value) +{ + setAttribute(XMLNames::spaceAttr, value); +} + Node::InsertionNotificationRequest SVGElement::insertedInto(ContainerNode* rootParent) { Element::insertedInto(rootParent); @@ -671,7 +687,7 @@ void SVGElement::parseAttribute(const QualifiedName& name, const AtomicString& v // style updates (instead of Element::parseAttribute). We don't // tell Element about the change to avoid parsing the class list twice setClassNameBaseValue(value); - } else if (SVGLangSpace::parseAttribute(name, value)) { + } else if (name.matches(XMLNames::langAttr) || name.matches(XMLNames::spaceAttr)) { } else Element::parseAttribute(name, value); } diff --git a/third_party/WebKit/Source/core/svg/SVGElement.h b/third_party/WebKit/Source/core/svg/SVGElement.h index f401221..9098753 100644 --- a/third_party/WebKit/Source/core/svg/SVGElement.h +++ b/third_party/WebKit/Source/core/svg/SVGElement.h @@ -24,7 +24,6 @@ #include "core/dom/Element.h" #include "core/svg/SVGAnimatedString.h" -#include "core/svg/SVGLangSpace.h" #include "core/svg/SVGParsingError.h" #include "core/svg/properties/SVGAnimatedPropertyMacros.h" #include "core/svg/properties/SVGPropertyInfo.h" @@ -46,7 +45,7 @@ class SVGSVGElement; void mapAttributeToCSSProperty(HashMap* propertyNameToIdMap, const QualifiedName& attrName); -class SVGElement : public Element, public SVGLangSpace { +class SVGElement : public Element { public: virtual ~SVGElement(); @@ -56,7 +55,6 @@ public: bool hasRelativeLengths() const { return !m_elementsWithRelativeLengths.isEmpty(); } virtual bool supportsMarkers() const { return false; } PassRefPtr getPresentationAttribute(const String& name); - bool isKnownAttribute(const QualifiedName&); static bool isAnimatableCSSProperty(const QualifiedName&); enum CTMScope { NearestViewportScope, // Used by SVGGraphicsElement::getCTM() @@ -71,6 +69,12 @@ public: String xmlbase() const; void setXMLbase(const String&); + String xmllang() const; + void setXMLlang(const String& xmlLang); + + String xmlspace() const; + void setXMLspace(const String& xmlSpace); + SVGSVGElement* ownerSVGElement() const; SVGElement* viewportElement() const; diff --git a/third_party/WebKit/Source/core/svg/SVGEllipseElement.cpp b/third_party/WebKit/Source/core/svg/SVGEllipseElement.cpp index f5046eb..b0e4aed 100644 --- a/third_party/WebKit/Source/core/svg/SVGEllipseElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGEllipseElement.cpp @@ -65,7 +65,6 @@ bool SVGEllipseElement::isSupportedAttribute(const QualifiedName& attrName) { DEFINE_STATIC_LOCAL(HashSet, supportedAttributes, ()); if (supportedAttributes.isEmpty()) { - SVGLangSpace::addSupportedAttributes(supportedAttributes); SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes); supportedAttributes.add(SVGNames::cxAttr); supportedAttributes.add(SVGNames::cyAttr); @@ -89,8 +88,7 @@ void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomicSt setRxBaseValue(SVGLength::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); else if (name == SVGNames::ryAttr) setRyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); - else if (SVGLangSpace::parseAttribute(name, value) - || SVGExternalResourcesRequired::parseAttribute(name, value)) { + else if (SVGExternalResourcesRequired::parseAttribute(name, value)) { } else ASSERT_NOT_REACHED(); @@ -124,7 +122,7 @@ void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName) return; } - if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) { + if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) { RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); return; } diff --git a/third_party/WebKit/Source/core/svg/SVGGElement.cpp b/third_party/WebKit/Source/core/svg/SVGGElement.cpp index aa767c0..6345cc7 100644 --- a/third_party/WebKit/Source/core/svg/SVGGElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGGElement.cpp @@ -65,9 +65,6 @@ void SVGGElement::parseAttribute(const QualifiedName& name, const AtomicString& return; } - if (SVGLangSpace::parseAttribute(name, value)) - return; - ASSERT_NOT_REACHED(); } diff --git a/third_party/WebKit/Source/core/svg/SVGImageElement.cpp b/third_party/WebKit/Source/core/svg/SVGImageElement.cpp index a1873f5..72e3008 100644 --- a/third_party/WebKit/Source/core/svg/SVGImageElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGImageElement.cpp @@ -85,7 +85,6 @@ bool SVGImageElement::isSupportedAttribute(const QualifiedName& attrName) { DEFINE_STATIC_LOCAL(HashSet, supportedAttributes, ()); if (supportedAttributes.isEmpty()) { - SVGLangSpace::addSupportedAttributes(supportedAttributes); SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes); SVGURIReference::addSupportedAttributes(supportedAttributes); supportedAttributes.add(SVGNames::xAttr); @@ -132,8 +131,7 @@ void SVGImageElement::parseAttribute(const QualifiedName& name, const AtomicStri setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); else if (name == SVGNames::heightAttr) setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); - else if (SVGLangSpace::parseAttribute(name, value) - || SVGExternalResourcesRequired::parseAttribute(name, value) + else if (SVGExternalResourcesRequired::parseAttribute(name, value) || SVGURIReference::parseAttribute(name, value)) { } else ASSERT_NOT_REACHED(); @@ -174,7 +172,6 @@ void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName) } if (attrName == SVGNames::preserveAspectRatioAttr - || SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) { RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); return; diff --git a/third_party/WebKit/Source/core/svg/SVGLangSpace.cpp b/third_party/WebKit/Source/core/svg/SVGLangSpace.cpp deleted file mode 100644 index 1fe66e0..0000000 --- a/third_party/WebKit/Source/core/svg/SVGLangSpace.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann - * Copyright (C) 2004, 2005, 2006 Rob Buis - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" -#include "core/svg/SVGLangSpace.h" - -#include "XMLNames.h" -#include "wtf/StdLibExtras.h" - -namespace WebCore { - -void SVGLangSpace::setXMLlang(const AtomicString& xmlLang) -{ - m_lang = xmlLang; -} - -const AtomicString& SVGLangSpace::xmlspace() const -{ - if (!m_space) { - DEFINE_STATIC_LOCAL(const AtomicString, defaultString, ("default", AtomicString::ConstructFromLiteral)); - return defaultString; - } - - return m_space; -} - -void SVGLangSpace::setXMLspace(const AtomicString& xmlSpace) -{ - m_space = xmlSpace; -} - -bool SVGLangSpace::parseAttribute(const QualifiedName& name, const AtomicString& value) -{ - if (name.matches(XMLNames::langAttr)) { - setXMLlang(value); - return true; - } - if (name.matches(XMLNames::spaceAttr)) { - setXMLspace(value); - return true; - } - - return false; -} - -bool SVGLangSpace::isKnownAttribute(const QualifiedName& attrName) -{ - return attrName.matches(XMLNames::langAttr) || attrName.matches(XMLNames::spaceAttr); -} - -void SVGLangSpace::addSupportedAttributes(HashSet& supportedAttributes) -{ - QualifiedName langWithPrefix = XMLNames::langAttr; - langWithPrefix.setPrefix(xmlAtom); - supportedAttributes.add(langWithPrefix); - supportedAttributes.add(XMLNames::langAttr); - - QualifiedName spaceWithPrefix = XMLNames::spaceAttr; - spaceWithPrefix.setPrefix(xmlAtom); - supportedAttributes.add(spaceWithPrefix); - supportedAttributes.add(XMLNames::spaceAttr); -} - -} diff --git a/third_party/WebKit/Source/core/svg/SVGLangSpace.h b/third_party/WebKit/Source/core/svg/SVGLangSpace.h deleted file mode 100644 index 2e323c5..0000000 --- a/third_party/WebKit/Source/core/svg/SVGLangSpace.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann - * Copyright (C) 2004, 2005, 2006 Rob Buis - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SVGLangSpace_h -#define SVGLangSpace_h - -#include "core/dom/QualifiedName.h" -#include "wtf/HashSet.h" - -namespace WebCore { - -class Attribute; - -class SVGLangSpace { -public: - const AtomicString& xmllang() const { return m_lang; } - void setXMLlang(const AtomicString& xmlLang); - - const AtomicString& xmlspace() const; - void setXMLspace(const AtomicString& xmlSpace); - - bool parseAttribute(const QualifiedName&, const AtomicString&); - bool isKnownAttribute(const QualifiedName&); - void addSupportedAttributes(HashSet&); - -private: - AtomicString m_lang; - AtomicString m_space; -}; - -} // namespace WebCore - -#endif // SVGLangSpace_h diff --git a/third_party/WebKit/Source/core/svg/SVGLineElement.cpp b/third_party/WebKit/Source/core/svg/SVGLineElement.cpp index 9cd4a6e..05ffe15 100644 --- a/third_party/WebKit/Source/core/svg/SVGLineElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGLineElement.cpp @@ -64,7 +64,6 @@ bool SVGLineElement::isSupportedAttribute(const QualifiedName& attrName) { DEFINE_STATIC_LOCAL(HashSet, supportedAttributes, ()); if (supportedAttributes.isEmpty()) { - SVGLangSpace::addSupportedAttributes(supportedAttributes); SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes); supportedAttributes.add(SVGNames::x1Attr); supportedAttributes.add(SVGNames::x2Attr); @@ -88,8 +87,7 @@ void SVGLineElement::parseAttribute(const QualifiedName& name, const AtomicStrin setX2BaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); else if (name == SVGNames::y2Attr) setY2BaseValue(SVGLength::construct(LengthModeHeight, value, parseError)); - else if (SVGLangSpace::parseAttribute(name, value) - || SVGExternalResourcesRequired::parseAttribute(name, value)) { + else if (SVGExternalResourcesRequired::parseAttribute(name, value)) { } else ASSERT_NOT_REACHED(); @@ -123,7 +121,7 @@ void SVGLineElement::svgAttributeChanged(const QualifiedName& attrName) return; } - if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) { + if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) { RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); return; } diff --git a/third_party/WebKit/Source/core/svg/SVGPolyElement.cpp b/third_party/WebKit/Source/core/svg/SVGPolyElement.cpp index 217d1ae..8f984b9 100644 --- a/third_party/WebKit/Source/core/svg/SVGPolyElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGPolyElement.cpp @@ -75,7 +75,6 @@ bool SVGPolyElement::isSupportedAttribute(const QualifiedName& attrName) { DEFINE_STATIC_LOCAL(HashSet, supportedAttributes, ()); if (supportedAttributes.isEmpty()) { - SVGLangSpace::addSupportedAttributes(supportedAttributes); SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes); supportedAttributes.add(SVGNames::pointsAttr); } @@ -101,8 +100,6 @@ void SVGPolyElement::parseAttribute(const QualifiedName& name, const AtomicStrin return; } - if (SVGLangSpace::parseAttribute(name, value)) - return; if (SVGExternalResourcesRequired::parseAttribute(name, value)) return; @@ -128,7 +125,7 @@ void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName) return; } - if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) { + if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) { RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); return; } diff --git a/third_party/WebKit/Source/core/svg/SVGRectElement.cpp b/third_party/WebKit/Source/core/svg/SVGRectElement.cpp index 997db63..61c539e 100644 --- a/third_party/WebKit/Source/core/svg/SVGRectElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGRectElement.cpp @@ -71,7 +71,6 @@ bool SVGRectElement::isSupportedAttribute(const QualifiedName& attrName) { DEFINE_STATIC_LOCAL(HashSet, supportedAttributes, ()); if (supportedAttributes.isEmpty()) { - SVGLangSpace::addSupportedAttributes(supportedAttributes); SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes); supportedAttributes.add(SVGNames::xAttr); supportedAttributes.add(SVGNames::yAttr); @@ -101,8 +100,7 @@ void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomicStrin setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); else if (name == SVGNames::heightAttr) setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); - else if (SVGLangSpace::parseAttribute(name, value) - || SVGExternalResourcesRequired::parseAttribute(name, value)) { + else if (SVGExternalResourcesRequired::parseAttribute(name, value)) { } else ASSERT_NOT_REACHED(); @@ -138,7 +136,7 @@ void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) return; } - if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) { + if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) { RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); return; } diff --git a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp index 1a5f98b..f53db04 100644 --- a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp @@ -256,8 +256,7 @@ void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); else if (name == SVGNames::heightAttr) setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); - else if (SVGLangSpace::parseAttribute(name, value) - || SVGExternalResourcesRequired::parseAttribute(name, value) + else if (SVGExternalResourcesRequired::parseAttribute(name, value) || SVGFitToViewBox::parseAttribute(this, name, value) || SVGZoomAndPan::parseAttribute(this, name, value)) { } else @@ -296,7 +295,6 @@ void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName) SVGElementInstance::InvalidationGuard invalidationGuard(this); if (updateRelativeLengthsOrViewBox - || SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName) || SVGZoomAndPan::isKnownAttribute(attrName)) { if (renderer()) diff --git a/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp b/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp index a1901ab..1c29845 100644 --- a/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp @@ -213,10 +213,10 @@ bool SVGTextContentElement::isSupportedAttribute(const QualifiedName& attrName) { DEFINE_STATIC_LOCAL(HashSet, supportedAttributes, ()); if (supportedAttributes.isEmpty()) { - SVGLangSpace::addSupportedAttributes(supportedAttributes); SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes); supportedAttributes.add(SVGNames::lengthAdjustAttr); supportedAttributes.add(SVGNames::textLengthAttr); + supportedAttributes.add(XMLNames::spaceAttr); } return supportedAttributes.contains(attrName); } @@ -255,7 +255,7 @@ void SVGTextContentElement::parseAttribute(const QualifiedName& name, const Atom } else if (name == SVGNames::textLengthAttr) { m_textLength.value = SVGLength::construct(LengthModeOther, value, parseError, ForbidNegativeLengths); } else if (SVGExternalResourcesRequired::parseAttribute(name, value)) { - } else if (SVGLangSpace::parseAttribute(name, value)) { + } else if (name.matches(XMLNames::spaceAttr)) { } else ASSERT_NOT_REACHED(); diff --git a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp index 3afd6f38..80d36bf 100644 --- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp @@ -122,7 +122,6 @@ bool SVGUseElement::isSupportedAttribute(const QualifiedName& attrName) { DEFINE_STATIC_LOCAL(HashSet, supportedAttributes, ()); if (supportedAttributes.isEmpty()) { - SVGLangSpace::addSupportedAttributes(supportedAttributes); SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes); SVGURIReference::addSupportedAttributes(supportedAttributes); supportedAttributes.add(SVGNames::xAttr); @@ -147,8 +146,7 @@ void SVGUseElement::parseAttribute(const QualifiedName& name, const AtomicString setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); else if (name == SVGNames::heightAttr) setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); - else if (SVGLangSpace::parseAttribute(name, value) - || SVGExternalResourcesRequired::parseAttribute(name, value) + else if (SVGExternalResourcesRequired::parseAttribute(name, value) || SVGURIReference::parseAttribute(name, value)) { } else ASSERT_NOT_REACHED(); @@ -249,8 +247,7 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName) if (!renderer) return; - if (SVGLangSpace::isKnownAttribute(attrName) - || SVGExternalResourcesRequired::isKnownAttribute(attrName)) { + if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) { invalidateShadowTree(); return; } diff --git a/third_party/WebKit/Source/core/xml/xmlattrs.in b/third_party/WebKit/Source/core/xml/xmlattrs.in index 6cc47be..a054fe5 100644 --- a/third_party/WebKit/Source/core/xml/xmlattrs.in +++ b/third_party/WebKit/Source/core/xml/xmlattrs.in @@ -1,4 +1,5 @@ namespace="XML" +namespacePrefix="xml" namespaceURI="http://www.w3.org/XML/1998/namespace" base -- cgit v1.1