Index: third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp |
index eb81d639c4de017fbb4adf4c46265078a85c0f43..b1f2ef3aa5d20cf6d092644e2169ed681161f2aa 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp |
@@ -28,6 +28,7 @@ |
#include "core/HTMLNames.h" |
#include "core/dom/Attribute.h" |
#include "core/dom/Document.h" |
+#include "core/dom/StyleChangeReason.h" |
#include "core/frame/FrameView.h" |
#include "core/frame/LocalFrame.h" |
#include "core/frame/RemoteFrame.h" |
@@ -193,11 +194,23 @@ void HTMLFrameElementBase::didNotifySubtreeInsertionsToDocument() { |
void HTMLFrameElementBase::attachLayoutTree(const AttachContext& context) { |
HTMLFrameOwnerElement::attachLayoutTree(context); |
- if (layoutPart()) { |
- if (Frame* frame = contentFrame()) { |
- if (frame->isLocalFrame()) |
- setWidget(toLocalFrame(frame)->view()); |
- else if (frame->isRemoteFrame()) |
+ // TODO(esprehn): Why do we only call setWidget() if the frame is |
+ // displayed? |
+ |
+ if (Frame* frame = contentFrame()) { |
+ if (frame->isLocalFrame()) { |
+ LocalFrame* localFrame = toLocalFrame(frame); |
+ if (layoutPart()) |
+ setWidget(localFrame->view()); |
+ if (Element* documentElement = |
+ localFrame->document()->documentElement()) { |
+ if (static_cast<bool>(layoutPart()) != |
+ static_cast<bool>(documentElement->layoutObject())) { |
+ documentElement->lazyReattachIfAttached(); |
+ } |
+ } |
+ } else { |
+ if (layoutPart()) |
setWidget(toRemoteFrame(frame)->view()); |
} |
} |