DevTools: fix rule insertion with file URLs.

This patch allows accessing rules for inspector style sheets.
Our tests didn't catch the regression since we run with
--allow-file-access-from-files flag.

TBR=lushnikov@chromium.org

(cherry picked from commit 8a4ccd6b71037a1452a2cb2466029e1cb17eed48)

Bug: 814937
Change-Id: I58eabb8e299a81c5a912d5a42175ab78ad904704
Reviewed-on: https://chromium-review.googlesource.com/935749
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#539166}
Reviewed-on: https://chromium-review.googlesource.com/939763
Cr-Commit-Position: refs/branch-heads/3325@{#607}
Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369}
diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
index 4fe05c8..65a9b71 100644
--- a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
+++ b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
@@ -256,6 +256,8 @@
   Document* document = OwnerDocument();
   if (!document)
     return true;
+  if (document->GetStyleEngine().InspectorStyleSheet() == this)
+    return true;
   if (document->GetSecurityOrigin()->CanRequestNoSuborigin(base_url))
     return true;
   if (allow_rule_access_from_origin_ &&