In Document::willBeRemovedFromFrame, clear FrameSelection before Editor so the select...
authorshihchieh_lee@apple.com <shihchieh_lee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 May 2020 22:58:14 +0000 (22:58 +0000)
committershihchieh_lee@apple.com <shihchieh_lee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 May 2020 22:58:14 +0000 (22:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=211551

Reviewed by Geoffrey Garen.

Covered by existing tests.

* dom/Document.cpp:
(WebCore::Document::willBeRemovedFromFrame):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@261338 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp

index 58d4fff..14989e4 100644 (file)
@@ -1,3 +1,15 @@
+2020-05-07  Jack Lee  <shihchieh_lee@apple.com>
+
+        In Document::willBeRemovedFromFrame, clear FrameSelection before Editor so the selection is removed.
+        https://bugs.webkit.org/show_bug.cgi?id=211551
+
+        Reviewed by Geoffrey Garen.
+
+        Covered by existing tests.
+
+        * dom/Document.cpp:
+        (WebCore::Document::willBeRemovedFromFrame):
+
 2020-05-07  Antoine Quint  <graouts@apple.com>
 
         [Web Animations] imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events.html is a flaky failure
index e01ad5c..f13f837 100644 (file)
@@ -2596,8 +2596,8 @@ void Document::willBeRemovedFromFrame()
         page()->updateIsPlayingMedia(HTMLMediaElementInvalidID);
     }
 
-    editor().clear();
     selection().willBeRemovedFromFrame();
+    editor().clear();
     detachFromFrame();
 
 #if ENABLE(CSS_PAINTING_API)