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 733298fd28a216b3496cf0b0ba58fabbf04d3dc4..cd929dc69c5fd5979c526928a7be13e77c63a3da 100644 |
--- a/third_party/WebKit/Source/core/dom/Document.cpp |
+++ b/third_party/WebKit/Source/core/dom/Document.cpp |
@@ -4458,13 +4458,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()->lazyReattachIfAttached(); |
+ } |
+ |
+ if (!body()) |
+ return; |
+ |
if (marginWidth != owner->marginWidth()) |
body()->setIntegralAttribute(marginwidthAttr, marginWidth); |
if (marginHeight != owner->marginHeight()) |