diff options
Diffstat (limited to 'Source/WebCore/svg/SVGHKernElement.cpp')
-rw-r--r-- | Source/WebCore/svg/SVGHKernElement.cpp | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/Source/WebCore/svg/SVGHKernElement.cpp b/Source/WebCore/svg/SVGHKernElement.cpp index 1688487a8..4392fdf9c 100644 --- a/Source/WebCore/svg/SVGHKernElement.cpp +++ b/Source/WebCore/svg/SVGHKernElement.cpp @@ -36,46 +36,29 @@ inline SVGHKernElement::SVGHKernElement(const QualifiedName& tagName, Document& ASSERT(hasTagName(SVGNames::hkernTag)); } -PassRefPtr<SVGHKernElement> SVGHKernElement::create(const QualifiedName& tagName, Document& document) +Ref<SVGHKernElement> SVGHKernElement::create(const QualifiedName& tagName, Document& document) { - return adoptRef(new SVGHKernElement(tagName, document)); + return adoptRef(*new SVGHKernElement(tagName, document)); } -Node::InsertionNotificationRequest SVGHKernElement::insertedInto(ContainerNode& rootParent) +bool SVGHKernElement::buildHorizontalKerningPair(SVGKerningPair& kerningPair) const { - ContainerNode* fontNode = parentNode(); - if (fontNode && isSVGFontElement(fontNode)) - toSVGFontElement(fontNode)->invalidateGlyphCache(); - - return SVGElement::insertedInto(rootParent); -} - -void SVGHKernElement::removedFrom(ContainerNode& rootParent) -{ - ContainerNode* fontNode = parentNode(); - if (fontNode && isSVGFontElement(fontNode)) - toSVGFontElement(fontNode)->invalidateGlyphCache(); - - SVGElement::removedFrom(rootParent); -} - -void SVGHKernElement::buildHorizontalKerningPair(SVGKerningMap& kerningMap) -{ - String u1 = fastGetAttribute(SVGNames::u1Attr); - String g1 = fastGetAttribute(SVGNames::g1Attr); - String u2 = fastGetAttribute(SVGNames::u2Attr); - String g2 = fastGetAttribute(SVGNames::g2Attr); + String u1 = attributeWithoutSynchronization(SVGNames::u1Attr); + String g1 = attributeWithoutSynchronization(SVGNames::g1Attr); + String u2 = attributeWithoutSynchronization(SVGNames::u2Attr); + String g2 = attributeWithoutSynchronization(SVGNames::g2Attr); if ((u1.isEmpty() && g1.isEmpty()) || (u2.isEmpty() && g2.isEmpty())) - return; + return false; - SVGKerningPair kerningPair; if (parseGlyphName(g1, kerningPair.glyphName1) && parseGlyphName(g2, kerningPair.glyphName2) && parseKerningUnicodeString(u1, kerningPair.unicodeRange1, kerningPair.unicodeName1) && parseKerningUnicodeString(u2, kerningPair.unicodeRange2, kerningPair.unicodeName2)) { - kerningPair.kerning = fastGetAttribute(SVGNames::kAttr).string().toFloat(); - kerningMap.insert(kerningPair); + bool ok = false; + kerningPair.kerning = attributeWithoutSynchronization(SVGNames::kAttr).string().toFloat(&ok); + return ok; } + return false; } } |