From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/svg/SVGAltGlyphElement.cpp | 37 +++++++++++++------------------ 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'Source/WebCore/svg/SVGAltGlyphElement.cpp') diff --git a/Source/WebCore/svg/SVGAltGlyphElement.cpp b/Source/WebCore/svg/SVGAltGlyphElement.cpp index 6df3bebb1..ddcea7401 100644 --- a/Source/WebCore/svg/SVGAltGlyphElement.cpp +++ b/Source/WebCore/svg/SVGAltGlyphElement.cpp @@ -21,9 +21,9 @@ */ #include "config.h" +#include "SVGAltGlyphElement.h" #if ENABLE(SVG_FONTS) -#include "SVGAltGlyphElement.h" #include "ExceptionCode.h" #include "RenderInline.h" @@ -50,57 +50,52 @@ inline SVGAltGlyphElement::SVGAltGlyphElement(const QualifiedName& tagName, Docu registerAnimatedPropertiesForSVGAltGlyphElement(); } -PassRefPtr SVGAltGlyphElement::create(const QualifiedName& tagName, Document& document) +Ref SVGAltGlyphElement::create(const QualifiedName& tagName, Document& document) { - return adoptRef(new SVGAltGlyphElement(tagName, document)); + return adoptRef(*new SVGAltGlyphElement(tagName, document)); } -void SVGAltGlyphElement::setGlyphRef(const AtomicString&, ExceptionCode& ec) +ExceptionOr SVGAltGlyphElement::setGlyphRef(const AtomicString&) { - ec = NO_MODIFICATION_ALLOWED_ERR; + return Exception { NO_MODIFICATION_ALLOWED_ERR }; } const AtomicString& SVGAltGlyphElement::glyphRef() const { - return fastGetAttribute(SVGNames::glyphRefAttr); + return attributeWithoutSynchronization(SVGNames::glyphRefAttr); } -void SVGAltGlyphElement::setFormat(const AtomicString&, ExceptionCode& ec) +ExceptionOr SVGAltGlyphElement::setFormat(const AtomicString&) { - ec = NO_MODIFICATION_ALLOWED_ERR; + return Exception { NO_MODIFICATION_ALLOWED_ERR }; } const AtomicString& SVGAltGlyphElement::format() const { - return fastGetAttribute(SVGNames::formatAttr); + return attributeWithoutSynchronization(SVGNames::formatAttr); } bool SVGAltGlyphElement::childShouldCreateRenderer(const Node& child) const { - if (child.isTextNode()) - return true; - return false; + return child.isTextNode(); } -RenderPtr SVGAltGlyphElement::createElementRenderer(PassRef style) +RenderPtr SVGAltGlyphElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) { - return createRenderer(*this, std::move(style)); + return createRenderer(*this, WTFMove(style)); } bool SVGAltGlyphElement::hasValidGlyphElements(Vector& glyphNames) const { String target; - Element* element = targetElementFromIRIString(getAttribute(XLinkNames::hrefAttr), document(), &target); - if (!element) - return false; + auto* element = targetElementFromIRIString(getAttribute(XLinkNames::hrefAttr), document(), &target); - if (isSVGGlyphElement(element)) { + if (is(element)) { glyphNames.append(target); return true; } - if (isSVGAltGlyphDefElement(element) - && toSVGAltGlyphDefElement(element)->hasValidGlyphElements(glyphNames)) + if (is(element) && downcast(*element).hasValidGlyphElements(glyphNames)) return true; return false; @@ -108,4 +103,4 @@ bool SVGAltGlyphElement::hasValidGlyphElements(Vector& glyphNames) const } -#endif // ENABLE(SVG) +#endif -- cgit v1.2.1