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

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

Issue 2743053003: [Reland #1] Don't create layout objects for children of display-none iframes. (Closed)
Patch Set: Fix DOM object leaks. Diff this against Patch Set 10. Created 3 years, 9 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/frame/FrameOwner.h » ('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 e184fe385333a69833f7ddf0a12bd685793567e7..ca40e57293351435cc57a2156adcb69b0a4b702c 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -2468,6 +2468,7 @@ void Document::shutdown() {
// detaching Document is not in a consistent state.
ScriptForbiddenScope forbidScript;
+ m_lifecycle.advanceTo(DocumentLifecycle::Stopping);
view()->dispose();
// If the FrameViewBase of the document's frame owner doesn't match view()
@@ -2480,8 +2481,6 @@ void Document::shutdown() {
m_markers->prepareForDestruction();
- m_lifecycle.advanceTo(DocumentLifecycle::Stopping);
-
if (page())
page()->documentDetached(this);
probe::documentDetached(this);
@@ -4564,13 +4563,21 @@ HTMLFrameOwnerElement* Document::localOwner() const {
void Document::willChangeFrameOwnerProperties(int marginWidth,
int marginHeight,
- ScrollbarMode scrollingMode) {
- if (!body())
- return;
-
+ ScrollbarMode scrollingMode,
+ bool isDisplayNone) {
DCHECK(frame() && frame()->owner());
FrameOwner* owner = frame()->owner();
+ if (documentElement()) {
+ if (isDisplayNone != owner->isDisplayNone()) {
+ if (m_lifecycle.state() < DocumentLifecycle::Stopping)
esprehn 2017/03/28 21:49:24 remove this, lazyReattachIfAttached() checks inAct
erikchen 2017/03/29 20:16:54 Done.
+ documentElement()->lazyReattachIfAttached();
+ }
+ }
+
+ if (!body())
+ return;
+
if (marginWidth != owner->marginWidth())
body()->setIntegralAttribute(marginwidthAttr, marginWidth);
if (marginHeight != owner->marginHeight())
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/frame/FrameOwner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698