Title: [110392] trunk
Revision
110392
Author
[email protected]
Date
2012-03-11 07:59:41 -0700 (Sun, 11 Mar 2012)

Log Message

Web Inspector: CSS content is not shown when stylesheet is loaded with invalid mime type in quirks mode.
https://bugs.webkit.org/show_bug.cgi?id=80528

Reviewed by Pavel Feldman.

Source/WebCore:

Test: http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content.html

* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourceContent):

LayoutTests:

* http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content-expected.txt: Added.
* http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content.html: Added.
* http/tests/inspector/resource-tree/resources/stylesheet-text-plain.php: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (110391 => 110392)


--- trunk/LayoutTests/ChangeLog	2012-03-11 13:15:48 UTC (rev 110391)
+++ trunk/LayoutTests/ChangeLog	2012-03-11 14:59:41 UTC (rev 110392)
@@ -1,3 +1,14 @@
+2012-03-11  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: CSS content is not shown when stylesheet is loaded with invalid mime type in quirks mode.
+        https://bugs.webkit.org/show_bug.cgi?id=80528
+
+        Reviewed by Pavel Feldman.
+
+        * http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content-expected.txt: Added.
+        * http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content.html: Added.
+        * http/tests/inspector/resource-tree/resources/stylesheet-text-plain.php: Added.
+
 2012-03-10  Julien Chaffraix  <[email protected]>
 
         RenderObject with 'resize' different from 'none' should have a RenderLayer

Added: trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content-expected.txt (0 => 110392)


--- trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content-expected.txt	2012-03-11 14:59:41 UTC (rev 110392)
@@ -0,0 +1,9 @@
+Tests that content is correctly shown for css loaded with invalid mime type in quirks mode.
+
+Bug 80528
+http://127.0.0.1:8000/inspector/resource-tree/resources/stylesheet-text-plain.php
+Resource.content: body {
+    background-color: green:
+}
+
+
Property changes on: trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content.html (0 => 110392)


--- trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content.html	2012-03-11 14:59:41 UTC (rev 110392)
@@ -0,0 +1,39 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<link rel="stylesheet" href="" type="text/css">
+<script>
+function test()
+{
+    var cssResource;
+
+    InspectorTest.runAfterResourcesAreFinished(["stylesheet-text-plain.php"], step1);
+
+    function step1()
+    {
+        WebInspector.resourceTreeModel.forAllResources(findCSSResource);
+        function findCSSResource(resource)
+        {
+            if (resource.url.indexOf("stylesheet-text-plain.php") !== -1)
+                cssResource = resource;
+        }
+        InspectorTest.addResult(cssResource.url);
+        InspectorTest.assertEquals(cssResource.type, WebInspector.Resource.Type.Stylesheet, "Resource type should be Stylesheet.");
+        InspectorTest.assertTrue(!cssResource.failed, "Resource loading failed.");
+        cssResource.requestContent(step2);
+    }
+
+    function step2()
+    {
+        InspectorTest.addResult("Resource.content: " + cssResource.content);
+        InspectorTest.completeTest();
+    }
+}
+</script>
+</head>
+<body _onload_="runTest()">
+<p>Tests that content is correctly shown for css loaded with invalid mime type in quirks mode.</p>
+<a href="" 80528</a>
+</body>
+</html>
Property changes on: trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content.html
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/http/tests/inspector/resource-tree/resources/stylesheet-text-plain.php (0 => 110392)


--- trunk/LayoutTests/http/tests/inspector/resource-tree/resources/stylesheet-text-plain.php	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/resource-tree/resources/stylesheet-text-plain.php	2012-03-11 14:59:41 UTC (rev 110392)
@@ -0,0 +1,6 @@
+<?php
+    header("Content-Type: text/plain");
+?>
+body {
+    background-color: green:
+}
Property changes on: trunk/LayoutTests/http/tests/inspector/resource-tree/resources/stylesheet-text-plain.php
___________________________________________________________________

Added: svn:executable

Modified: trunk/Source/WebCore/ChangeLog (110391 => 110392)


--- trunk/Source/WebCore/ChangeLog	2012-03-11 13:15:48 UTC (rev 110391)
+++ trunk/Source/WebCore/ChangeLog	2012-03-11 14:59:41 UTC (rev 110392)
@@ -1,3 +1,15 @@
+2012-03-11  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: CSS content is not shown when stylesheet is loaded with invalid mime type in quirks mode.
+        https://bugs.webkit.org/show_bug.cgi?id=80528
+
+        Reviewed by Pavel Feldman.
+
+        Test: http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content.html
+
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::cachedResourceContent):
+
 2012-03-11  Viatcheslav Ostapenko  <[email protected]>
 
         [Qt] [WK2] Support threaded renderer in WK2

Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (110391 => 110392)


--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp	2012-03-11 13:15:48 UTC (rev 110391)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp	2012-03-11 14:59:41 UTC (rev 110392)
@@ -174,7 +174,7 @@
     if (cachedResource) {
         switch (cachedResource->type()) {
         case CachedResource::CSSStyleSheet:
-            *result = static_cast<CachedCSSStyleSheet*>(cachedResource)->sheetText();
+            *result = static_cast<CachedCSSStyleSheet*>(cachedResource)->sheetText(false);
             return true;
         case CachedResource::Script:
             *result = static_cast<CachedScript*>(cachedResource)->script();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to