OLD | NEW |
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 11 matching lines...) Expand all Loading... |
22 #if ENABLE(SVG_FONTS) | 22 #if ENABLE(SVG_FONTS) |
23 #include "core/svg/SVGAltGlyphDefElement.h" | 23 #include "core/svg/SVGAltGlyphDefElement.h" |
24 | 24 |
25 #include "SVGNames.h" | 25 #include "SVGNames.h" |
26 #include "core/dom/ElementTraversal.h" | 26 #include "core/dom/ElementTraversal.h" |
27 #include "core/svg/SVGAltGlyphItemElement.h" | 27 #include "core/svg/SVGAltGlyphItemElement.h" |
28 #include "core/svg/SVGGlyphRefElement.h" | 28 #include "core/svg/SVGGlyphRefElement.h" |
29 | 29 |
30 namespace WebCore { | 30 namespace WebCore { |
31 | 31 |
32 SVGAltGlyphDefElement::SVGAltGlyphDefElement(Document& document) | 32 inline SVGAltGlyphDefElement::SVGAltGlyphDefElement(Document& document) |
33 : SVGElement(SVGNames::altGlyphDefTag, document) | 33 : SVGElement(SVGNames::altGlyphDefTag, document) |
34 { | 34 { |
35 ScriptWrappable::init(this); | 35 ScriptWrappable::init(this); |
36 } | 36 } |
37 | 37 |
| 38 DEFINE_NODE_FACTORY(SVGAltGlyphDefElement) |
| 39 |
38 bool SVGAltGlyphDefElement::hasValidGlyphElements(Vector<AtomicString>& glyphNam
es) const | 40 bool SVGAltGlyphDefElement::hasValidGlyphElements(Vector<AtomicString>& glyphNam
es) const |
39 { | 41 { |
40 // Spec: http://www.w3.org/TR/SVG/text.html#AltGlyphDefElement | 42 // Spec: http://www.w3.org/TR/SVG/text.html#AltGlyphDefElement |
41 // An 'altGlyphDef' can contain either of the following: | 43 // An 'altGlyphDef' can contain either of the following: |
42 // | 44 // |
43 // 1. In the simplest case, an 'altGlyphDef' contains one or more 'glyphRef'
elements. | 45 // 1. In the simplest case, an 'altGlyphDef' contains one or more 'glyphRef'
elements. |
44 // Each 'glyphRef' element references a single glyph within a particular fon
t. | 46 // Each 'glyphRef' element references a single glyph within a particular fon
t. |
45 // If all of the referenced glyphs are available, then these glyphs are rend
ered | 47 // If all of the referenced glyphs are available, then these glyphs are rend
ered |
46 // instead of the character(s) inside of the referencing 'altGlyph' element. | 48 // instead of the character(s) inside of the referencing 'altGlyph' element. |
47 // If any of the referenced glyphs are unavailable, then the character(s) th
at are | 49 // If any of the referenced glyphs are unavailable, then the character(s) th
at are |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 if (toSVGAltGlyphItemElement(child)->hasValidGlyphElements(glyphName
s) && !glyphNames.isEmpty()) | 110 if (toSVGAltGlyphItemElement(child)->hasValidGlyphElements(glyphName
s) && !glyphNames.isEmpty()) |
109 return true; | 111 return true; |
110 } | 112 } |
111 } | 113 } |
112 return !glyphNames.isEmpty(); | 114 return !glyphNames.isEmpty(); |
113 } | 115 } |
114 | 116 |
115 } | 117 } |
116 | 118 |
117 #endif | 119 #endif |
OLD | NEW |