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

Side by Side 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: Comments from esprehn. 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 4440 matching lines...) Expand 10 before | Expand all | Expand 10 after
4451 HTMLFrameOwnerElement* Document::localOwner() const { 4451 HTMLFrameOwnerElement* Document::localOwner() const {
4452 if (!frame()) 4452 if (!frame())
4453 return 0; 4453 return 0;
4454 // FIXME: This probably breaks the attempts to layout after a load is finished 4454 // FIXME: This probably breaks the attempts to layout after a load is finished
4455 // in implicitClose(), and probably tons of other things... 4455 // in implicitClose(), and probably tons of other things...
4456 return frame()->deprecatedLocalOwner(); 4456 return frame()->deprecatedLocalOwner();
4457 } 4457 }
4458 4458
4459 void Document::willChangeFrameOwnerProperties(int marginWidth, 4459 void Document::willChangeFrameOwnerProperties(int marginWidth,
4460 int marginHeight, 4460 int marginHeight,
4461 ScrollbarMode scrollingMode) { 4461 ScrollbarMode scrollingMode,
4462 if (!body()) 4462 bool isDisplayNone) {
4463 if (!documentElement())
4463 return; 4464 return;
4464 4465
4465 DCHECK(frame() && frame()->owner()); 4466 DCHECK(frame() && frame()->owner());
4466 FrameOwner* owner = frame()->owner(); 4467 FrameOwner* owner = frame()->owner();
4467 4468
4469 if (isDisplayNone != owner->isDisplayNone()) {
4470 documentElement()->lazyReattachIfAttached();
4471 }
4472
4473 if (!body())
4474 return;
4475
4468 if (marginWidth != owner->marginWidth()) 4476 if (marginWidth != owner->marginWidth())
4469 body()->setIntegralAttribute(marginwidthAttr, marginWidth); 4477 body()->setIntegralAttribute(marginwidthAttr, marginWidth);
4470 if (marginHeight != owner->marginHeight()) 4478 if (marginHeight != owner->marginHeight())
4471 body()->setIntegralAttribute(marginheightAttr, marginHeight); 4479 body()->setIntegralAttribute(marginheightAttr, marginHeight);
4472 if (scrollingMode != owner->scrollingMode() && view()) 4480 if (scrollingMode != owner->scrollingMode() && view())
4473 view()->setNeedsLayout(); 4481 view()->setNeedsLayout();
4474 } 4482 }
4475 4483
4476 bool Document::isInInvisibleSubframe() const { 4484 bool Document::isInInvisibleSubframe() const {
4477 if (!localOwner()) 4485 if (!localOwner())
(...skipping 2094 matching lines...) Expand 10 before | Expand all | Expand 10 after
6572 } 6580 }
6573 6581
6574 void showLiveDocumentInstances() { 6582 void showLiveDocumentInstances() {
6575 WeakDocumentSet& set = liveDocumentSet(); 6583 WeakDocumentSet& set = liveDocumentSet();
6576 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6584 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6577 for (Document* document : set) 6585 for (Document* document : set)
6578 fprintf(stderr, "- Document %p URL: %s\n", document, 6586 fprintf(stderr, "- Document %p URL: %s\n", document,
6579 document->url().getString().utf8().data()); 6587 document->url().getString().utf8().data());
6580 } 6588 }
6581 #endif 6589 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698