@@ -134,8 +134,6 @@ PassRefPtr<Node> ContainerNode::insertBefore(PassRefPtr<Node> newChild, Node* re
134134 if (targets.isEmpty ())
135135 return newChild;
136136
137- // Must check this again beacuse focus events might run synchronously when
138- // removing children.
139137 checkAcceptChildHierarchy (*newChild, 0 , exceptionState);
140138 if (exceptionState.had_exception ())
141139 return nullptr ;
@@ -252,8 +250,6 @@ PassRefPtr<Node> ContainerNode::replaceChild(PassRefPtr<Node> newChild, PassRefP
252250 if (exceptionState.had_exception ())
253251 return nullptr ;
254252
255- // Must check this again beacuse focus events might run synchronously when
256- // removing children.
257253 checkAcceptChildHierarchy (*newChild, child.get (),exceptionState);
258254 if (exceptionState.had_exception ())
259255 return nullptr ;
@@ -384,10 +380,6 @@ PassRefPtr<Node> ContainerNode::removeChild(PassRefPtr<Node> oldChild, Exception
384380 RefPtr<Node> protect (this );
385381 RefPtr<Node> child = oldChild;
386382
387- document ().removeFocusedElementOfSubtree (child.get ());
388-
389- // Events fired when blurring currently focused node might have moved this
390- // child into a different parent.
391383 if (child->parentNode () != this ) {
392384 exceptionState.ThrowDOMException (NotFoundError, " The node to be removed is no longer a child of this node. Perhaps it was moved in a 'blur' event handler?" );
393385 return nullptr ;
@@ -450,12 +442,6 @@ void ContainerNode::removeChildren()
450442 willRemoveChildren ();
451443
452444 {
453- // Exclude this node when looking for removed focusedElement since only
454- // children will be removed.
455- // This must be later than willRemoveChildren, which might change focus
456- // state of a child.
457- document ().removeFocusedElementOfSubtree (this , true );
458-
459445 // Removing a node from a selection can cause widget updates.
460446 document ().nodeChildrenWillBeRemoved (*this );
461447 }
@@ -512,8 +498,6 @@ PassRefPtr<Node> ContainerNode::appendChild(PassRefPtr<Node> newChild, Exception
512498 if (targets.isEmpty ())
513499 return newChild;
514500
515- // Must check this again beacuse focus events might run synchronously when
516- // removing children.
517501 checkAcceptChildHierarchy (*newChild, 0 , exceptionState);
518502 if (exceptionState.had_exception ())
519503 return nullptr ;
@@ -771,36 +755,6 @@ LayoutRect ContainerNode::boundingBox() const
771755 return enclosingLayoutRect (FloatRect (upperLeft, lowerRight.expandedTo (upperLeft) - upperLeft));
772756}
773757
774- // This is used by FrameSelection to denote when the active-state of the page has changed
775- // independent of the focused element changing.
776- void ContainerNode::focusStateChanged ()
777- {
778- // If we're just changing the window's active state and the focused node has no
779- // renderer we can just ignore the state change.
780- if (!renderer ())
781- return ;
782-
783- if (styleChangeType () < SubtreeStyleChange) {
784- if (renderStyle ()->affectedByFocus ())
785- setNeedsStyleRecalc (LocalStyleChange);
786- }
787- }
788-
789- void ContainerNode::setFocus (bool received)
790- {
791- if (focused () == received)
792- return ;
793-
794- Node::setFocus (received);
795-
796- focusStateChanged ();
797-
798- if (renderer () || received)
799- return ;
800-
801- setNeedsStyleRecalc (LocalStyleChange);
802- }
803-
804758void ContainerNode::setActive (bool down)
805759{
806760 if (down == active ())
0 commit comments