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

Unified Diff: third_party/WebKit/Source/core/dom/Document.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/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();
}

Powered by Google App Engine
This is Rietveld 408576698