Changeset 55532 in webkit
- Timestamp:
- Mar 4, 2010 10:17:26 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r55527 r55532 1 2010-03-04 Antoine Quint <ml@graougraou.com> 2 3 Reviewed by Darin Adler. 4 5 DOM insertion mutation events should dispatch after a node is attached to the render tree 6 https://bugs.webkit.org/show_bug.cgi?id=35590 7 8 * fast/events/domnodeinsertedintodocument-dispatched-post-rendering-expected.txt: Added. 9 * fast/events/domnodeinsertedintodocument-dispatched-post-rendering.html: Added. 10 1 11 2010-03-04 Csaba Osztrogonác <ossy@webkit.org> 2 12 -
trunk/WebCore/ChangeLog
r55531 r55532 1 2010-03-04 Antoine Quint <ml@graougraou.com> 2 3 Reviewed by Darin Adler. 4 5 DOM insertion mutation events should dispatch after a node is attached to the render tree 6 https://bugs.webkit.org/show_bug.cgi?id=35590 7 8 Test: fast/events/domnodeinsertedintodocument-dispatched-post-rendering.html 9 10 Split off the internal-to-WebCore node insertion notification code from the DOM mutation 11 event dispatching, originally in dispatchChildInsertionEvents(), to a new static function 12 called notifyChildInserted(). This allows us to dispatch the mutation events at a later 13 time upon insertion of a child into to the tree, specifically _after_ attachment to the render 14 tree. 15 16 * dom/ContainerNode.cpp: 17 (WebCore::ContainerNode::insertBefore): 18 (WebCore::ContainerNode::replaceChild): 19 (WebCore::ContainerNode::appendChild): 20 (WebCore::notifyChildInserted): 21 (WebCore::dispatchChildInsertionEvents): 22 1 23 2010-03-04 Fridrich Strba <fridrich.strba@bluewin.ch> 2 24 -
trunk/WebCore/dom/ContainerNode.cpp
r55465 r55532 44 44 namespace WebCore { 45 45 46 static void notifyChildInserted(Node*); 46 47 static void dispatchChildInsertionEvents(Node*); 47 48 static void dispatchChildRemovalEvents(Node*); … … 145 146 allowEventDispatch(); 146 147 147 // Dispatch the mutation events.148 // Send notification about the children change. 148 149 childrenChanged(false, refChildPreviousSibling.get(), next.get(), 1); 149 dispatchChildInsertionEvents(child.get());150 notifyChildInserted(child.get()); 150 151 151 152 // Add child to the rendering tree. … … 156 157 child->attach(); 157 158 } 159 160 // Now that the child is attached to the render tree, dispatch 161 // the relevant mutation events. 162 dispatchChildInsertionEvents(child.get()); 158 163 159 164 child = nextChild.release(); … … 257 262 allowEventDispatch(); 258 263 259 // Dispatch the mutation events 260 dispatchChildInsertionEvents(child.get()); 264 notifyChildInserted(child.get()); 261 265 262 266 // Add child to the rendering tree … … 267 271 child->attach(); 268 272 } 273 274 // Now that the child is attached to the render tree, dispatch 275 // the relevant mutation events. 276 dispatchChildInsertionEvents(child.get()); 269 277 270 278 prev = child; … … 491 499 allowEventDispatch(); 492 500 493 // Dispatch the mutation events501 // Send notification about the children change. 494 502 childrenChanged(false, prev.get(), 0, 1); 495 dispatchChildInsertionEvents(child.get());503 notifyChildInserted(child.get()); 496 504 497 505 // Add child to the rendering tree … … 502 510 child->attach(); 503 511 } 512 513 // Now that the child is attached to the render tree, dispatch 514 // the relevant mutation events. 515 dispatchChildInsertionEvents(child.get()); 504 516 505 517 child = nextChild.release(); … … 877 889 } 878 890 879 static void dispatchChildInsertionEvents(Node* child)891 static void notifyChildInserted(Node* child) 880 892 { 881 893 ASSERT(!eventDispatchForbidden()); … … 897 909 898 910 document->incDOMTreeVersion(); 911 } 912 913 static void dispatchChildInsertionEvents(Node* child) 914 { 915 ASSERT(!eventDispatchForbidden()); 916 917 RefPtr<Node> c = child; 918 RefPtr<Document> document = child->document(); 899 919 900 920 if (c->parentNode() && document->hasListenerType(Document::DOMNODEINSERTED_LISTENER))
Note: See TracChangeset
for help on using the changeset viewer.