diff options
author | Kristian Monsen <kristianm@google.com> | 2010-05-21 16:53:46 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-05-25 10:24:15 +0100 |
commit | 6c2af9490927c3c5959b5cb07461b646f8b32f6c (patch) | |
tree | f7111b9b22befab472616c1d50ec94eb50f1ec8c /WebCore/svg/SVGHKernElement.cpp | |
parent | a149172322a9067c14e8b474a53e63649aa17cad (diff) | |
download | external_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.zip external_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.tar.gz external_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.tar.bz2 |
Merge WebKit at r59636: Initial merge by git
Change-Id: I59b289c4e6b18425f06ce41cc9d34c522515de91
Diffstat (limited to 'WebCore/svg/SVGHKernElement.cpp')
-rw-r--r-- | WebCore/svg/SVGHKernElement.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/WebCore/svg/SVGHKernElement.cpp b/WebCore/svg/SVGHKernElement.cpp index 1b8746b..491bd77 100644 --- a/WebCore/svg/SVGHKernElement.cpp +++ b/WebCore/svg/SVGHKernElement.cpp @@ -62,18 +62,23 @@ void SVGHKernElement::removedFromDocument() } } -SVGHorizontalKerningPair SVGHKernElement::buildHorizontalKerningPair() const +void SVGHKernElement::buildHorizontalKerningPair(KerningPairVector& kerningPairs) { - SVGHorizontalKerningPair kerningPair; - - // FIXME: KerningPairs shouldn't be created on parsing errors. - parseGlyphName(getAttribute(g1Attr), kerningPair.glyphName1); - parseGlyphName(getAttribute(g2Attr), kerningPair.glyphName2); - parseKerningUnicodeString(getAttribute(u1Attr), kerningPair.unicodeRange1, kerningPair.unicodeName1); - parseKerningUnicodeString(getAttribute(u2Attr), kerningPair.unicodeRange2, kerningPair.unicodeName2); - kerningPair.kerning = getAttribute(kAttr).string().toFloat(); - - return kerningPair; + String u1 = getAttribute(u1Attr); + String g1 = getAttribute(g1Attr); + String u2 = getAttribute(u2Attr); + String g2 = getAttribute(g2Attr); + if ((u1.isEmpty() && g1.isEmpty()) || (u2.isEmpty() && g2.isEmpty())) + return; + + 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 = getAttribute(kAttr).string().toFloat(); + kerningPairs.append(kerningPair); + } } } |