| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 static HashSet<AtomicString>& clipperFilterMaskerTags() | 46 static HashSet<AtomicString>& clipperFilterMaskerTags() |
| 47 { | 47 { |
| 48 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ()); | 48 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ()); |
| 49 if (s_tagList.isEmpty()) { | 49 if (s_tagList.isEmpty()) { |
| 50 // "container elements": http://www.w3.org/TR/SVG11/intro.html#TermConta
inerElement | 50 // "container elements": http://www.w3.org/TR/SVG11/intro.html#TermConta
inerElement |
| 51 // "graphics elements" : http://www.w3.org/TR/SVG11/intro.html#TermGraph
icsElement | 51 // "graphics elements" : http://www.w3.org/TR/SVG11/intro.html#TermGraph
icsElement |
| 52 s_tagList.add(SVGNames::aTag.localName()); | 52 s_tagList.add(SVGNames::aTag.localName()); |
| 53 s_tagList.add(SVGNames::circleTag.localName()); | 53 s_tagList.add(SVGNames::circleTag.localName()); |
| 54 s_tagList.add(SVGNames::ellipseTag.localName()); | 54 s_tagList.add(SVGNames::ellipseTag.localName()); |
| 55 #if ENABLE(SVG_FONTS) |
| 55 s_tagList.add(SVGNames::glyphTag.localName()); | 56 s_tagList.add(SVGNames::glyphTag.localName()); |
| 57 #endif |
| 56 s_tagList.add(SVGNames::gTag.localName()); | 58 s_tagList.add(SVGNames::gTag.localName()); |
| 57 s_tagList.add(SVGNames::imageTag.localName()); | 59 s_tagList.add(SVGNames::imageTag.localName()); |
| 58 s_tagList.add(SVGNames::lineTag.localName()); | 60 s_tagList.add(SVGNames::lineTag.localName()); |
| 59 s_tagList.add(SVGNames::markerTag.localName()); | 61 s_tagList.add(SVGNames::markerTag.localName()); |
| 60 s_tagList.add(SVGNames::maskTag.localName()); | 62 s_tagList.add(SVGNames::maskTag.localName()); |
| 63 #if ENABLE(SVG_FONTS) |
| 61 s_tagList.add(SVGNames::missing_glyphTag.localName()); | 64 s_tagList.add(SVGNames::missing_glyphTag.localName()); |
| 65 #endif |
| 62 s_tagList.add(SVGNames::pathTag.localName()); | 66 s_tagList.add(SVGNames::pathTag.localName()); |
| 63 s_tagList.add(SVGNames::polygonTag.localName()); | 67 s_tagList.add(SVGNames::polygonTag.localName()); |
| 64 s_tagList.add(SVGNames::polylineTag.localName()); | 68 s_tagList.add(SVGNames::polylineTag.localName()); |
| 65 s_tagList.add(SVGNames::rectTag.localName()); | 69 s_tagList.add(SVGNames::rectTag.localName()); |
| 66 s_tagList.add(SVGNames::svgTag.localName()); | 70 s_tagList.add(SVGNames::svgTag.localName()); |
| 67 s_tagList.add(SVGNames::textTag.localName()); | 71 s_tagList.add(SVGNames::textTag.localName()); |
| 68 s_tagList.add(SVGNames::useTag.localName()); | 72 s_tagList.add(SVGNames::useTag.localName()); |
| 69 | 73 |
| 70 // Not listed in the definitions is the clipPath element, the SVG spec s
ays though: | 74 // Not listed in the definitions is the clipPath element, the SVG spec s
ays though: |
| 71 // The "clipPath" element or any of its children can specify property "c
lip-path". | 75 // The "clipPath" element or any of its children can specify property "c
lip-path". |
| 72 // So we have to add clipPathTag here, otherwhise clip-path on clipPath
will fail. | 76 // So we have to add clipPathTag here, otherwhise clip-path on clipPath
will fail. |
| 73 // (Already mailed SVG WG, waiting for a solution) | 77 // (Already mailed SVG WG, waiting for a solution) |
| 74 s_tagList.add(SVGNames::clipPathTag.localName()); | 78 s_tagList.add(SVGNames::clipPathTag.localName()); |
| 75 | 79 |
| 76 // Not listed in the definitions are the text content elements, though f
ilter/clipper/masker on tspan/text/.. is allowed. | 80 // Not listed in the definitions are the text content elements, though f
ilter/clipper/masker on tspan/text/.. is allowed. |
| 77 // (Already mailed SVG WG, waiting for a solution) | 81 // (Already mailed SVG WG, waiting for a solution) |
| 82 #if ENABLE(SVG_FONTS) |
| 78 s_tagList.add(SVGNames::altGlyphTag.localName()); | 83 s_tagList.add(SVGNames::altGlyphTag.localName()); |
| 84 #endif |
| 79 s_tagList.add(SVGNames::textPathTag.localName()); | 85 s_tagList.add(SVGNames::textPathTag.localName()); |
| 80 s_tagList.add(SVGNames::tspanTag.localName()); | 86 s_tagList.add(SVGNames::tspanTag.localName()); |
| 81 | 87 |
| 82 // Not listed in the definitions is the foreignObject element, but clip-
path | 88 // Not listed in the definitions is the foreignObject element, but clip-
path |
| 83 // is a supported attribute. | 89 // is a supported attribute. |
| 84 s_tagList.add(SVGNames::foreignObjectTag.localName()); | 90 s_tagList.add(SVGNames::foreignObjectTag.localName()); |
| 85 | 91 |
| 86 // Elements that we ignore, as it doesn't make any sense. | 92 // Elements that we ignore, as it doesn't make any sense. |
| 87 // defs, pattern, switch (FIXME: Mail SVG WG about these) | 93 // defs, pattern, switch (FIXME: Mail SVG WG about these) |
| 88 // symbol (is converted to a svg element, when referenced by use, we can
safely ignore it.) | 94 // symbol (is converted to a svg element, when referenced by use, we can
safely ignore it.) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 101 s_tagList.add(SVGNames::polylineTag.localName()); | 107 s_tagList.add(SVGNames::polylineTag.localName()); |
| 102 } | 108 } |
| 103 | 109 |
| 104 return s_tagList.contains(element.localName()); | 110 return s_tagList.contains(element.localName()); |
| 105 } | 111 } |
| 106 | 112 |
| 107 static HashSet<AtomicString>& fillAndStrokeTags() | 113 static HashSet<AtomicString>& fillAndStrokeTags() |
| 108 { | 114 { |
| 109 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ()); | 115 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ()); |
| 110 if (s_tagList.isEmpty()) { | 116 if (s_tagList.isEmpty()) { |
| 117 #if ENABLE(SVG_FONTS) |
| 111 s_tagList.add(SVGNames::altGlyphTag.localName()); | 118 s_tagList.add(SVGNames::altGlyphTag.localName()); |
| 119 #endif |
| 112 s_tagList.add(SVGNames::circleTag.localName()); | 120 s_tagList.add(SVGNames::circleTag.localName()); |
| 113 s_tagList.add(SVGNames::ellipseTag.localName()); | 121 s_tagList.add(SVGNames::ellipseTag.localName()); |
| 114 s_tagList.add(SVGNames::lineTag.localName()); | 122 s_tagList.add(SVGNames::lineTag.localName()); |
| 115 s_tagList.add(SVGNames::pathTag.localName()); | 123 s_tagList.add(SVGNames::pathTag.localName()); |
| 116 s_tagList.add(SVGNames::polygonTag.localName()); | 124 s_tagList.add(SVGNames::polygonTag.localName()); |
| 117 s_tagList.add(SVGNames::polylineTag.localName()); | 125 s_tagList.add(SVGNames::polylineTag.localName()); |
| 118 s_tagList.add(SVGNames::rectTag.localName()); | 126 s_tagList.add(SVGNames::rectTag.localName()); |
| 119 s_tagList.add(SVGNames::textTag.localName()); | 127 s_tagList.add(SVGNames::textTag.localName()); |
| 120 s_tagList.add(SVGNames::textPathTag.localName()); | 128 s_tagList.add(SVGNames::textPathTag.localName()); |
| 121 s_tagList.add(SVGNames::tspanTag.localName()); | 129 s_tagList.add(SVGNames::tspanTag.localName()); |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 if (RenderSVGResourceContainer* stroke = m_fillStrokeData->stroke) | 707 if (RenderSVGResourceContainer* stroke = m_fillStrokeData->stroke) |
| 700 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke->
element()); | 708 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke->
element()); |
| 701 } | 709 } |
| 702 | 710 |
| 703 if (m_linkedResource) | 711 if (m_linkedResource) |
| 704 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_
linkedResource->element()); | 712 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_
linkedResource->element()); |
| 705 } | 713 } |
| 706 #endif | 714 #endif |
| 707 | 715 |
| 708 } | 716 } |
| OLD | NEW |