Index: Source/core/inspector/InspectorCSSAgent.cpp |
diff --git a/Source/core/inspector/InspectorCSSAgent.cpp b/Source/core/inspector/InspectorCSSAgent.cpp |
index f5dd6ead73db3e393171eade475d11397311adf4..095abc6bce29a4e8aafb3f4a83fca38c857ef2cc 100644 |
--- a/Source/core/inspector/InspectorCSSAgent.cpp |
+++ b/Source/core/inspector/InspectorCSSAgent.cpp |
@@ -736,11 +736,11 @@ void InspectorCSSAgent::regionLayoutUpdated(NamedFlow* namedFlow, int documentNo |
m_frontend->regionLayoutUpdated(buildObjectForNamedFlow(&errorString, namedFlow, documentNodeId)); |
} |
-void InspectorCSSAgent::activeStyleSheetsUpdated(const Vector<RefPtr<StyleSheet> >& newSheets) |
+void InspectorCSSAgent::activeStyleSheetsUpdated(Document* document, const Vector<RefPtr<StyleSheet> >& newSheets) |
{ |
HashSet<CSSStyleSheet*> removedSheets; |
for (CSSStyleSheetToInspectorStyleSheet::iterator it = m_cssStyleSheetToInspectorStyleSheet.begin(); it != m_cssStyleSheetToInspectorStyleSheet.end(); ++it) { |
- if (it->value->canBind()) |
+ if (it->value->canBind() && (!it->key->ownerDocument() || it->key->ownerDocument() == document)) |
removedSheets.add(it->key); |
} |
@@ -782,6 +782,15 @@ void InspectorCSSAgent::activeStyleSheetsUpdated(const Vector<RefPtr<StyleSheet> |
} |
} |
+void InspectorCSSAgent::frameDetachedFromParent(Frame* frame) |
+{ |
+ Document* document = frame->document(); |
+ if (!document) |
+ return; |
+ Vector<RefPtr<StyleSheet> > newSheets; |
+ activeStyleSheetsUpdated(document, newSheets); |
+} |
+ |
bool InspectorCSSAgent::forcePseudoState(Element* element, CSSSelector::PseudoType pseudoType) |
{ |
if (m_nodeIdToForcedPseudoState.isEmpty()) |