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()) |