Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2727563002: Selection API: document.open() should reset Selection. (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 09445ca5e5febafdd7e8f27ca1cff2b236cde055..5b76c0294e1a92c6248834bd2677b6e1834df989 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -2730,6 +2730,9 @@ void Document::open() {
}
removeAllEventListenersRecursively();
+ resetTreeScope();
+ if (m_frame)
+ m_frame->selection().clear();
implicitOpen(ForceSynchronousParsing);
if (ScriptableDocumentParser* parser = scriptableDocumentParser())
parser->setWasCreatedByScript(true);

Powered by Google App Engine
This is Rietveld 408576698