Index: Source/core/inspector/InspectorCSSAgent.cpp |
diff --git a/Source/core/inspector/InspectorCSSAgent.cpp b/Source/core/inspector/InspectorCSSAgent.cpp |
index ecd0faa6c6e14023ed3c080013825f837c4c00f9..40580c330d7e7f76ee925fffa17ea19d053566b4 100644 |
--- a/Source/core/inspector/InspectorCSSAgent.cpp |
+++ b/Source/core/inspector/InspectorCSSAgent.cpp |
@@ -956,6 +956,7 @@ void InspectorCSSAgent::getMatchedStylesForNode(ErrorString* errorString, int no |
// Matched rules. |
StyleResolver* styleResolver = ownerDocument->styleResolver(); |
+ appendPendingStyleSheetsIfNeeded(styleResolver); |
// FIXME: This code should not pass DoNotIncludeStyleSheetInCSSOMWrapper. All CSSOMWrappers should always have a parent sheet or rule. |
RefPtr<CSSRuleList> matchedRules = styleResolver->pseudoCSSRulesForElement(element, elementPseudoId, StyleResolver::AllCSSRules, DoNotIncludeStyleSheetInCSSOMWrapper); |
matchedCSSRules = buildArrayForMatchedRuleList(matchedRules.get(), styleResolver, originalElement); |
@@ -982,6 +983,7 @@ void InspectorCSSAgent::getMatchedStylesForNode(ErrorString* errorString, int no |
Element* parentElement = element->parentElement(); |
while (parentElement) { |
StyleResolver* parentStyleResolver = parentElement->ownerDocument()->styleResolver(); |
+ appendPendingStyleSheetsIfNeeded(parentStyleResolver); |
RefPtr<CSSRuleList> parentMatchedRules = parentStyleResolver->cssRulesForElement(parentElement, StyleResolver::AllCSSRules, DoNotIncludeStyleSheetInCSSOMWrapper); |
RefPtr<TypeBuilder::CSS::InheritedStyleEntry> entry = TypeBuilder::CSS::InheritedStyleEntry::create() |
.setMatchedCSSRules(buildArrayForMatchedRuleList(parentMatchedRules.get(), styleResolver, parentElement)); |
@@ -1107,6 +1109,7 @@ void InspectorCSSAgent::getStyleSheet(ErrorString* errorString, const String& st |
Document* doc = inspectorStyleSheet->pageStyleSheet() ? inspectorStyleSheet->pageStyleSheet()->ownerDocument() : 0; |
if (!doc || !doc->styleResolver()) |
return; |
+ appendPendingStyleSheetsIfNeeded(doc->styleResolver()); |
RefPtr<TypeBuilder::CSS::CSSStyleSheetBody> result = TypeBuilder::CSS::CSSStyleSheetBody::create() |
.setStyleSheetId(styleSheetId) |