Title: [125014] trunk
Revision
125014
Author
pfeld...@chromium.org
Date
2012-08-08 03:16:00 -0700 (Wed, 08 Aug 2012)

Log Message

Source/WebCore: Web Inspector: show whitespace nodes if they are the only tag's children.
https://bugs.webkit.org/show_bug.cgi?id=93441

Reviewed by Vsevolod Vlasov.

Pass whitespace node info into the front-end when it is the only element's child.

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildArrayForContainerChildren):

LayoutTests: Web Inspector: show white space nodes if they are the only tag's children.
https://bugs.webkit.org/show_bug.cgi?id=93441

Reviewed by Vsevolod Vlasov.

* inspector/elements/set-outer-html-2-expected.txt:
* inspector/styles/styles-update-from-js.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (125013 => 125014)


--- trunk/LayoutTests/ChangeLog	2012-08-08 09:50:54 UTC (rev 125013)
+++ trunk/LayoutTests/ChangeLog	2012-08-08 10:16:00 UTC (rev 125014)
@@ -1,3 +1,13 @@
+2012-08-08  Pavel Feldman  <pfeld...@chromium.org>
+
+        Web Inspector: show white space nodes if they are the only tag's children.
+        https://bugs.webkit.org/show_bug.cgi?id=93441
+
+        Reviewed by Vsevolod Vlasov.
+
+        * inspector/elements/set-outer-html-2-expected.txt:
+        * inspector/styles/styles-update-from-js.html:
+
 2012-08-08  Yury Semikhatsky  <yu...@chromium.org>
 
         Web Inspector: cached images memory instrumentation regression after r124744

Modified: trunk/LayoutTests/inspector/elements/set-outer-html-2-expected.txt (125013 => 125014)


--- trunk/LayoutTests/inspector/elements/set-outer-html-2-expected.txt	2012-08-08 09:50:54 UTC (rev 125013)
+++ trunk/LayoutTests/inspector/elements/set-outer-html-2-expected.txt	2012-08-08 10:16:00 UTC (rev 125014)
@@ -29,7 +29,8 @@
 Wrapper identity: identity
 Event AttrRemoved: H2
 Event AttrRemoved: H2
-Event ChildNodeCountUpdated: UL
+Event CharacterDataModified: 
+Event NodeInserted: LI
 ==========8<==========
 <div id="container" style="display:none">
 <p>WebKit is used by <a href="" Dashboard, etc..</p>

Modified: trunk/LayoutTests/inspector/styles/styles-update-from-js.html (125013 => 125014)


--- trunk/LayoutTests/inspector/styles/styles-update-from-js.html	2012-08-08 09:50:54 UTC (rev 125013)
+++ trunk/LayoutTests/inspector/styles/styles-update-from-js.html	2012-08-08 10:16:00 UTC (rev 125014)
@@ -87,8 +87,7 @@
 Tests that changes to an inline style from _javascript_ are reflected in the Styles pane and Elements tree.
 </p>
 
-<div id="container" style="font-weight:bold">
-</div>
+<div id="container" style="font-weight:bold"></div>
 
 </body>
 </html>

Modified: trunk/Source/WebCore/ChangeLog (125013 => 125014)


--- trunk/Source/WebCore/ChangeLog	2012-08-08 09:50:54 UTC (rev 125013)
+++ trunk/Source/WebCore/ChangeLog	2012-08-08 10:16:00 UTC (rev 125014)
@@ -1,3 +1,15 @@
+2012-08-08  Pavel Feldman  <pfeld...@chromium.org>
+
+        Web Inspector: show whitespace nodes if they are the only tag's children.
+        https://bugs.webkit.org/show_bug.cgi?id=93441
+
+        Reviewed by Vsevolod Vlasov.
+
+        Pass whitespace node info into the front-end when it is the only element's child.
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::buildArrayForContainerChildren):
+
 2012-08-08  Kentaro Hara  <hara...@chromium.org>
 
         [V8] Pass Isolate to ArrayValue and Dictionary

Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (125013 => 125014)


--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2012-08-08 09:50:54 UTC (rev 125013)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2012-08-08 10:16:00 UTC (rev 125014)
@@ -1280,15 +1280,17 @@
 PassRefPtr<TypeBuilder::Array<TypeBuilder::DOM::Node> > InspectorDOMAgent::buildArrayForContainerChildren(Node* container, int depth, NodeToIdMap* nodesMap)
 {
     RefPtr<TypeBuilder::Array<TypeBuilder::DOM::Node> > children = TypeBuilder::Array<TypeBuilder::DOM::Node>::create();
-    Node* child = innerFirstChild(container);
-
     if (depth == 0) {
         // Special-case the only text child - pretend that container's children have been requested.
-        if (child && child->nodeType() == Node::TEXT_NODE && !innerNextSibling(child))
-            return buildArrayForContainerChildren(container, 1, nodesMap);
+        Node* firstChild = container->firstChild();
+        if (firstChild && firstChild->nodeType() == Node::TEXT_NODE && !firstChild->nextSibling()) {
+            children->addItem(buildObjectForNode(firstChild, 0, nodesMap));
+            m_childrenRequested.add(bind(container, nodesMap));
+        }
         return children.release();
     }
 
+    Node* child = innerFirstChild(container);
     depth--;
     m_childrenRequested.add(bind(container, nodesMap));
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to