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

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

Issue 2564633002: Don't create layout objects for children of display-none iframes. (Closed)
Patch Set: Add new layout tests. Created 4 years 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 f5972c64070085e883e96563363867652c7fe6a3..3e06dcdb373afdc4abffd8d54f6d85b8aaed690b 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -4409,13 +4409,21 @@ HTMLFrameOwnerElement* Document::localOwner() const {
void Document::willChangeFrameOwnerProperties(int marginWidth,
int marginHeight,
- ScrollbarMode scrollingMode) {
- if (!body())
+ ScrollbarMode scrollingMode,
+ bool isDisplayNone) {
+ if (!documentElement())
return;
DCHECK(frame() && frame()->owner());
FrameOwner* owner = frame()->owner();
+ if (isDisplayNone != owner->isDisplayNone() && documentElement()) {
dcheng 2016/12/15 21:35:04 Nit: this is already null-checked at the beginning
erikchen 2016/12/16 20:56:12 Done.
+ documentElement()->lazyReattachIfAttached();
+ }
+
+ if (!body())
+ return;
+
if (marginWidth != owner->marginWidth())
body()->setIntegralAttribute(marginwidthAttr, marginWidth);
if (marginHeight != owner->marginHeight())

Powered by Google App Engine
This is Rietveld 408576698