Changeset 158708 in webkit
- Timestamp:
- Nov 5, 2013 6:15:50 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r158703 r158708 1 2013-11-05 Alexandru Chiculita <achicu@adobe.com> 2 3 Web Inspector: Moving an element while in the DOMNodeRemoved handler will hide it in the inspector 4 https://bugs.webkit.org/show_bug.cgi?id=123516 5 6 Reviewed by Timothy Hatcher. 7 8 Added tests to check that the DOM.childNodeRemoved inspector-protocol message is dispatched 9 correctly when DOM nodes are moved while inside the "DOMNodeRemoved" event handler. 10 11 * inspector-protocol/dom-debugger/node-removed-expected.txt: Added. 12 * inspector-protocol/dom-debugger/node-removed.html: Added. Checking that the DOMDebugger agent 13 is still sending the node-removed events. 14 * inspector-protocol/dom/dom-remove-events-expected.txt: Added. 15 * inspector-protocol/dom/dom-remove-events.html: Added. Test with a single DOM remove event. 16 * inspector-protocol/dom/remove-multiple-nodes-expected.txt: Added. 17 * inspector-protocol/dom/remove-multiple-nodes.html: Added. Test case when multiple children 18 are removed at once with parentNode.textContent = "String". 19 1 20 2013-11-05 Myles C. Maxfield <mmaxfield@apple.com> 2 21 -
trunk/Source/WebCore/ChangeLog
r158705 r158708 1 2013-11-05 Alexandru Chiculita <achicu@adobe.com> 2 3 Web Inspector: Moving an element while in the DOMNodeRemoved handler will hide it in the inspector 4 https://bugs.webkit.org/show_bug.cgi?id=123516 5 6 Reviewed by Timothy Hatcher. 7 8 InspectorInstrumentation::willRemoveDOMNode was actually calling both willRemoveDOMNodeImpl and 9 didRemoveDOMNodeImpl, making the DOMAgent unbind the element even if it was still part of the DOM. 10 11 Because of that the DOMAgent was sending two events: 12 1. When the element was about to be removed, just before JS "DOMNodeRemoved" was triggered. 13 2. When the element was actually removed. 14 15 Note that inspector's event #2 will not know about the node, as it just removed it from the 16 internal hashmap, so it will just use a nodeID == 0 for it. 17 18 This patch adds a separate call to InspectorInstrumentation::didRemoveDOMNode, just before the 19 element is about to be removed. The InspectorInstrumentation::willRemoveDOMNode call is now only used 20 by the DOMDebugger to trigger the DOM breakpoints in the Web Inspector. That feature is not exposed 21 in the new Inspector UI, but can be used/tested using the protocol directly. 22 23 Tests: inspector-protocol/dom-debugger/node-removed.html 24 inspector-protocol/dom/dom-remove-events.html 25 inspector-protocol/dom/remove-multiple-nodes.html 26 27 * dom/ContainerNode.cpp: 28 (WebCore::ContainerNode::removeBetween): 29 * inspector/InspectorInstrumentation.h: 30 (WebCore::InspectorInstrumentation::willRemoveDOMNode): 31 (WebCore::InspectorInstrumentation::didRemoveDOMNode): 32 1 33 2013-11-05 Ryuan Choi <ryuan.choi@samsung.com> 2 34 -
trunk/Source/WebCore/dom/ContainerNode.cpp
r158663 r158708 586 586 void ContainerNode::removeBetween(Node* previousChild, Node* nextChild, Node& oldChild) 587 587 { 588 InspectorInstrumentation::didRemoveDOMNode(&oldChild.document(), &oldChild); 589 588 590 NoEventDispatchAssertion assertNoEventDispatch; 589 591 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r158432 r158708 120 120 static void didInsertDOMNode(Document*, Node*); 121 121 static void willRemoveDOMNode(Document*, Node*); 122 static void didRemoveDOMNode(Document*, Node*); 122 123 static void willModifyDOMAttr(Document*, Element*, const AtomicString& oldValue, const AtomicString& newValue); 123 124 static void didModifyDOMAttr(Document*, Element*, const AtomicString& name, const AtomicString& value); … … 566 567 #if ENABLE(INSPECTOR) 567 568 FAST_RETURN_IF_NO_FRONTENDS(void()); 568 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document)) {569 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document)) 569 570 willRemoveDOMNodeImpl(instrumentingAgents, node); 571 #else 572 UNUSED_PARAM(document); 573 UNUSED_PARAM(node); 574 #endif 575 } 576 577 inline void InspectorInstrumentation::didRemoveDOMNode(Document* document, Node* node) 578 { 579 #if ENABLE(INSPECTOR) 580 FAST_RETURN_IF_NO_FRONTENDS(void()); 581 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document)) 570 582 didRemoveDOMNodeImpl(instrumentingAgents, node); 571 }572 583 #else 573 584 UNUSED_PARAM(document);
Note: See TracChangeset
for help on using the changeset viewer.