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

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

Issue 2743053003: [Reland #1] Don't create layout objects for children of display-none iframes. (Closed)
Patch Set: Fix DOM object leaks. Diff this against Patch Set 10. Created 3 years, 9 months 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/HTMLFrameOwnerElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
index 0efebb766aca2cd98e06e3f806719037c619870d..667f2bc3be91083ea8ea72c3560fa02746f7f8aa 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -223,6 +223,13 @@ void HTMLFrameOwnerElement::disposeWidgetSoon(FrameViewBase* frameViewBase) {
frameViewBase->dispose();
}
+void HTMLFrameOwnerElement::frameOwnerPropertiesChanged() {
+ // Don't notify about updates if contentFrame() is null, for example when
+ // the subframe hasn't been created yet.
+ if (contentFrame())
+ document().frame()->loader().client()->didChangeFrameOwnerProperties(this);
+}
+
void HTMLFrameOwnerElement::dispatchLoad() {
dispatchScopedEvent(Event::create(EventTypeNames::load));
}
@@ -251,6 +258,15 @@ void HTMLFrameOwnerElement::setWidget(FrameViewBase* frameViewBase) {
if (frameViewBase == m_widget)
return;
+ Document* doc = contentDocument();
+ if (doc && doc->frame()) {
+ bool willBeDisplayNone = !frameViewBase;
+ if (isDisplayNone() != willBeDisplayNone) {
+ doc->willChangeFrameOwnerProperties(marginWidth(), marginHeight(),
+ scrollingMode(), willBeDisplayNone);
+ }
+ }
+
if (m_widget) {
if (m_widget->parent())
moveWidgetToParentSoon(m_widget.get(), 0);
@@ -258,6 +274,7 @@ void HTMLFrameOwnerElement::setWidget(FrameViewBase* frameViewBase) {
}
m_widget = frameViewBase;
+ frameOwnerPropertiesChanged();
LayoutPart* layoutPart = toLayoutPart(layoutObject());
LayoutPartItem layoutPartItem = LayoutPartItem(layoutPart);

Powered by Google App Engine
This is Rietveld 408576698