Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: Source/core/svg/SVGGlyphRefElement.cpp

Issue 643703006: SVGElement::parseAttribute resolves property via property map (Step 2.4) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: aut Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/svg/SVGCursorElement.cpp ('k') | Source/core/svg/SVGMPathElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Leo Yang <leoyang@webkit.org> 2 * Copyright (C) 2011 Leo Yang <leoyang@webkit.org>
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 return isSVGGlyphElement(element); 48 return isSVGGlyphElement(element);
49 } 49 }
50 50
51 template<typename CharType> 51 template<typename CharType>
52 void SVGGlyphRefElement::parseAttributeInternal(const QualifiedName& name, const AtomicString& value) 52 void SVGGlyphRefElement::parseAttributeInternal(const QualifiedName& name, const AtomicString& value)
53 { 53 {
54 const CharType* ptr = value.isEmpty() ? 0 : value.string().getCharacters<Cha rType>(); 54 const CharType* ptr = value.isEmpty() ? 0 : value.string().getCharacters<Cha rType>();
55 const CharType* end = ptr + value.length(); 55 const CharType* end = ptr + value.length();
56 56
57 // FIXME: We need some error handling here. 57 // FIXME: We need some error handling here.
58 SVGParsingError parseError = NoError;
59 if (name == SVGNames::xAttr) { 58 if (name == SVGNames::xAttr) {
60 parseNumber(ptr, end, m_x); 59 parseNumber(ptr, end, m_x);
61 } else if (name == SVGNames::yAttr) { 60 } else if (name == SVGNames::yAttr) {
62 parseNumber(ptr, end, m_y); 61 parseNumber(ptr, end, m_y);
63 } else if (name == SVGNames::dxAttr) { 62 } else if (name == SVGNames::dxAttr) {
64 parseNumber(ptr, end, m_dx); 63 parseNumber(ptr, end, m_dx);
65 } else if (name == SVGNames::dyAttr) { 64 } else if (name == SVGNames::dyAttr) {
66 parseNumber(ptr, end, m_dy); 65 parseNumber(ptr, end, m_dy);
67 } else if (SVGURIReference::parseAttribute(name, value, parseError)) {
68 } else { 66 } else {
69 SVGElement::parseAttribute(name, value); 67 parseAttributeNew(name, value);
70 } 68 }
71 reportAttributeParsingError(parseError, name, value);
72 } 69 }
73 70
74 void SVGGlyphRefElement::parseAttribute(const QualifiedName& name, const AtomicS tring& value) 71 void SVGGlyphRefElement::parseAttribute(const QualifiedName& name, const AtomicS tring& value)
75 { 72 {
76 if (value.isEmpty() || value.is8Bit()) 73 if (value.isEmpty() || value.is8Bit())
77 parseAttributeInternal<LChar>(name, value); 74 parseAttributeInternal<LChar>(name, value);
78 else 75 else
79 parseAttributeInternal<UChar>(name, value); 76 parseAttributeInternal<UChar>(name, value);
80 } 77 }
81 78
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 void SVGGlyphRefElement::setDy(float dy) 111 void SVGGlyphRefElement::setDy(float dy)
115 { 112 {
116 // FIXME: Honor attribute change. 113 // FIXME: Honor attribute change.
117 // https://bugs.webkit.org/show_bug.cgi?id=64787 114 // https://bugs.webkit.org/show_bug.cgi?id=64787
118 m_dy = dy; 115 m_dy = dy;
119 } 116 }
120 117
121 } 118 }
122 119
123 #endif 120 #endif
OLDNEW
« no previous file with comments | « Source/core/svg/SVGCursorElement.cpp ('k') | Source/core/svg/SVGMPathElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698