Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Unified Diff: third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp

Issue 2513153002: Don't create boxes for the contents of display: none iframes. (Closed)
Patch Set: Handle dynamic changes properly. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
}
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleChangeReason.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698