Changeset 234683 in webkit


Ignore:
Timestamp:
Aug 7, 2018 5:55:51 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Allow href attribute without xlink on SVG elements
https://bugs.webkit.org/show_bug.cgi?id=153854

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-08-07
Reviewed by Dean Jackson.

Source/WebCore:

SVG 2 has moved the href attribute from xlink namespace to svg namespace.
Instead of using xlink:href, svg:href should be used or simply use href
if the svg namespace is defined.

See https://www.w3.org/TR/SVG2/linking.html#XLinkRefAttrs.

For backward compatibility, xlink:href will be treated as an alias to href
till it is acceptable to completely remove the support for the deprecated
xlink:href.

Tests: svg/custom/href-svg-namespace-animate.svg

svg/custom/href-svg-namespace-dynamic.svg
svg/custom/href-svg-namespace-elements.html
svg/custom/href-svg-namespace-expected.svg
svg/custom/href-svg-namespace-static.svg

  • dom/Element.cpp:

(WebCore::Element::absoluteLinkURL const):

  • dom/Element.h:

(WebCore::Element::getAttribute const): This new template function with
template pack parameter QualifiedNames is added to return the first none
empty attribute value given a set of attributes' names. This should be
useful for deprecated attributes. When we decide to remove the support
for the deprecated attribute, all we need is to remove it as a parameter
to getAttribute(). In this case, the none template function will be called.

  • dom/VisitedLinkState.cpp:

(WebCore::linkAttribute):

  • html/parser/XSSAuditor.cpp:

(WebCore::XSSAuditor::filterScriptToken):

  • svg/SVGAElement.cpp:

(WebCore::SVGAElement::isURLAttribute const):

  • svg/SVGAltGlyphElement.cpp:

(WebCore::SVGAltGlyphElement::hasValidGlyphElements const):

  • svg/SVGCursorElement.cpp:
  • svg/SVGDocumentExtensions.cpp:

(WebCore::SVGDocumentExtensions::rebuildElements):
(WebCore::SVGDocumentExtensions::rebuildAllElementReferencesForTarget):

  • svg/SVGElement.cpp:

(WebCore::SVGElement::animatableAttributeForName):

  • svg/SVGFEImageElement.cpp:
  • svg/SVGFilterElement.cpp:
  • svg/SVGFontFaceUriElement.cpp:

(WebCore::SVGFontFaceUriElement::srcValue const):
(WebCore::SVGFontFaceUriElement::parseAttribute):
(WebCore::SVGFontFaceUriElement::loadFont):

  • svg/SVGForeignObjectElement.cpp:
  • svg/SVGGlyphRefElement.cpp:

(WebCore::SVGGlyphRefElement::hasValidGlyphElement const):

  • svg/SVGGradientElement.cpp:
  • svg/SVGImageElement.cpp:

(WebCore::SVGImageElement::imageSourceURL const):

  • svg/SVGMPathElement.cpp:
  • svg/SVGPatternElement.cpp:
  • svg/SVGScriptElement.h:
  • svg/SVGTRefElement.cpp:
  • svg/SVGTextPathElement.cpp:
  • svg/SVGURIReference.cpp:

(WebCore::SVGURIReference::registerAttributes):
(WebCore::SVGURIReference::parseAttribute):

  • svg/SVGUseElement.cpp:

(WebCore::SVGUseElement::expandUseElementsInShadowTree const):

  • svg/animation/SVGSMILElement.cpp:

(WebCore::SVGSMILElement::isSupportedAttribute):
(WebCore::SVGSMILElement::svgAttributeChanged):

  • svg/svgattrs.in:

LayoutTests:

  • fast/selectors/any-link-basics-2-expected.txt:
  • fast/selectors/any-link-basics-2.html:

Re-baseline this test because it was assuming the bare href should not
work for the SVG <a> element.

  • svg/custom/href-svg-namespace-animate-expected.svg: Added.
  • svg/custom/href-svg-namespace-animate.svg: Added.
  • svg/custom/href-svg-namespace-dynamic-expected.svg: Added.
  • svg/custom/href-svg-namespace-dynamic.svg: Added.
  • svg/custom/href-svg-namespace-elements-expected.txt: Added.
  • svg/custom/href-svg-namespace-elements.html: Added.
  • svg/custom/href-svg-namespace-static-expected.svg: Added.
  • svg/custom/href-svg-namespace.static-svg: Added.
Location:
trunk
Files:
8 added
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r234680 r234683  
     12018-08-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        Allow href attribute without xlink on SVG elements
     4        https://bugs.webkit.org/show_bug.cgi?id=153854
     5
     6        Reviewed by Dean Jackson.
     7
     8        * fast/selectors/any-link-basics-2-expected.txt:
     9        * fast/selectors/any-link-basics-2.html:
     10        Re-baseline this test because it was assuming the bare href should not
     11        work for the SVG <a> element.
     12        * svg/custom/href-svg-namespace-animate-expected.svg: Added.
     13        * svg/custom/href-svg-namespace-animate.svg: Added.
     14        * svg/custom/href-svg-namespace-dynamic-expected.svg: Added.
     15        * svg/custom/href-svg-namespace-dynamic.svg: Added.
     16        * svg/custom/href-svg-namespace-elements-expected.txt: Added.
     17        * svg/custom/href-svg-namespace-elements.html: Added.
     18        * svg/custom/href-svg-namespace-static-expected.svg: Added.
     19        * svg/custom/href-svg-namespace.static-svg: Added.
     20
    1212018-08-07  Ryosuke Niwa  <rniwa@webkit.org>
    222
  • trunk/LayoutTests/fast/selectors/any-link-basics-2-expected.txt

    r175301 r234683  
    44
    55
    6 PASS document.querySelectorAll(":any-link").length is 21
     6PASS document.querySelectorAll(":any-link").length is 25
    77PASS document.querySelectorAll(":any-link")[0] is document.getElementById("target-tag-2")
    88PASS document.querySelectorAll(":any-link")[1] is document.getElementById("target-tag-3")
     
    2222PASS document.querySelectorAll(":any-link")[15] is document.getElementById("target-tag-24")
    2323PASS document.querySelectorAll(":any-link")[16] is document.getElementById("target-tag-25")
    24 PASS document.querySelectorAll(":any-link")[17] is document.getElementById("target-tag-31")
    25 PASS document.querySelectorAll(":any-link")[18] is document.getElementById("target-tag-32")
    26 PASS document.querySelectorAll(":any-link")[19] is document.getElementById("target-tag-33")
    27 PASS document.querySelectorAll(":any-link")[20] is document.getElementById("target-tag-34")
     24PASS document.querySelectorAll(":any-link")[17] is document.getElementById("target-tag-27")
     25PASS document.querySelectorAll(":any-link")[18] is document.getElementById("target-tag-28")
     26PASS document.querySelectorAll(":any-link")[19] is document.getElementById("target-tag-29")
     27PASS document.querySelectorAll(":any-link")[20] is document.getElementById("target-tag-30")
     28PASS document.querySelectorAll(":any-link")[21] is document.getElementById("target-tag-31")
     29PASS document.querySelectorAll(":any-link")[22] is document.getElementById("target-tag-32")
     30PASS document.querySelectorAll(":any-link")[23] is document.getElementById("target-tag-33")
     31PASS document.querySelectorAll(":any-link")[24] is document.getElementById("target-tag-34")
    2832PASS getComputedStyle(document.getElementById("target-tag-1")).backgroundColor is "rgb(255, 255, 255)"
    2933PASS getComputedStyle(document.getElementById("target-tag-2")).backgroundColor is "rgb(1, 2, 3)"
     
    5256PASS getComputedStyle(document.getElementById("target-tag-25")).backgroundColor is "rgb(1, 2, 3)"
    5357PASS getComputedStyle(document.getElementById("target-tag-26")).backgroundColor is "rgb(255, 255, 255)"
    54 PASS getComputedStyle(document.getElementById("target-tag-27")).backgroundColor is "rgb(255, 255, 255)"
    55 PASS getComputedStyle(document.getElementById("target-tag-28")).backgroundColor is "rgb(255, 255, 255)"
    56 PASS getComputedStyle(document.getElementById("target-tag-29")).backgroundColor is "rgb(255, 255, 255)"
    57 PASS getComputedStyle(document.getElementById("target-tag-30")).backgroundColor is "rgb(255, 255, 255)"
     58PASS getComputedStyle(document.getElementById("target-tag-27")).backgroundColor is "rgb(1, 2, 3)"
     59PASS getComputedStyle(document.getElementById("target-tag-28")).backgroundColor is "rgb(1, 2, 3)"
     60PASS getComputedStyle(document.getElementById("target-tag-29")).backgroundColor is "rgb(1, 2, 3)"
     61PASS getComputedStyle(document.getElementById("target-tag-30")).backgroundColor is "rgb(1, 2, 3)"
    5862PASS getComputedStyle(document.getElementById("target-tag-31")).backgroundColor is "rgb(1, 2, 3)"
    5963PASS getComputedStyle(document.getElementById("target-tag-32")).backgroundColor is "rgb(1, 2, 3)"
  • trunk/LayoutTests/fast/selectors/any-link-basics-2.html

    r175301 r234683  
    7777description('Test the basic matching of the :any-link selector.');
    7878
    79 shouldBe('document.querySelectorAll(":any-link").length', '21');
    80 
    8179// Query Selector.
    8280var expectedIds = ['target-tag-2',
     
    9795                   'target-tag-24',
    9896                   'target-tag-25',
     97                   'target-tag-27',
     98                   'target-tag-28',
     99                   'target-tag-29',
     100                   'target-tag-30',
    99101                   'target-tag-31',
    100102                   'target-tag-32',
    101103                   'target-tag-33',
    102104                   'target-tag-34'];
     105
     106shouldBe('document.querySelectorAll(":any-link").length', expectedIds.length.toString());
    103107
    104108for (var i = 0; i < expectedIds.length; ++i)
     
    132136                      ['target-tag-25', 'rgb(1, 2, 3)'],
    133137                      ['target-tag-26', 'rgb(255, 255, 255)'],
    134                       ['target-tag-27', 'rgb(255, 255, 255)'],
    135                       ['target-tag-28', 'rgb(255, 255, 255)'],
    136                       ['target-tag-29', 'rgb(255, 255, 255)'],
    137                       ['target-tag-30', 'rgb(255, 255, 255)'],
     138                      ['target-tag-27', 'rgb(1, 2, 3)'],
     139                      ['target-tag-28', 'rgb(1, 2, 3)'],
     140                      ['target-tag-29', 'rgb(1, 2, 3)'],
     141                      ['target-tag-30', 'rgb(1, 2, 3)'],
    138142                      ['target-tag-31', 'rgb(1, 2, 3)'],
    139143                      ['target-tag-32', 'rgb(1, 2, 3)'],
  • trunk/Source/WebCore/ChangeLog

    r234680 r234683  
     12018-08-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        Allow href attribute without xlink on SVG elements
     4        https://bugs.webkit.org/show_bug.cgi?id=153854
     5
     6        Reviewed by Dean Jackson.
     7
     8        SVG 2 has moved the href attribute from xlink namespace to svg namespace.
     9        Instead of using xlink:href, svg:href should be used or simply use href
     10        if the svg namespace is defined.
     11
     12        See https://www.w3.org/TR/SVG2/linking.html#XLinkRefAttrs.
     13
     14        For backward compatibility, xlink:href will be treated as an alias to href
     15        till it is acceptable to completely remove the support for the deprecated
     16        xlink:href.
     17
     18        Tests: svg/custom/href-svg-namespace-animate.svg
     19               svg/custom/href-svg-namespace-dynamic.svg
     20               svg/custom/href-svg-namespace-elements.html
     21               svg/custom/href-svg-namespace-expected.svg
     22               svg/custom/href-svg-namespace-static.svg
     23
     24        * dom/Element.cpp:
     25        (WebCore::Element::absoluteLinkURL const):
     26        * dom/Element.h:
     27        (WebCore::Element::getAttribute const): This new template function with
     28        template pack parameter QualifiedNames is added to return the first none
     29        empty attribute value given a set of attributes' names. This should be
     30        useful for deprecated attributes. When we decide to remove the support
     31        for the deprecated attribute, all we need is to remove it as a parameter
     32        to getAttribute(). In this case, the none template function will be called.
     33        * dom/VisitedLinkState.cpp:
     34        (WebCore::linkAttribute):
     35        * html/parser/XSSAuditor.cpp:
     36        (WebCore::XSSAuditor::filterScriptToken):
     37        * svg/SVGAElement.cpp:
     38        (WebCore::SVGAElement::isURLAttribute const):
     39        * svg/SVGAltGlyphElement.cpp:
     40        (WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
     41        * svg/SVGCursorElement.cpp:
     42        * svg/SVGDocumentExtensions.cpp:
     43        (WebCore::SVGDocumentExtensions::rebuildElements):
     44        (WebCore::SVGDocumentExtensions::rebuildAllElementReferencesForTarget):
     45        * svg/SVGElement.cpp:
     46        (WebCore::SVGElement::animatableAttributeForName):
     47        * svg/SVGFEImageElement.cpp:
     48        * svg/SVGFilterElement.cpp:
     49        * svg/SVGFontFaceUriElement.cpp:
     50        (WebCore::SVGFontFaceUriElement::srcValue const):
     51        (WebCore::SVGFontFaceUriElement::parseAttribute):
     52        (WebCore::SVGFontFaceUriElement::loadFont):
     53        * svg/SVGForeignObjectElement.cpp:
     54        * svg/SVGGlyphRefElement.cpp:
     55        (WebCore::SVGGlyphRefElement::hasValidGlyphElement const):
     56        * svg/SVGGradientElement.cpp:
     57        * svg/SVGImageElement.cpp:
     58        (WebCore::SVGImageElement::imageSourceURL const):
     59        * svg/SVGMPathElement.cpp:
     60        * svg/SVGPatternElement.cpp:
     61        * svg/SVGScriptElement.h:
     62        * svg/SVGTRefElement.cpp:
     63        * svg/SVGTextPathElement.cpp:
     64        * svg/SVGURIReference.cpp:
     65        (WebCore::SVGURIReference::registerAttributes):
     66        (WebCore::SVGURIReference::parseAttribute):
     67        * svg/SVGUseElement.cpp:
     68        (WebCore::SVGUseElement::expandUseElementsInShadowTree const):
     69        * svg/animation/SVGSMILElement.cpp:
     70        (WebCore::SVGSMILElement::isSupportedAttribute):
     71        (WebCore::SVGSMILElement::svgAttributeChanged):
     72        * svg/svgattrs.in:
     73
    1742018-08-07  Ryosuke Niwa  <rniwa@webkit.org>
    275
  • trunk/Source/WebCore/dom/Element.cpp

    r234596 r234683  
    14731473    AtomicString linkAttribute;
    14741474    if (hasTagName(SVGNames::aTag))
    1475         linkAttribute = getAttribute(XLinkNames::hrefAttr);
     1475        linkAttribute = getAttribute(SVGNames::hrefAttr, XLinkNames::hrefAttr);
    14761476    else
    14771477        linkAttribute = getAttribute(HTMLNames::hrefAttr);
  • trunk/Source/WebCore/dom/Element.h

    r233605 r234683  
    7777    WEBCORE_EXPORT bool hasAttribute(const QualifiedName&) const;
    7878    WEBCORE_EXPORT const AtomicString& getAttribute(const QualifiedName&) const;
     79    template<typename... QualifiedNames>
     80    const AtomicString& getAttribute(const QualifiedName&, const QualifiedNames&...) const;
    7981    WEBCORE_EXPORT void setAttribute(const QualifiedName&, const AtomicString& value);
    8082    WEBCORE_EXPORT void setAttributeWithoutSynchronization(const QualifiedName&, const AtomicString& value);
     
    818820}
    819821
     822template<typename... QualifiedNames>
     823inline const AtomicString& Element::getAttribute(const QualifiedName& name, const QualifiedNames&... names) const
     824{
     825    const AtomicString& value = getAttribute(name);
     826    if (!value.isEmpty())
     827        return value;
     828    return getAttribute(names...);
     829}
     830
    820831} // namespace WebCore
    821832
  • trunk/Source/WebCore/dom/VisitedLinkState.cpp

    r232178 r234683  
    3434#include "HTMLAnchorElement.h"
    3535#include "Page.h"
     36#include "SVGNames.h"
    3637#include "VisitedLinkStore.h"
    3738#include "XLinkNames.h"
     
    4849        return &element.attributeWithoutSynchronization(HTMLNames::hrefAttr);
    4950    if (element.isSVGElement())
    50         return &element.getAttribute(XLinkNames::hrefAttr);
     51        return &element.getAttribute(SVGNames::hrefAttr, XLinkNames::hrefAttr);
    5152    return 0;
    5253}
  • trunk/Source/WebCore/html/parser/XSSAuditor.cpp

    r234501 r234683  
    448448    if (m_wasScriptTagFoundInRequest) {
    449449        didBlockScript |= eraseAttributeIfInjected(request, srcAttr, blankURL().string(), TruncationStyle::SrcLikeAttribute);
     450        didBlockScript |= eraseAttributeIfInjected(request, SVGNames::hrefAttr, blankURL().string(), TruncationStyle::SrcLikeAttribute);
    450451        didBlockScript |= eraseAttributeIfInjected(request, XLinkNames::hrefAttr, blankURL().string(), TruncationStyle::SrcLikeAttribute);
    451452    }
  • trunk/Source/WebCore/svg/SVGAElement.cpp

    r234620 r234683  
    172172bool SVGAElement::isURLAttribute(const Attribute& attribute) const
    173173{
    174     return attribute.name().localName() == XLinkNames::hrefAttr || SVGGraphicsElement::isURLAttribute(attribute);
     174    return SVGURIReference::isKnownAttribute(attribute.name()) || SVGGraphicsElement::isURLAttribute(attribute);
    175175}
    176176
  • trunk/Source/WebCore/svg/SVGAltGlyphElement.cpp

    r234620 r234683  
    8383{
    8484    String target;
    85     auto element = makeRefPtr(targetElementFromIRIString(getAttribute(XLinkNames::hrefAttr), document(), &target));
     85    auto element = makeRefPtr(targetElementFromIRIString(getAttribute(SVGNames::hrefAttr, XLinkNames::hrefAttr), document(), &target));
    8686
    8787    if (is<SVGGlyphElement>(element)) {
  • trunk/Source/WebCore/svg/SVGCursorElement.cpp

    r234620 r234683  
    2727#include "SVGNames.h"
    2828#include "SVGStringList.h"
    29 #include "XLinkNames.h"
    3029#include <wtf/IsoMallocInlines.h>
    3130#include <wtf/NeverDestroyed.h>
  • trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp

    r224615 r234683  
    3636#include "ScriptableDocumentParser.h"
    3737#include "ShadowRoot.h"
    38 #include "XLinkNames.h"
    3938#include <wtf/text/AtomicString.h>
    4039
     
    327326    Vector<SVGElement*> shadowRebuildElements = WTFMove(m_rebuildElements);
    328327    for (auto* element : shadowRebuildElements)
    329         element->svgAttributeChanged(XLinkNames::hrefAttr);
     328        element->svgAttributeChanged(SVGNames::hrefAttr);
    330329}
    331330
     
    357356
    358357    for (auto* element : elementsToRebuild)
    359         element->svgAttributeChanged(XLinkNames::hrefAttr);
     358        element->svgAttributeChanged(SVGNames::hrefAttr);
    360359}
    361360
  • trunk/Source/WebCore/svg/SVGElement.cpp

    r234620 r234683  
    5151#include "SVGUseElement.h"
    5252#include "ShadowRoot.h"
    53 #include "XLinkNames.h"
    5453#include "XMLNames.h"
    5554#include <wtf/Assertions.h>
     
    855854            &SVGNames::yChannelSelectorAttr.get(),
    856855            &SVGNames::zAttr.get(),
    857             &XLinkNames::hrefAttr.get(),
     856            &SVGNames::hrefAttr.get(),
    858857        };
    859858        HashMap<AtomicString, QualifiedName> map;
  • trunk/Source/WebCore/svg/SVGFEImageElement.cpp

    r234620 r234683  
    3333#include "SVGNames.h"
    3434#include "SVGPreserveAspectRatioValue.h"
    35 #include "XLinkNames.h"
    3635#include <wtf/IsoMallocInlines.h>
    3736
  • trunk/Source/WebCore/svg/SVGFilterElement.cpp

    r234620 r234683  
    3232#include "SVGNames.h"
    3333#include "SVGParserUtilities.h"
    34 #include "XLinkNames.h"
    3534#include <wtf/IsoMallocInlines.h>
    3635#include <wtf/NeverDestroyed.h>
  • trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp

    r229694 r234683  
    5959Ref<CSSFontFaceSrcValue> SVGFontFaceUriElement::srcValue() const
    6060{
    61     auto src = CSSFontFaceSrcValue::create(getAttribute(XLinkNames::hrefAttr));
     61    auto src = CSSFontFaceSrcValue::create(getAttribute(SVGNames::hrefAttr, XLinkNames::hrefAttr));
    6262    AtomicString value(attributeWithoutSynchronization(formatAttr));
    6363    src.get().setFormat(value.isEmpty() ? "svg" : value); // Default format
     
    6767void SVGFontFaceUriElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
    6868{
    69     if (name == XLinkNames::hrefAttr)
     69    if (name == SVGNames::hrefAttr || name == XLinkNames::hrefAttr)
    7070        loadFont();
    7171    else
     
    102102        m_cachedFont->removeClient(*this);
    103103
    104     const AtomicString& href = getAttribute(XLinkNames::hrefAttr);
     104    const AtomicString& href = getAttribute(SVGNames::hrefAttr, XLinkNames::hrefAttr);
    105105    if (!href.isNull()) {
    106106        ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
  • trunk/Source/WebCore/svg/SVGForeignObjectElement.cpp

    r234620 r234683  
    2828#include "SVGLengthValue.h"
    2929#include "SVGNames.h"
    30 #include "XLinkNames.h"
    3130#include <wtf/Assertions.h>
    3231#include <wtf/IsoMallocInlines.h>
  • trunk/Source/WebCore/svg/SVGGlyphRefElement.cpp

    r234620 r234683  
    5151    // FIXME: We only support xlink:href so far.
    5252    // https://bugs.webkit.org/show_bug.cgi?id=64787
    53     return is<SVGGlyphElement>(targetElementFromIRIString(getAttribute(XLinkNames::hrefAttr), document(), &glyphName));
     53    return is<SVGGlyphElement>(targetElementFromIRIString(getAttribute(SVGNames::hrefAttr, XLinkNames::hrefAttr), document(), &glyphName));
    5454}
    5555
  • trunk/Source/WebCore/svg/SVGGradientElement.cpp

    r234620 r234683  
    3333#include "SVGTransformable.h"
    3434#include "StyleResolver.h"
    35 #include "XLinkNames.h"
    3635#include <wtf/IsoMallocInlines.h>
    3736#include <wtf/NeverDestroyed.h>
  • trunk/Source/WebCore/svg/SVGImageElement.cpp

    r234620 r234683  
    168168const AtomicString& SVGImageElement::imageSourceURL() const
    169169{
    170     return getAttribute(XLinkNames::hrefAttr);
     170    return getAttribute(SVGNames::hrefAttr, XLinkNames::hrefAttr);
    171171}
    172172
  • trunk/Source/WebCore/svg/SVGMPathElement.cpp

    r234620 r234683  
    2727#include "SVGNames.h"
    2828#include "SVGPathElement.h"
    29 #include "XLinkNames.h"
    3029
    3130namespace WebCore {
  • trunk/Source/WebCore/svg/SVGPatternElement.cpp

    r234620 r234683  
    3939#include "SVGStringList.h"
    4040#include "SVGTransformable.h"
    41 #include "XLinkNames.h"
    4241#include <wtf/IsoMallocInlines.h>
    4342#include <wtf/NeverDestroyed.h>
  • trunk/Source/WebCore/svg/SVGScriptElement.h

    r234620 r234683  
    6868    bool hasDeferAttribute() const final { return false; }
    6969    bool hasNoModuleAttribute() const final { return false; }
    70     bool hasSourceAttribute() const final { return hasAttribute(XLinkNames::hrefAttr); }
     70    bool hasSourceAttribute() const final { return hasAttribute(SVGNames::hrefAttr) || hasAttribute(XLinkNames::hrefAttr); }
    7171
    7272    void dispatchLoadEvent() final { SVGExternalResourcesRequired::dispatchLoadEvent(); }
  • trunk/Source/WebCore/svg/SVGTRefElement.cpp

    r234620 r234683  
    3737#include "StyleInheritedData.h"
    3838#include "Text.h"
    39 #include "XLinkNames.h"
    4039#include <wtf/IsoMallocInlines.h>
    4140
  • trunk/Source/WebCore/svg/SVGTextPathElement.cpp

    r234620 r234683  
    2727#include "SVGDocumentExtensions.h"
    2828#include "SVGNames.h"
    29 #include "XLinkNames.h"
    3029#include <wtf/IsoMallocInlines.h>
    3130#include <wtf/NeverDestroyed.h>
  • trunk/Source/WebCore/svg/SVGURIReference.cpp

    r234620 r234683  
    4242    if (!registry.isEmpty())
    4343        return;
     44    registry.registerAttribute<SVGNames::hrefAttr, &SVGURIReference::m_href>();
    4445    registry.registerAttribute<XLinkNames::hrefAttr, &SVGURIReference::m_href>();
    4546}
     
    5758void SVGURIReference::parseAttribute(const QualifiedName& name, const AtomicString& value)
    5859{
    59     if (name.matches(XLinkNames::hrefAttr))
     60    if (isKnownAttribute(name))
    6061        m_href.setValue(value);
    6162}
  • trunk/Source/WebCore/svg/SVGUseElement.cpp

    r234620 r234683  
    481481        replacementClone->removeAttribute(SVGNames::widthAttr);
    482482        replacementClone->removeAttribute(SVGNames::heightAttr);
     483        replacementClone->removeAttribute(SVGNames::hrefAttr);
    483484        replacementClone->removeAttribute(XLinkNames::hrefAttr);
    484485
  • trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp

    r234278 r234683  
    468468        SVGNames::maxAttr,
    469469        SVGNames::attributeNameAttr,
     470        SVGNames::hrefAttr,
    470471        XLinkNames::hrefAttr,
    471472    });
     
    520521    else if (attrName == SVGNames::attributeNameAttr)
    521522        updateAttributeName();
    522     else if (attrName.matches(XLinkNames::hrefAttr)) {
     523    else if (attrName.matches(SVGNames::hrefAttr) || attrName.matches(XLinkNames::hrefAttr)) {
    523524        InstanceInvalidationGuard guard(*this);
    524525        buildPendingResource();
  • trunk/Source/WebCore/svg/svgattrs.in

    r191494 r234683  
    8888horiz-origin-x
    8989horiz-origin-y
     90href
    9091ideographic
    9192image-rendering
Note: See TracChangeset for help on using the changeset viewer.