summaryrefslogtreecommitdiffstats
path: root/WebCore/svg/SVGElementInstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/svg/SVGElementInstance.cpp')
-rw-r--r--WebCore/svg/SVGElementInstance.cpp54
1 files changed, 30 insertions, 24 deletions
diff --git a/WebCore/svg/SVGElementInstance.cpp b/WebCore/svg/SVGElementInstance.cpp
index ca0a70c..f2812dd 100644
--- a/WebCore/svg/SVGElementInstance.cpp
+++ b/WebCore/svg/SVGElementInstance.cpp
@@ -1,22 +1,22 @@
/*
- Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
- Copyright (C) Research In Motion Limited 2010. All rights reserved.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#include "config.h"
@@ -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;
}
}