OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> |
3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2008 Apple Inc. All rights reserved. | 4 * Copyright (C) 2008 Apple Inc. All rights reserved. |
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "SVGNames.h" | 29 #include "SVGNames.h" |
30 #include "XLinkNames.h" | 30 #include "XLinkNames.h" |
31 #include "XMLNames.h" | 31 #include "XMLNames.h" |
32 #include "bindings/v8/ScriptEventListener.h" | 32 #include "bindings/v8/ScriptEventListener.h" |
33 #include "core/css/CSSCursorImageValue.h" | 33 #include "core/css/CSSCursorImageValue.h" |
34 #include "core/css/CSSParser.h" | 34 #include "core/css/CSSParser.h" |
35 #include "core/dom/DOMImplementation.h" | 35 #include "core/dom/DOMImplementation.h" |
36 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
37 #include "core/dom/ElementTraversal.h" | 37 #include "core/dom/ElementTraversal.h" |
38 #include "core/dom/Event.h" | 38 #include "core/dom/Event.h" |
39 #include "core/dom/NodeRenderingContext.h" | |
40 #include "core/dom/shadow/ShadowRoot.h" | 39 #include "core/dom/shadow/ShadowRoot.h" |
41 #include "core/rendering/RenderObject.h" | 40 #include "core/rendering/RenderObject.h" |
42 #include "core/rendering/svg/RenderSVGResourceContainer.h" | 41 #include "core/rendering/svg/RenderSVGResourceContainer.h" |
43 #include "core/svg/SVGCursorElement.h" | 42 #include "core/svg/SVGCursorElement.h" |
44 #include "core/svg/SVGDocumentExtensions.h" | 43 #include "core/svg/SVGDocumentExtensions.h" |
45 #include "core/svg/SVGElementInstance.h" | 44 #include "core/svg/SVGElementInstance.h" |
46 #include "core/svg/SVGElementRareData.h" | 45 #include "core/svg/SVGElementRareData.h" |
47 #include "core/svg/SVGGraphicsElement.h" | 46 #include "core/svg/SVGGraphicsElement.h" |
48 #include "core/svg/SVGSVGElement.h" | 47 #include "core/svg/SVGSVGElement.h" |
49 #include "core/svg/SVGUseElement.h" | 48 #include "core/svg/SVGUseElement.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // Rebuild pending resources for each client of a pending resource that is b
eing removed. | 139 // Rebuild pending resources for each client of a pending resource that is b
eing removed. |
141 while (Element* clientElement = extensions->removeElementFromPendingResource
sForRemoval(resourceId)) { | 140 while (Element* clientElement = extensions->removeElementFromPendingResource
sForRemoval(resourceId)) { |
142 ASSERT(clientElement->hasPendingResources()); | 141 ASSERT(clientElement->hasPendingResources()); |
143 if (clientElement->hasPendingResources()) { | 142 if (clientElement->hasPendingResources()) { |
144 clientElement->buildPendingResource(); | 143 clientElement->buildPendingResource(); |
145 extensions->clearHasPendingResourcesIfPossible(clientElement); | 144 extensions->clearHasPendingResourcesIfPossible(clientElement); |
146 } | 145 } |
147 } | 146 } |
148 } | 147 } |
149 | 148 |
150 bool SVGElement::rendererIsNeeded(const NodeRenderingContext& context) | 149 bool SVGElement::rendererIsNeeded(const RenderStyle& style) |
151 { | 150 { |
152 // http://www.w3.org/TR/SVG/extend.html#PrivateData | 151 // http://www.w3.org/TR/SVG/extend.html#PrivateData |
153 // Prevent anything other than SVG renderers from appearing in our render tr
ee | 152 // Prevent anything other than SVG renderers from appearing in our render tr
ee |
154 // Spec: SVG allows inclusion of elements from foreign namespaces anywhere | 153 // Spec: SVG allows inclusion of elements from foreign namespaces anywhere |
155 // with the SVG content. In general, the SVG user agent will include the unk
nown | 154 // with the SVG content. In general, the SVG user agent will include the unk
nown |
156 // elements in the DOM but will otherwise ignore unknown elements. | 155 // elements in the DOM but will otherwise ignore unknown elements. |
157 if (!parentOrShadowHostElement() || parentOrShadowHostElement()->isSVGElemen
t()) | 156 if (!parentOrShadowHostElement() || parentOrShadowHostElement()->isSVGElemen
t()) |
158 return Element::rendererIsNeeded(context); | 157 return Element::rendererIsNeeded(style); |
159 | 158 |
160 return false; | 159 return false; |
161 } | 160 } |
162 | 161 |
163 SVGElementRareData* SVGElement::svgRareData() const | 162 SVGElementRareData* SVGElement::svgRareData() const |
164 { | 163 { |
165 ASSERT(hasSVGRareData()); | 164 ASSERT(hasSVGRareData()); |
166 return SVGElementRareData::rareDataFromMap(this); | 165 return SVGElementRareData::rareDataFromMap(this); |
167 } | 166 } |
168 | 167 |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 | 877 |
879 // The outermost SVGSVGElement SVGLoad event is fired through Document::disp
atchWindowLoadEvent. | 878 // The outermost SVGSVGElement SVGLoad event is fired through Document::disp
atchWindowLoadEvent. |
880 if (isOutermostSVGSVGElement()) | 879 if (isOutermostSVGSVGElement()) |
881 return; | 880 return; |
882 | 881 |
883 // finishParsingChildren() is called when the close tag is reached for an el
ement (e.g. </svg>) | 882 // finishParsingChildren() is called when the close tag is reached for an el
ement (e.g. </svg>) |
884 // we send SVGLoad events here if we can, otherwise they'll be sent when any
required loads finish | 883 // we send SVGLoad events here if we can, otherwise they'll be sent when any
required loads finish |
885 sendSVGLoadEventIfPossible(); | 884 sendSVGLoadEventIfPossible(); |
886 } | 885 } |
887 | 886 |
888 bool SVGElement::childShouldCreateRenderer(const NodeRenderingContext& childCont
ext) const | 887 bool SVGElement::childShouldCreateRenderer(const Node& child) const |
889 { | 888 { |
890 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, invalidTextContent, ()); | 889 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, invalidTextContent, ()); |
891 | 890 |
892 if (invalidTextContent.isEmpty()) { | 891 if (invalidTextContent.isEmpty()) { |
893 invalidTextContent.add(SVGNames::textPathTag); | 892 invalidTextContent.add(SVGNames::textPathTag); |
894 #if ENABLE(SVG_FONTS) | 893 #if ENABLE(SVG_FONTS) |
895 invalidTextContent.add(SVGNames::altGlyphTag); | 894 invalidTextContent.add(SVGNames::altGlyphTag); |
896 #endif | 895 #endif |
897 invalidTextContent.add(SVGNames::trefTag); | 896 invalidTextContent.add(SVGNames::trefTag); |
898 invalidTextContent.add(SVGNames::tspanTag); | 897 invalidTextContent.add(SVGNames::tspanTag); |
899 } | 898 } |
900 if (childContext.node()->isSVGElement()) { | 899 if (child.isSVGElement()) { |
901 SVGElement* svgChild = toSVGElement(childContext.node()); | 900 const SVGElement* svgChild = toSVGElement(&child); |
902 if (invalidTextContent.contains(svgChild->tagQName())) | 901 if (invalidTextContent.contains(svgChild->tagQName())) |
903 return false; | 902 return false; |
904 | 903 |
905 return svgChild->isValid(); | 904 return svgChild->isValid(); |
906 } | 905 } |
907 return false; | 906 return false; |
908 } | 907 } |
909 | 908 |
910 void SVGElement::attributeChanged(const QualifiedName& name, const AtomicString&
newValue, AttributeModificationReason) | 909 void SVGElement::attributeChanged(const QualifiedName& name, const AtomicString&
newValue, AttributeModificationReason) |
911 { | 910 { |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 } | 1136 } |
1138 | 1137 |
1139 if (name == classAttr) | 1138 if (name == classAttr) |
1140 return true; | 1139 return true; |
1141 | 1140 |
1142 return animatableAttributes.contains(name); | 1141 return animatableAttributes.contains(name); |
1143 } | 1142 } |
1144 #endif | 1143 #endif |
1145 | 1144 |
1146 } | 1145 } |
OLD | NEW |