Index: Source/core/testing/Internals.cpp |
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp |
index c10066422bad56026b9e95e32f9c05d96b0742e7..b1c6a504c7137ef91641debb548f692567219c8c 100644 |
--- a/Source/core/testing/Internals.cpp |
+++ b/Source/core/testing/Internals.cpp |
@@ -1542,11 +1542,17 @@ void Internals::toggleOverwriteModeEnabled(Document* document, ExceptionState&) |
unsigned Internals::numberOfLiveNodes() const |
{ |
+ if (StyleResolver* resolver = contextDocument()->styleResolverIfExists()) |
+ resolver->clearStyleSharingList(); |
+ |
return InspectorCounters::counterValue(InspectorCounters::NodeCounter); |
} |
unsigned Internals::numberOfLiveDocuments() const |
{ |
+ if (StyleResolver* resolver = contextDocument()->styleResolverIfExists()) |
+ resolver->clearStyleSharingList(); |
+ |
return InspectorCounters::counterValue(InspectorCounters::DocumentCounter); |
} |
@@ -1813,6 +1819,11 @@ void Internals::garbageCollectDocumentResources(Document* document, ExceptionSta |
return; |
} |
+ if (StyleResolver* resolver = contextDocument()->styleResolverIfExists()) |
+ resolver->clearStyleSharingList(); |
+ if (StyleResolver* resolver = document->styleResolverIfExists()) |
+ resolver->clearStyleSharingList(); |
+ |
ResourceFetcher* fetcher = document->fetcher(); |
if (!fetcher) |
return; |