Title: [130139] trunk
Revision
130139
Author
kei...@webkit.org
Date
2012-10-02 01:36:49 -0700 (Tue, 02 Oct 2012)

Log Message

Web Inspector: Modifications in a shadow tree don't update the Elements panel.
https://bugs.webkit.org/show_bug.cgi?id=97056

Reviewed by Pavel Feldman.

Source/WebCore:

Send characterDataModified event for shadow dom nodes too so they update the elements panel.

Test: inspector/elements/shadow-dom-modify-chardata.html

* dom/CharacterData.cpp:
(WebCore::CharacterData::dispatchModifiedEvent):

LayoutTests:

* inspector/elements/shadow-dom-modify-chardata-expected.txt: Added.
* inspector/elements/shadow-dom-modify-chardata.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (130138 => 130139)


--- trunk/LayoutTests/ChangeLog	2012-10-02 08:28:02 UTC (rev 130138)
+++ trunk/LayoutTests/ChangeLog	2012-10-02 08:36:49 UTC (rev 130139)
@@ -1,3 +1,13 @@
+2012-10-02  Keishi Hattori  <kei...@webkit.org>
+
+        Web Inspector: Modifications in a shadow tree don't update the Elements panel.
+        https://bugs.webkit.org/show_bug.cgi?id=97056
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/elements/shadow-dom-modify-chardata-expected.txt: Added.
+        * inspector/elements/shadow-dom-modify-chardata.html: Added.
+
 2012-09-20  Vsevolod Vlasov  <vse...@chromium.org>
 
         Web Inspector: Provide a way to distinguish scripts having sourceURL from standalone scripts.

Added: trunk/LayoutTests/inspector/elements/shadow-dom-modify-chardata-expected.txt (0 => 130139)


--- trunk/LayoutTests/inspector/elements/shadow-dom-modify-chardata-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/elements/shadow-dom-modify-chardata-expected.txt	2012-10-02 08:36:49 UTC (rev 130139)
@@ -0,0 +1,22 @@
+Tests that elements panel updates shadow dom tree structure upon typing.
+
+
+
+Running: testDumpInitial
+========= Original ========
+- <div id="container">
+    - <input type="text" id="input1">
+        - #shadow-root
+          <div></div>
+      </input>
+  </div>
+
+Running: testAppend
+======== Type text =========
+- <div id="container">
+    - <input type="text" id="input1">
+        - #shadow-root
+        + <div>Bar</div>
+      </input>
+  </div>
+

Added: trunk/LayoutTests/inspector/elements/shadow-dom-modify-chardata.html (0 => 130139)


--- trunk/LayoutTests/inspector/elements/shadow-dom-modify-chardata.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/elements/shadow-dom-modify-chardata.html	2012-10-02 08:36:49 UTC (rev 130139)
@@ -0,0 +1,64 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+
+function typeText()
+{
+    var input = document.getElementById("input1");
+    input.focus();
+    eventSender.keyDown("B");
+    eventSender.keyDown("a");
+    eventSender.keyDown("r");
+}
+
+function test()
+{
+    var containerNode;
+
+    WebInspector.settings.showShadowDOM.set(true);
+
+    InspectorTest.runTestSuite([
+        function testDumpInitial(next)
+        {
+            function callback(node)
+            {
+                containerNode = InspectorTest.expandedNodeWithId("container");
+                InspectorTest.addResult("========= Original ========");
+                InspectorTest.dumpElementsTree(containerNode);
+                next();
+            }
+            InspectorTest.expandElementsTree(callback);
+        },
+
+        function testAppend(next)
+        {
+            function callback()
+            {
+                InspectorTest.evaluateInPage("typeText()", callback2);
+                
+            }
+            function callback2()
+            {
+                InspectorTest.addResult("======== Type text =========");
+                InspectorTest.dumpElementsTree(containerNode);
+                next();
+            }
+            InspectorTest.expandElementsTree(callback);
+        }
+    ]);
+}
+
+</script>
+</head>
+
+<body _onload_="runTest()">
+<p>
+Tests that elements panel updates shadow dom tree structure upon typing.
+</p>
+
+<div id="container"><input type="text" id="input1"></div>
+
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (130138 => 130139)


--- trunk/Source/WebCore/ChangeLog	2012-10-02 08:28:02 UTC (rev 130138)
+++ trunk/Source/WebCore/ChangeLog	2012-10-02 08:36:49 UTC (rev 130139)
@@ -1,3 +1,17 @@
+2012-10-02  Keishi Hattori  <kei...@webkit.org>
+
+        Web Inspector: Modifications in a shadow tree don't update the Elements panel.
+        https://bugs.webkit.org/show_bug.cgi?id=97056
+
+        Reviewed by Pavel Feldman.
+
+        Send characterDataModified event for shadow dom nodes too so they update the elements panel.
+
+        Test: inspector/elements/shadow-dom-modify-chardata.html
+
+        * dom/CharacterData.cpp:
+        (WebCore::CharacterData::dispatchModifiedEvent):
+
 2012-09-20  Vsevolod Vlasov  <vse...@chromium.org>
 
         Web Inspector: Provide a way to distinguish scripts having sourceURL from standalone scripts.

Modified: trunk/Source/WebCore/dom/CharacterData.cpp (130138 => 130139)


--- trunk/Source/WebCore/dom/CharacterData.cpp	2012-10-02 08:28:02 UTC (rev 130138)
+++ trunk/Source/WebCore/dom/CharacterData.cpp	2012-10-02 08:36:49 UTC (rev 130139)
@@ -224,10 +224,10 @@
         if (document()->hasListenerType(Document::DOMCHARACTERDATAMODIFIED_LISTENER))
             dispatchScopedEvent(MutationEvent::create(eventNames().DOMCharacterDataModifiedEvent, true, 0, oldData, m_data));
         dispatchSubtreeModifiedEvent();
+    }
 #if ENABLE(INSPECTOR)
-        InspectorInstrumentation::characterDataModified(document(), this);
+    InspectorInstrumentation::characterDataModified(document(), this);
 #endif
-    }
 }
 
 void CharacterData::checkCharDataOperation(unsigned offset, ExceptionCode& ec)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to