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 77c1366b3133990800bad1df47978b3df3500aa2..3345c0fdc8beb318535d43941143d8a39ca3e254 100644 |
--- a/third_party/WebKit/Source/core/dom/Document.cpp |
+++ b/third_party/WebKit/Source/core/dom/Document.cpp |
@@ -4497,13 +4497,20 @@ 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()) { |
+ documentElement()->lazyReattachIfAttached(); |
+ } |
+ } |
+ |
+ if (!body()) |
+ return; |
+ |
if (marginWidth != owner->marginWidth()) |
body()->setIntegralAttribute(marginwidthAttr, marginWidth); |
if (marginHeight != owner->marginHeight()) |