diff options
Diffstat (limited to 'Source/WebCore/svg/SVGVKernElement.cpp')
-rw-r--r-- | Source/WebCore/svg/SVGVKernElement.cpp | 43 |
1 files changed, 12 insertions, 31 deletions
diff --git a/Source/WebCore/svg/SVGVKernElement.cpp b/Source/WebCore/svg/SVGVKernElement.cpp index 44e09fd79..51fad8a8f 100644 --- a/Source/WebCore/svg/SVGVKernElement.cpp +++ b/Source/WebCore/svg/SVGVKernElement.cpp @@ -35,48 +35,29 @@ inline SVGVKernElement::SVGVKernElement(const QualifiedName& tagName, Document& ASSERT(hasTagName(SVGNames::vkernTag)); } -PassRefPtr<SVGVKernElement> SVGVKernElement::create(const QualifiedName& tagName, Document& document) +Ref<SVGVKernElement> SVGVKernElement::create(const QualifiedName& tagName, Document& document) { - return adoptRef(new SVGVKernElement(tagName, document)); + return adoptRef(*new SVGVKernElement(tagName, document)); } -Node::InsertionNotificationRequest SVGVKernElement::insertedInto(ContainerNode& rootParent) +bool SVGVKernElement::buildVerticalKerningPair(SVGKerningPair& kerningPair) const { - if (rootParent.inDocument()) { - ContainerNode* fontNode = parentNode(); - if (fontNode && isSVGFontElement(fontNode)) - toSVGFontElement(fontNode)->invalidateGlyphCache(); - } - - return SVGElement::insertedInto(rootParent); -} - -void SVGVKernElement::removedFrom(ContainerNode& rootParent) -{ - ContainerNode* fontNode = parentNode(); - if (fontNode && isSVGFontElement(fontNode)) - toSVGFontElement(fontNode)->invalidateGlyphCache(); - - SVGElement::removedFrom(rootParent); -} - -void SVGVKernElement::buildVerticalKerningPair(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; } } |