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

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

Issue 2564633002: Don't create layout objects for children of display-none iframes. (Closed)
Patch Set: . Created 4 years 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 cebcc0b20d7aba39bb64b8c0c9697deed0f4a954..4a14fb6aa99a73559411cc5c436b6f10cf3775a3 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -221,6 +221,13 @@ void HTMLFrameOwnerElement::disposeWidgetSoon(Widget* widget) {
widget->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));
}
@@ -231,6 +238,15 @@ HTMLFrameOwnerElement::delegatedPermissions() const {
return permissions;
}
+void HTMLFrameOwnerElement::setLayoutObject(LayoutObject* layoutObject) {
+ bool isDisplayNonePrev = isDisplayNone();
+ HTMLElement::setLayoutObject(layoutObject);
+ bool isDisplayNoneNew = isDisplayNone();
+ if (isDisplayNonePrev != isDisplayNoneNew) {
+ frameOwnerPropertiesChanged();
+ }
+}
+
Document* HTMLFrameOwnerElement::getSVGDocument(
ExceptionState& exceptionState) const {
Document* doc = contentDocument();

Powered by Google App Engine
This is Rietveld 408576698