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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/SVGResources.cpp

Issue 1885453002: Rename Node::treeScope() to Node::treeScopeOrDocument() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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
OLDNEW
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 String target; 139 String target;
140 if (isSVGPatternElement(element)) 140 if (isSVGPatternElement(element))
141 target = toSVGPatternElement(element).href()->currentValue()->value(); 141 target = toSVGPatternElement(element).href()->currentValue()->value();
142 else if (isSVGGradientElement(element)) 142 else if (isSVGGradientElement(element))
143 target = toSVGGradientElement(element).href()->currentValue()->value(); 143 target = toSVGGradientElement(element).href()->currentValue()->value();
144 else if (isSVGFilterElement(element)) 144 else if (isSVGFilterElement(element))
145 target = toSVGFilterElement(element).href()->currentValue()->value(); 145 target = toSVGFilterElement(element).href()->currentValue()->value();
146 else 146 else
147 ASSERT_NOT_REACHED(); 147 ASSERT_NOT_REACHED();
148 148
149 return SVGURIReference::fragmentIdentifierFromIRIString(target, element.tree Scope()); 149 return SVGURIReference::fragmentIdentifierFromIRIString(target, element.tree ScopeOrDocument());
150 } 150 }
151 151
152 static inline bool svgPaintTypeHasURL(SVGPaintType paintType) 152 static inline bool svgPaintTypeHasURL(SVGPaintType paintType)
153 { 153 {
154 switch (paintType) { 154 switch (paintType) {
155 case SVG_PAINTTYPE_URI_NONE: 155 case SVG_PAINTTYPE_URI_NONE:
156 case SVG_PAINTTYPE_URI_CURRENTCOLOR: 156 case SVG_PAINTTYPE_URI_CURRENTCOLOR:
157 case SVG_PAINTTYPE_URI_RGBCOLOR: 157 case SVG_PAINTTYPE_URI_RGBCOLOR:
158 case SVG_PAINTTYPE_URI: 158 case SVG_PAINTTYPE_URI:
159 return true; 159 return true;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 Node* node = object->node(); 210 Node* node = object->node();
211 ASSERT(node); 211 ASSERT(node);
212 ASSERT_WITH_SECURITY_IMPLICATION(node->isSVGElement()); 212 ASSERT_WITH_SECURITY_IMPLICATION(node->isSVGElement());
213 213
214 SVGElement* element = toSVGElement(node); 214 SVGElement* element = toSVGElement(node);
215 ASSERT(element); 215 ASSERT(element);
216 216
217 const AtomicString& tagName = element->localName(); 217 const AtomicString& tagName = element->localName();
218 ASSERT(!tagName.isNull()); 218 ASSERT(!tagName.isNull());
219 219
220 TreeScope& treeScope = element->treeScope(); 220 TreeScope& treeScope = element->treeScopeOrDocument();
221 SVGDocumentExtensions& extensions = element->document().accessSVGExtensions( ); 221 SVGDocumentExtensions& extensions = element->document().accessSVGExtensions( );
222 222
223 OwnPtr<SVGResources> resources; 223 OwnPtr<SVGResources> resources;
224 if (clipperFilterMaskerTags().contains(tagName)) { 224 if (clipperFilterMaskerTags().contains(tagName)) {
225 if (style.hasClipper()) { 225 if (style.hasClipper()) {
226 AtomicString id = style.clipperResource(); 226 AtomicString id = style.clipperResource();
227 if (!ensureResources(resources).setClipper(getLayoutSVGResourceById< LayoutSVGResourceClipper>(treeScope, id))) 227 if (!ensureResources(resources).setClipper(getLayoutSVGResourceById< LayoutSVGResourceClipper>(treeScope, id)))
228 registerPendingResource(extensions, id, element); 228 registerPendingResource(extensions, id, element);
229 } 229 }
230 230
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 if (LayoutSVGResourcePaintServer* stroke = m_fillStrokeData->stroke) 664 if (LayoutSVGResourcePaintServer* stroke = m_fillStrokeData->stroke)
665 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke-> element()); 665 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke-> element());
666 } 666 }
667 667
668 if (m_linkedResource) 668 if (m_linkedResource)
669 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_ linkedResource->element()); 669 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_ linkedResource->element());
670 } 670 }
671 #endif 671 #endif
672 672
673 } // namespace blink 673 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698