summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/SVGAltGlyphElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/svg/SVGAltGlyphElement.cpp')
-rw-r--r--Source/WebCore/svg/SVGAltGlyphElement.cpp37
1 files changed, 16 insertions, 21 deletions
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> SVGAltGlyphElement::create(const QualifiedName& tagName, Document& document)
+Ref<SVGAltGlyphElement> 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<void> 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<void> 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<RenderElement> SVGAltGlyphElement::createElementRenderer(PassRef<RenderStyle> style)
+RenderPtr<RenderElement> SVGAltGlyphElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
{
- return createRenderer<RenderSVGTSpan>(*this, std::move(style));
+ return createRenderer<RenderSVGTSpan>(*this, WTFMove(style));
}
bool SVGAltGlyphElement::hasValidGlyphElements(Vector<String>& 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<SVGGlyphElement>(element)) {
glyphNames.append(target);
return true;
}
- if (isSVGAltGlyphDefElement(element)
- && toSVGAltGlyphDefElement(element)->hasValidGlyphElements(glyphNames))
+ if (is<SVGAltGlyphDefElement>(element) && downcast<SVGAltGlyphDefElement>(*element).hasValidGlyphElements(glyphNames))
return true;
return false;
@@ -108,4 +103,4 @@ bool SVGAltGlyphElement::hasValidGlyphElements(Vector<String>& glyphNames) const
}
-#endif // ENABLE(SVG)
+#endif