@@ -134,8 +134,6 @@ PassRefPtr<Node> ContainerNode::insertBefore(PassRefPtr<Node> newChild, Node* re
134
134
if (targets.isEmpty ())
135
135
return newChild;
136
136
137
- // Must check this again beacuse focus events might run synchronously when
138
- // removing children.
139
137
checkAcceptChildHierarchy (*newChild, 0 , exceptionState);
140
138
if (exceptionState.had_exception ())
141
139
return nullptr ;
@@ -252,8 +250,6 @@ PassRefPtr<Node> ContainerNode::replaceChild(PassRefPtr<Node> newChild, PassRefP
252
250
if (exceptionState.had_exception ())
253
251
return nullptr ;
254
252
255
- // Must check this again beacuse focus events might run synchronously when
256
- // removing children.
257
253
checkAcceptChildHierarchy (*newChild, child.get (),exceptionState);
258
254
if (exceptionState.had_exception ())
259
255
return nullptr ;
@@ -384,10 +380,6 @@ PassRefPtr<Node> ContainerNode::removeChild(PassRefPtr<Node> oldChild, Exception
384
380
RefPtr<Node> protect (this );
385
381
RefPtr<Node> child = oldChild;
386
382
387
- document ().removeFocusedElementOfSubtree (child.get ());
388
-
389
- // Events fired when blurring currently focused node might have moved this
390
- // child into a different parent.
391
383
if (child->parentNode () != this ) {
392
384
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?" );
393
385
return nullptr ;
@@ -450,12 +442,6 @@ void ContainerNode::removeChildren()
450
442
willRemoveChildren ();
451
443
452
444
{
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
-
459
445
// Removing a node from a selection can cause widget updates.
460
446
document ().nodeChildrenWillBeRemoved (*this );
461
447
}
@@ -512,8 +498,6 @@ PassRefPtr<Node> ContainerNode::appendChild(PassRefPtr<Node> newChild, Exception
512
498
if (targets.isEmpty ())
513
499
return newChild;
514
500
515
- // Must check this again beacuse focus events might run synchronously when
516
- // removing children.
517
501
checkAcceptChildHierarchy (*newChild, 0 , exceptionState);
518
502
if (exceptionState.had_exception ())
519
503
return nullptr ;
@@ -771,36 +755,6 @@ LayoutRect ContainerNode::boundingBox() const
771
755
return enclosingLayoutRect (FloatRect (upperLeft, lowerRight.expandedTo (upperLeft) - upperLeft));
772
756
}
773
757
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
-
804
758
void ContainerNode::setActive (bool down)
805
759
{
806
760
if (down == active ())
0 commit comments