Title: [111695] trunk
Revision
111695
Author
apav...@chromium.org
Date
2012-03-22 07:53:28 -0700 (Thu, 22 Mar 2012)

Log Message

Web Inspector: Case of the elements of the xml document should be shown as it is in the console
https://bugs.webkit.org/show_bug.cgi?id=81902

Source/WebCore:

When registering a detached root, DOMAgent always presumes it is a node,
while it can also be a document.

Reviewed by Vsevolod Vlasov.

Test: inspector/console/console-xml-document.html

* inspector/front-end/ConsoleMessage.js:
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsNode):
* inspector/front-end/DOMAgent.js:
(WebInspector.DOMAgent.prototype._setDetachedRoot):

LayoutTests:

Reviewed by Vsevolod Vlasov.

* inspector/console/console-xml-document-expected.txt: Added.
* inspector/console/console-xml-document.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (111694 => 111695)


--- trunk/LayoutTests/ChangeLog	2012-03-22 14:48:01 UTC (rev 111694)
+++ trunk/LayoutTests/ChangeLog	2012-03-22 14:53:28 UTC (rev 111695)
@@ -1,3 +1,13 @@
+2012-03-22  Alexander Pavlov  <apav...@chromium.org>
+
+        Web Inspector: Case of the elements of the xml document should be shown as it is in the console
+        https://bugs.webkit.org/show_bug.cgi?id=81902
+
+        Reviewed by Vsevolod Vlasov.
+
+        * inspector/console/console-xml-document-expected.txt: Added.
+        * inspector/console/console-xml-document.html: Added.
+
 2012-03-22  Ádám Kallai  <ka...@inf.u-szeged.hu>
 
         [Qt] Gardening. Skip failing test.

Added: trunk/LayoutTests/inspector/console/console-xml-document-expected.txt (0 => 111695)


--- trunk/LayoutTests/inspector/console/console-xml-document-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/console/console-xml-document-expected.txt	2012-03-22 14:53:28 UTC (rev 111695)
@@ -0,0 +1,5 @@
+CONSOLE MESSAGE: line 9: [object Document]
+Tests that XML document contents are logged using the correct case in the console.
+
+#document<MixedCase> Test </MixedCase> console-xml-document.html:9
+
Property changes on: trunk/LayoutTests/inspector/console/console-xml-document-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/inspector/console/console-xml-document.html (0 => 111695)


--- trunk/LayoutTests/inspector/console/console-xml-document.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/console/console-xml-document.html	2012-03-22 14:53:28 UTC (rev 111695)
@@ -0,0 +1,33 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+
+function onload()
+{
+    console.dirxml((new DOMParser()).parseFromString("<MixedCase> Test </MixedCase>", "text/xml"));
+    runTest();
+}
+
+function test()
+{
+    InspectorTest.expandConsoleMessages();
+    InspectorTest.runAfterPendingDispatches(callback);
+
+    function callback()
+    {
+        InspectorTest.dumpConsoleMessages();
+        InspectorTest.completeTest();
+    }
+}
+</script>
+</head>
+
+<body _onload_="onload()">
+<p>
+Tests that XML document contents are logged using the correct case in the console.
+</p>
+
+</body>
+</html>
Property changes on: trunk/LayoutTests/inspector/console/console-xml-document.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (111694 => 111695)


--- trunk/Source/WebCore/ChangeLog	2012-03-22 14:48:01 UTC (rev 111694)
+++ trunk/Source/WebCore/ChangeLog	2012-03-22 14:53:28 UTC (rev 111695)
@@ -1,3 +1,20 @@
+2012-03-22  Alexander Pavlov  <apav...@chromium.org>
+
+        Web Inspector: Case of the elements of the xml document should be shown as it is in the console
+        https://bugs.webkit.org/show_bug.cgi?id=81902
+
+        When registering a detached root, DOMAgent always presumes it is a node,
+        while it can also be a document.
+
+        Reviewed by Vsevolod Vlasov.
+
+        Test: inspector/console/console-xml-document.html
+
+        * inspector/front-end/ConsoleMessage.js:
+        (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsNode):
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.DOMAgent.prototype._setDetachedRoot):
+
 2012-03-22  Vsevolod Vlasov  <vse...@chromium.org>
 
         Web Inspector: Introduce ScriptBound/ScriptUnbound events in ScriptMapping.

Modified: trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js (111694 => 111695)


--- trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js	2012-03-22 14:48:01 UTC (rev 111694)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js	2012-03-22 14:53:28 UTC (rev 111695)
@@ -284,6 +284,7 @@
             if (!treeOutline.children[0].hasChildren)
                 treeOutline.element.addStyleClass("single-node");
             elem.appendChild(treeOutline.element);
+            treeOutline.element.treeElementForTest = treeOutline.children[0];
         }
         object.pushNodeToFrontend(printNode.bind(this));
     },

Modified: trunk/Source/WebCore/inspector/front-end/DOMAgent.js (111694 => 111695)


--- trunk/Source/WebCore/inspector/front-end/DOMAgent.js	2012-03-22 14:48:01 UTC (rev 111694)
+++ trunk/Source/WebCore/inspector/front-end/DOMAgent.js	2012-03-22 14:53:28 UTC (rev 111695)
@@ -907,7 +907,10 @@
      */
     _setDetachedRoot: function(payload)
     {
-        new WebInspector.DOMNode(this, null, false, payload);
+        if (payload.nodeName === "#document")
+            new WebInspector.DOMDocument(this, payload);
+        else
+            new WebInspector.DOMNode(this, null, false, payload);
     },
 
     /**
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to