summaryrefslogtreecommitdiff
path: root/chromium/third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp')
-rw-r--r--chromium/third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/chromium/third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp b/chromium/third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp
index 4542e506be9..a135845e036 100644
--- a/chromium/third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp
+++ b/chromium/third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp
@@ -28,6 +28,7 @@
#include "core/svg/SVGElement.h"
#include "core/svg/SVGSVGElement.h"
#include "core/svg/animation/SMILTimeContainer.h"
+#include "wtf/TemporaryChange.h"
#include "wtf/text/AtomicString.h"
namespace WebCore {
@@ -35,6 +36,9 @@ namespace WebCore {
SVGDocumentExtensions::SVGDocumentExtensions(Document* document)
: m_document(document)
, m_resourcesCache(adoptPtr(new SVGResourcesCache))
+#if !ASSERT_DISABLED
+ , m_inRelativeLengthSVGRootsInvalidation(false)
+#endif
{
}
@@ -367,6 +371,35 @@ void SVGDocumentExtensions::removeAllElementReferencesForTarget(SVGElement* refe
m_elementDependencies.remove(it);
}
+void SVGDocumentExtensions::addSVGRootWithRelativeLengthDescendents(SVGSVGElement* svgRoot)
+{
+ ASSERT(!m_inRelativeLengthSVGRootsInvalidation);
+ m_relativeLengthSVGRoots.add(svgRoot);
+}
+
+void SVGDocumentExtensions::removeSVGRootWithRelativeLengthDescendents(SVGSVGElement* svgRoot)
+{
+ ASSERT(!m_inRelativeLengthSVGRootsInvalidation);
+ m_relativeLengthSVGRoots.remove(svgRoot);
+}
+
+bool SVGDocumentExtensions::isSVGRootWithRelativeLengthDescendents(SVGSVGElement* svgRoot) const
+{
+ return m_relativeLengthSVGRoots.contains(svgRoot);
+}
+
+void SVGDocumentExtensions::invalidateSVGRootsWithRelativeLengthDescendents(SubtreeLayoutScope* scope)
+{
+ ASSERT(!m_inRelativeLengthSVGRootsInvalidation);
+#if !ASSERT_DISABLED
+ TemporaryChange<bool> inRelativeLengthSVGRootsChange(m_inRelativeLengthSVGRootsInvalidation, true);
+#endif
+
+ HashSet<SVGSVGElement*>::iterator end = m_relativeLengthSVGRoots.end();
+ for (HashSet<SVGSVGElement*>::iterator it = m_relativeLengthSVGRoots.begin(); it != end; ++it)
+ (*it)->invalidateRelativeLengthClients(scope);
+}
+
#if ENABLE(SVG_FONTS)
void SVGDocumentExtensions::registerSVGFontFaceElement(SVGFontFaceElement* element)
{