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

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

Issue 23956012: Stop passing NodeRenderingContext except in textRendererIsNeeded (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGTRefElement.h ('k') | Source/core/svg/SVGTSpanElement.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) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 10 matching lines...) Expand all
21 21
22 #include "config.h" 22 #include "config.h"
23 #include "core/svg/SVGTRefElement.h" 23 #include "core/svg/SVGTRefElement.h"
24 24
25 #include "SVGNames.h" 25 #include "SVGNames.h"
26 #include "XLinkNames.h" 26 #include "XLinkNames.h"
27 #include "bindings/v8/ExceptionStatePlaceholder.h" 27 #include "bindings/v8/ExceptionStatePlaceholder.h"
28 #include "core/dom/EventListener.h" 28 #include "core/dom/EventListener.h"
29 #include "core/dom/EventNames.h" 29 #include "core/dom/EventNames.h"
30 #include "core/dom/MutationEvent.h" 30 #include "core/dom/MutationEvent.h"
31 #include "core/dom/NodeRenderingContext.h"
32 #include "core/dom/Text.h" 31 #include "core/dom/Text.h"
33 #include "core/dom/shadow/ElementShadow.h" 32 #include "core/dom/shadow/ElementShadow.h"
34 #include "core/dom/shadow/ShadowRoot.h" 33 #include "core/dom/shadow/ShadowRoot.h"
35 #include "core/editing/markup.h" 34 #include "core/editing/markup.h"
36 #include "core/page/UseCounter.h" 35 #include "core/page/UseCounter.h"
37 #include "core/rendering/style/StyleInheritedData.h" 36 #include "core/rendering/style/StyleInheritedData.h"
38 #include "core/rendering/svg/RenderSVGInline.h" 37 #include "core/rendering/svg/RenderSVGInline.h"
39 #include "core/rendering/svg/RenderSVGInlineText.h" 38 #include "core/rendering/svg/RenderSVGInlineText.h"
40 #include "core/rendering/svg/RenderSVGResource.h" 39 #include "core/rendering/svg/RenderSVGResource.h"
41 #include "core/svg/SVGDocument.h" 40 #include "core/svg/SVGDocument.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 209 }
211 210
212 ASSERT_NOT_REACHED(); 211 ASSERT_NOT_REACHED();
213 } 212 }
214 213
215 RenderObject* SVGTRefElement::createRenderer(RenderStyle*) 214 RenderObject* SVGTRefElement::createRenderer(RenderStyle*)
216 { 215 {
217 return new RenderSVGInline(this); 216 return new RenderSVGInline(this);
218 } 217 }
219 218
220 bool SVGTRefElement::childShouldCreateRenderer(const NodeRenderingContext& child Context) const 219 bool SVGTRefElement::childShouldCreateRenderer(const Node& child) const
221 { 220 {
222 return childContext.node()->isInShadowTree(); 221 return child.isInShadowTree();
223 } 222 }
224 223
225 bool SVGTRefElement::rendererIsNeeded(const NodeRenderingContext& context) 224 bool SVGTRefElement::rendererIsNeeded(const RenderStyle& style)
226 { 225 {
227 if (parentNode() 226 if (parentNode()
228 && (parentNode()->hasTagName(SVGNames::aTag) 227 && (parentNode()->hasTagName(SVGNames::aTag)
229 #if ENABLE(SVG_FONTS) 228 #if ENABLE(SVG_FONTS)
230 || parentNode()->hasTagName(SVGNames::altGlyphTag) 229 || parentNode()->hasTagName(SVGNames::altGlyphTag)
231 #endif 230 #endif
232 || parentNode()->hasTagName(SVGNames::textTag) 231 || parentNode()->hasTagName(SVGNames::textTag)
233 || parentNode()->hasTagName(SVGNames::textPathTag) 232 || parentNode()->hasTagName(SVGNames::textPathTag)
234 || parentNode()->hasTagName(SVGNames::tspanTag))) 233 || parentNode()->hasTagName(SVGNames::tspanTag)))
235 return Element::rendererIsNeeded(context); 234 return Element::rendererIsNeeded(style);
236 235
237 return false; 236 return false;
238 } 237 }
239 238
240 void SVGTRefElement::buildPendingResource() 239 void SVGTRefElement::buildPendingResource()
241 { 240 {
242 // Remove any existing event listener. 241 // Remove any existing event listener.
243 m_targetListener->detach(); 242 m_targetListener->detach();
244 243
245 // If we're not yet in a document, this function will be called again from i nsertedInto(). 244 // If we're not yet in a document, this function will be called again from i nsertedInto().
(...skipping 30 matching lines...) Expand all
276 } 275 }
277 276
278 void SVGTRefElement::removedFrom(ContainerNode* rootParent) 277 void SVGTRefElement::removedFrom(ContainerNode* rootParent)
279 { 278 {
280 SVGElement::removedFrom(rootParent); 279 SVGElement::removedFrom(rootParent);
281 if (rootParent->inDocument()) 280 if (rootParent->inDocument())
282 m_targetListener->detach(); 281 m_targetListener->detach();
283 } 282 }
284 283
285 } 284 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGTRefElement.h ('k') | Source/core/svg/SVGTSpanElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698