DescriptionCall insertedInto or removedFrom before childrenChanged
To avoid needing put all the children into a NodeVector
inside removeChildren() we can reverse the order of childrenChanged
and the associated child notifications (insertedInto/removedFrom).
This seems fine, it means that a parent now is not told it has new
children until they've already been told they're in the tree.
Inversely it does mean that when a child is told it's in the tree
the parent doesn't know it has new children yet, but that's less
crazy since it doesn't result in things like children without
inDocument() bits being set existing inside ::childrenChanged.
For removal I swapped the calls to notifyNodeRemoved with
the calls to childrenChanged.
For insertion I moved the call to childrenChanged into the
notifyNodeInserted function. This is necessary since it can
run script and we need to call childrenChanged before running
the script.
I also added some more RefPtr<Node> protect(this) guards
to methods which can runs script and more ScriptForbiddenScopes
to parts of the code that now can't run script.
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175732
Patch Set 1 #Patch Set 2 : Do it for real #Patch Set 3 : Pass right flags, don't notify on ShadowRoot #
Total comments: 3
Patch Set 4 : enum { OjanReview } #
Total comments: 2
Messages
Total messages: 7 (0 generated)
|