Chromium Code Reviews| 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()) |