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

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

Issue 2693893007: binding: Changes the association among global-proxy/global/window-instance (2nd attempt). (Closed)
Patch Set: Fixed a typo in DOMWrapperWorld::DissociateDOMWindowWrappersInAllWorlds. Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/Document.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9e6b7c37f71635fba78318c06a7f27d988e7ba0e..3b0b38b56fd88293a6901e60f057e37cfc54546a 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -5314,6 +5314,13 @@ DocumentNameCollection* Document::DocumentNamedItems(const AtomicString& name) {
name);
}
+LocalDOMWindow* Document::defaultView() const {
+ // The HTML spec requires to return null if the document is detached from the
+ // DOM. However, |dom_window_| is not cleared on the detachment. So, we need
+ // to check |frame_| to tell whether the document is attached or not.
+ return frame_ ? dom_window_ : nullptr;
+}
+
void Document::FinishedParsing() {
DCHECK(!GetScriptableDocumentParser() || !parser_->IsParsing());
DCHECK(!GetScriptableDocumentParser() || ready_state_ != kLoading);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698