Index: third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp |
diff --git a/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp b/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp |
index 41c6734a7099b55b7b0fa70c881f565f1c1576a5..76bbe0d759b68a2fc92cd0c4b7ace7b3e7c4ce7d 100644 |
--- a/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp |
+++ b/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp |
@@ -981,7 +981,9 @@ InspectorStyleSheet::InspectorStyleSheet(InspectorNetworkAgent* networkAgent, CS |
, m_documentURL(documentURL) |
{ |
String text; |
- bool success = inlineStyleSheetText(&text); |
+ bool success = inspectorStyleSheetText(&text); |
+ if (!success) |
+ success = inlineStyleSheetText(&text); |
if (!success) |
success = resourceStyleSheetText(&text); |
if (success) |
@@ -1353,6 +1355,8 @@ void InspectorStyleSheet::innerSetText(const String& text, bool markAsLocallyMod |
Element* element = ownerStyleElement(); |
if (element) |
m_resourceContainer->storeStyleElementContent(DOMNodeIds::idForNode(element), text); |
+ else if (m_origin == protocol::CSS::StyleSheetOriginEnum::Inspector) |
+ m_resourceContainer->storeStyleElementContent(DOMNodeIds::idForNode(m_pageStyleSheet->ownerDocument()), text); |
else |
m_resourceContainer->storeStyleSheetContent(finalURL(), text); |
} |
@@ -1748,6 +1752,18 @@ bool InspectorStyleSheet::inlineStyleSheetText(String* result) |
return true; |
} |
+bool InspectorStyleSheet::inspectorStyleSheetText(String* result) |
+{ |
+ if (m_origin != protocol::CSS::StyleSheetOriginEnum::Inspector) |
+ return false; |
+ if (!m_pageStyleSheet->ownerDocument()) |
+ return false; |
+ if (m_resourceContainer->loadStyleElementContent(DOMNodeIds::idForNode(m_pageStyleSheet->ownerDocument()), result)) |
+ return true; |
+ *result = ""; |
+ return true; |
+} |
+ |
InspectorStyleSheetForInlineStyle* InspectorStyleSheetForInlineStyle::create(Element* element, Listener* listener) |
{ |
return new InspectorStyleSheetForInlineStyle(element, listener); |