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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2743053003: [Reland #1] Don't create layout objects for children of display-none iframes. (Closed)
Patch Set: rebaseline. Created 3 years, 8 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 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 2455 matching lines...) Expand 10 before | Expand all | Expand 10 after
2466 FrameNavigationDisabler navigationDisabler(*m_frame); 2466 FrameNavigationDisabler navigationDisabler(*m_frame);
2467 // Defer FrameViewBase updates to avoid plugins trying to run script inside 2467 // Defer FrameViewBase updates to avoid plugins trying to run script inside
2468 // ScriptForbiddenScope, which will crash the renderer after 2468 // ScriptForbiddenScope, which will crash the renderer after
2469 // https://crrev.com/200984 2469 // https://crrev.com/200984
2470 HTMLFrameOwnerElement::UpdateSuspendScope 2470 HTMLFrameOwnerElement::UpdateSuspendScope
2471 suspendFrameViewBaseHierarchyUpdates; 2471 suspendFrameViewBaseHierarchyUpdates;
2472 // Don't allow script to run in the middle of detachLayoutTree() because a 2472 // Don't allow script to run in the middle of detachLayoutTree() because a
2473 // detaching Document is not in a consistent state. 2473 // detaching Document is not in a consistent state.
2474 ScriptForbiddenScope forbidScript; 2474 ScriptForbiddenScope forbidScript;
2475 2475
2476 m_lifecycle.advanceTo(DocumentLifecycle::Stopping);
2476 view()->dispose(); 2477 view()->dispose();
2477 2478
2478 // If the FrameViewBase of the document's frame owner doesn't match view() 2479 // If the FrameViewBase of the document's frame owner doesn't match view()
2479 // then FrameView::dispose() didn't clear the owner's FrameViewBase. If we 2480 // then FrameView::dispose() didn't clear the owner's FrameViewBase. If we
2480 // don't clear it here, it may be clobbered later in LocalFrame::createView(). 2481 // don't clear it here, it may be clobbered later in LocalFrame::createView().
2481 // See also https://crbug.com/673170 and the comment in FrameView::dispose(). 2482 // See also https://crbug.com/673170 and the comment in FrameView::dispose().
2482 HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner(); 2483 HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner();
2483 if (ownerElement) 2484 if (ownerElement)
2484 ownerElement->setWidget(nullptr); 2485 ownerElement->setWidget(nullptr);
2485 2486
2486 m_markers->prepareForDestruction(); 2487 m_markers->prepareForDestruction();
2487 2488
2488 m_lifecycle.advanceTo(DocumentLifecycle::Stopping);
2489
2490 if (page()) 2489 if (page())
2491 page()->documentDetached(this); 2490 page()->documentDetached(this);
2492 probe::documentDetached(this); 2491 probe::documentDetached(this);
2493 2492
2494 if (m_frame->loader().client()->sharedWorkerRepositoryClient()) 2493 if (m_frame->loader().client()->sharedWorkerRepositoryClient())
2495 m_frame->loader() 2494 m_frame->loader()
2496 .client() 2495 .client()
2497 ->sharedWorkerRepositoryClient() 2496 ->sharedWorkerRepositoryClient()
2498 ->documentDetached(this); 2497 ->documentDetached(this);
2499 2498
(...skipping 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after
4574 HTMLFrameOwnerElement* Document::localOwner() const { 4573 HTMLFrameOwnerElement* Document::localOwner() const {
4575 if (!frame()) 4574 if (!frame())
4576 return 0; 4575 return 0;
4577 // FIXME: This probably breaks the attempts to layout after a load is finished 4576 // FIXME: This probably breaks the attempts to layout after a load is finished
4578 // in implicitClose(), and probably tons of other things... 4577 // in implicitClose(), and probably tons of other things...
4579 return frame()->deprecatedLocalOwner(); 4578 return frame()->deprecatedLocalOwner();
4580 } 4579 }
4581 4580
4582 void Document::willChangeFrameOwnerProperties(int marginWidth, 4581 void Document::willChangeFrameOwnerProperties(int marginWidth,
4583 int marginHeight, 4582 int marginHeight,
4584 ScrollbarMode scrollingMode) { 4583 ScrollbarMode scrollingMode,
4584 bool isDisplayNone) {
4585 DCHECK(frame() && frame()->owner());
4586 FrameOwner* owner = frame()->owner();
4587
4588 if (documentElement()) {
4589 if (isDisplayNone != owner->isDisplayNone())
4590 documentElement()->lazyReattachIfAttached();
4591 }
4592
4585 if (!body()) 4593 if (!body())
4586 return; 4594 return;
4587 4595
4588 DCHECK(frame() && frame()->owner());
4589 FrameOwner* owner = frame()->owner();
4590
4591 if (marginWidth != owner->marginWidth()) 4596 if (marginWidth != owner->marginWidth())
4592 body()->setIntegralAttribute(marginwidthAttr, marginWidth); 4597 body()->setIntegralAttribute(marginwidthAttr, marginWidth);
4593 if (marginHeight != owner->marginHeight()) 4598 if (marginHeight != owner->marginHeight())
4594 body()->setIntegralAttribute(marginheightAttr, marginHeight); 4599 body()->setIntegralAttribute(marginheightAttr, marginHeight);
4595 if (scrollingMode != owner->scrollingMode() && view()) 4600 if (scrollingMode != owner->scrollingMode() && view())
4596 view()->setNeedsLayout(); 4601 view()->setNeedsLayout();
4597 } 4602 }
4598 4603
4599 bool Document::isInInvisibleSubframe() const { 4604 bool Document::isInInvisibleSubframe() const {
4600 if (!localOwner()) 4605 if (!localOwner())
(...skipping 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after
6669 } 6674 }
6670 6675
6671 void showLiveDocumentInstances() { 6676 void showLiveDocumentInstances() {
6672 WeakDocumentSet& set = liveDocumentSet(); 6677 WeakDocumentSet& set = liveDocumentSet();
6673 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6678 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6674 for (blink::Document* document : set) 6679 for (blink::Document* document : set)
6675 fprintf(stderr, "- Document %p URL: %s\n", document, 6680 fprintf(stderr, "- Document %p URL: %s\n", document,
6676 document->url().getString().utf8().data()); 6681 document->url().getString().utf8().data());
6677 } 6682 }
6678 #endif 6683 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/frame/FrameOwner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698