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

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

Issue 216463003: Allow <use> inside author shadow roots (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove loop in isInUserAgentShadowTree, add a title test Created 6 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/svg/dom/use-in-shadow-tree-expected.html ('k') | Source/core/svg/SVGUseElement.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, 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 String SVGElement::title() const 229 String SVGElement::title() const
230 { 230 {
231 // According to spec, we should not return titles when hovering over root <s vg> elements (those 231 // According to spec, we should not return titles when hovering over root <s vg> elements (those
232 // <title> elements are the title of the document, not a tooltip) so we inst antly return. 232 // <title> elements are the title of the document, not a tooltip) so we inst antly return.
233 if (isOutermostSVGSVGElement()) 233 if (isOutermostSVGSVGElement())
234 return String(); 234 return String();
235 235
236 // Walk up the tree, to find out whether we're inside a <use> shadow tree, t o find the right title. 236 // Walk up the tree, to find out whether we're inside a <use> shadow tree, t o find the right title.
237 if (isInShadowTree()) { 237 if (isInShadowTree()) {
238 Element* shadowHostElement = toShadowRoot(treeScope().rootNode()).host() ; 238 Element* shadowHostElement = toShadowRoot(treeScope().rootNode()).host() ;
239 // At this time, SVG nodes are not allowed in non-<use> shadow trees, so any shadow root we do
240 // have should be a use. The assert and following test is here to catch future shadow DOM changes
241 // that do enable SVG in a shadow tree.
242 ASSERT(!shadowHostElement || isSVGUseElement(*shadowHostElement));
243 if (isSVGUseElement(shadowHostElement)) { 239 if (isSVGUseElement(shadowHostElement)) {
244 SVGUseElement& useElement = toSVGUseElement(*shadowHostElement); 240 SVGUseElement& useElement = toSVGUseElement(*shadowHostElement);
245 241
246 // If the <use> title is not empty we found the title to use. 242 // If the <use> title is not empty we found the title to use.
247 String useTitle(useElement.title()); 243 String useTitle(useElement.title());
248 if (!useTitle.isEmpty()) 244 if (!useTitle.isEmpty())
249 return useTitle; 245 return useTitle;
250 } 246 }
251 } 247 }
252 248
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 animatableAttributes.add(SVGNames::zAttr); 1109 animatableAttributes.add(SVGNames::zAttr);
1114 } 1110 }
1115 1111
1116 if (name == classAttr) 1112 if (name == classAttr)
1117 return true; 1113 return true;
1118 1114
1119 return animatableAttributes.contains(name); 1115 return animatableAttributes.contains(name);
1120 } 1116 }
1121 #endif 1117 #endif
1122 } 1118 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/dom/use-in-shadow-tree-expected.html ('k') | Source/core/svg/SVGUseElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698