Title: [118879] branches/chromium/1132/Source/WebCore
- Revision
- 118879
- Author
- [email protected]
- Date
- 2012-05-29 18:57:59 -0700 (Tue, 29 May 2012)
Log Message
Merge 117957
BUG=128342
Review URL: https://chromiumcodereview.appspot.com/10446075
Modified Paths
Diff
Modified: branches/chromium/1132/Source/WebCore/dom/EventDispatcher.cpp (118878 => 118879)
--- branches/chromium/1132/Source/WebCore/dom/EventDispatcher.cpp 2012-05-30 01:55:21 UTC (rev 118878)
+++ branches/chromium/1132/Source/WebCore/dom/EventDispatcher.cpp 2012-05-30 01:57:59 UTC (rev 118879)
@@ -66,16 +66,12 @@
// Spec: The event handling for the non-exposed tree works as if the referenced element had been textually included
// as a deeply cloned child of the 'use' element, except that events are dispatched to the SVGElementInstance objects
Element* shadowHostElement = referenceNode->treeScope()->rootNode()->shadowHost();
- // At this time, SVG nodes are not allowed in non-<use> shadow trees, so any shadow root we do
- // have should be a use. The assert and following test is here to catch future shadow DOM changes
- // that do enable SVG in a shadow tree.
- ASSERT(!shadowHostElement || shadowHostElement->hasTagName(SVGNames::useTag));
- if (shadowHostElement && shadowHostElement->hasTagName(SVGNames::useTag)) {
- SVGUseElement* useElement = static_cast<SVGUseElement*>(shadowHostElement);
-
- if (SVGElementInstance* instance = useElement->instanceForShadowTreeElement(referenceNode))
- return instance;
- }
+ // At this time, SVG nodes are not supported in non-<use> shadow trees.
+ if (!shadowHostElement || !shadowHostElement->hasTagName(SVGNames::useTag))
+ return referenceNode;
+ SVGUseElement* useElement = static_cast<SVGUseElement*>(shadowHostElement);
+ if (SVGElementInstance* instance = useElement->instanceForShadowTreeElement(referenceNode))
+ return instance;
#endif
return referenceNode;
Modified: branches/chromium/1132/Source/WebCore/page/EventHandler.cpp (118878 => 118879)
--- branches/chromium/1132/Source/WebCore/page/EventHandler.cpp 2012-05-30 01:55:21 UTC (rev 118878)
+++ branches/chromium/1132/Source/WebCore/page/EventHandler.cpp 2012-05-30 01:57:59 UTC (rev 118879)
@@ -2096,10 +2096,9 @@
return 0;
Element* shadowTreeParentElement = shadowTreeElement->shadowHost();
- if (!shadowTreeParentElement)
+ if (!shadowTreeParentElement || !shadowTreeParentElement->hasTagName(useTag))
return 0;
- ASSERT(shadowTreeParentElement->hasTagName(useTag));
return static_cast<SVGUseElement*>(shadowTreeParentElement)->instanceForShadowTreeElement(referenceNode);
}
#endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes