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. git-svn-id: http://svn.webkit.org/repository/webkit/trunk/LayoutTests@130004 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/ChangeLog b/ChangeLog index 9196826..0cb034b 100644 --- a/ChangeLog +++ b/ChangeLog
@@ -1,3 +1,13 @@ +2012-09-30 Keishi Hattori <keishi@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-30 Sergey Glazunov <serg.glazunov@gmail.com> Trivial test fix after r127534.
diff --git a/inspector/elements/shadow-dom-modify-chardata-expected.txt b/inspector/elements/shadow-dom-modify-chardata-expected.txt new file mode 100644 index 0000000..080fdd3 --- /dev/null +++ b/inspector/elements/shadow-dom-modify-chardata-expected.txt
@@ -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> +
diff --git a/inspector/elements/shadow-dom-modify-chardata.html b/inspector/elements/shadow-dom-modify-chardata.html new file mode 100644 index 0000000..e7cc858 --- /dev/null +++ b/inspector/elements/shadow-dom-modify-chardata.html
@@ -0,0 +1,65 @@ +<html> +<head> +<script src="../../http/tests/inspector/inspector-test.js"></script> +<script src="../../http/tests/inspector/elements-test.js"></script> +<script> + +function typeText() +{ + var input = document.getElementById("input1"); + input.focus(); + eventSender.keyDown("B"); + eventSender.keyDown("a"); + eventSender.keyDown("r"); +} + +function test() +{ + var containerNode; + + WebInspector.experimentsSettings.showShadowDOM = {}; + WebInspector.experimentsSettings.showShadowDOM.isEnabled = function() { return 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>