diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/svg/SVGVKernElement.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
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; } } |