⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 118879 in webkit


Ignore:
Timestamp:
May 29, 2012, 6:57:59 PM (14 years ago)
Author:
cevans@google.com
Message:

Merge 117957
BUG=128342
Review URL: https://chromiumcodereview.appspot.com/10446075

Location:
branches/chromium/1132/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/chromium/1132/Source/WebCore/dom/EventDispatcher.cpp

    r110314 r118879  
    6767    // as a deeply cloned child of the 'use' element, except that events are dispatched to the SVGElementInstance objects
    6868    Element* shadowHostElement = referenceNode->treeScope()->rootNode()->shadowHost();
    69     // At this time, SVG nodes are not allowed in non-<use> shadow trees, so any shadow root we do
    70     // have should be a use. The assert and following test is here to catch future shadow DOM changes
    71     // that do enable SVG in a shadow tree.
    72     ASSERT(!shadowHostElement || shadowHostElement->hasTagName(SVGNames::useTag));
    73     if (shadowHostElement && shadowHostElement->hasTagName(SVGNames::useTag)) {
    74         SVGUseElement* useElement = static_cast<SVGUseElement*>(shadowHostElement);
    75 
    76         if (SVGElementInstance* instance = useElement->instanceForShadowTreeElement(referenceNode))
    77             return instance;
    78     }
     69    // At this time, SVG nodes are not supported in non-<use> shadow trees.
     70    if (!shadowHostElement || !shadowHostElement->hasTagName(SVGNames::useTag))
     71        return referenceNode;
     72    SVGUseElement* useElement = static_cast<SVGUseElement*>(shadowHostElement);
     73    if (SVGElementInstance* instance = useElement->instanceForShadowTreeElement(referenceNode))
     74        return instance;
    7975#endif
    8076
  • branches/chromium/1132/Source/WebCore/page/EventHandler.cpp

    r115877 r118879  
    20972097
    20982098    Element* shadowTreeParentElement = shadowTreeElement->shadowHost();
    2099     if (!shadowTreeParentElement)
     2099    if (!shadowTreeParentElement || !shadowTreeParentElement->hasTagName(useTag))
    21002100        return 0;
    21012101
    2102     ASSERT(shadowTreeParentElement->hasTagName(useTag));
    21032102    return static_cast<SVGUseElement*>(shadowTreeParentElement)->instanceForShadowTreeElement(referenceNode);
    21042103}
Note: See TracChangeset for help on using the changeset viewer.