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 ef948f518c45cd9cd95a1baff6af7c947baaaac2..65c6b5394ccc36964246cad56606e2bb3e86db5e 100644 |
| --- a/third_party/WebKit/Source/core/dom/Document.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp |
| @@ -4459,17 +4459,31 @@ 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()) { |
| + // TODO: There's almost certainly a more appropriate way of forcing a |
| + // reattachLayoutTree on the documentElement(). |
| + documentElement()->setForceReattach(); |
|
esprehn
2016/12/10 02:20:55
You don't need this.
|
| + setNeedsStyleRecalc(NeedsReattachStyleChange, |
|
esprehn
2016/12/10 02:20:55
It's not valid to set a reattach on the document i
|
| + StyleChangeReasonForTracing::create( |
| + StyleChangeReason::IFrameDisplayChanged)); |
| + } |
| + |
| + if (!body()) |
| + return; |
| + |
| if (marginWidth != owner->marginWidth()) |
| body()->setIntegralAttribute(marginwidthAttr, marginWidth); |
| if (marginHeight != owner->marginHeight()) |
| body()->setIntegralAttribute(marginheightAttr, marginHeight); |
| + |
| if (scrollingMode != owner->scrollingMode() && view()) |
| view()->setNeedsLayout(); |
| } |