diff options
Diffstat (limited to 'WebCore/svg/SVGElementInstance.cpp')
-rw-r--r-- | WebCore/svg/SVGElementInstance.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/WebCore/svg/SVGElementInstance.cpp b/WebCore/svg/SVGElementInstance.cpp index ca0a70c..cd9b966 100644 --- a/WebCore/svg/SVGElementInstance.cpp +++ b/WebCore/svg/SVGElementInstance.cpp @@ -89,7 +89,7 @@ void SVGElementInstance::appendChild(PassRefPtr<SVGElementInstance> child) void SVGElementInstance::invalidateAllInstancesOfElement(SVGElement* element) { - if (!element) + if (!element || !element->inDocument()) return; if (element->isStyled() && static_cast<SVGStyledElement*>(element)->instanceUpdatesBlocked()) @@ -105,6 +105,9 @@ void SVGElementInstance::invalidateAllInstancesOfElement(SVGElement* element) ASSERT((*it)->correspondingElement() == element); (*it)->correspondingUseElement()->invalidateShadowTree(); } + + // Be sure to rebuild use trees, if needed + element->document()->updateLayoutIgnorePendingStylesheets(); } ScriptExecutionContext* SVGElementInstance::scriptExecutionContext() const @@ -144,15 +147,18 @@ bool SVGElementInstance::dispatchEvent(PassRefPtr<Event> prpEvent) EventTargetData* SVGElementInstance::eventTargetData() { - return m_element->eventTargetData(); + // EventTarget would use these methods if we were actually using its add/removeEventListener logic. + // As we're forwarding those calls to the correspondingElement(), no one should ever call this function. + ASSERT_NOT_REACHED(); + return 0; } EventTargetData* SVGElementInstance::ensureEventTargetData() { - // Avoid crashing - return a default dummy value - DEFINE_STATIC_LOCAL(EventTargetData, dummyEventTargetData, ()); - dummyEventTargetData.eventListenerMap.clear(); - return &dummyEventTargetData; + // EventTarget would use these methods if we were actually using its add/removeEventListener logic. + // As we're forwarding those calls to the correspondingElement(), no one should ever call this function. + ASSERT_NOT_REACHED(); + return 0; } } |