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

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

Issue 15871005: Avoid N^2 walk placing renderers when building the render tree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Merging ToT Created 7 years, 6 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 r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after
1656 if ((change == Force) || (shouldDisplaySeamlesslyWithParent() && (change >= Inherit))) { 1656 if ((change == Force) || (shouldDisplaySeamlesslyWithParent() && (change >= Inherit))) {
1657 // style selector may set this again during recalc 1657 // style selector may set this again during recalc
1658 m_hasNodesWithPlaceholderStyle = false; 1658 m_hasNodesWithPlaceholderStyle = false;
1659 1659
1660 RefPtr<RenderStyle> documentStyle = StyleResolver::styleForDocument( this, m_styleResolver ? m_styleResolver->fontSelector() : 0); 1660 RefPtr<RenderStyle> documentStyle = StyleResolver::styleForDocument( this, m_styleResolver ? m_styleResolver->fontSelector() : 0);
1661 StyleChange ch = Node::diff(documentStyle.get(), renderer()->style() , this); 1661 StyleChange ch = Node::diff(documentStyle.get(), renderer()->style() , this);
1662 if (ch != NoChange) 1662 if (ch != NoChange)
1663 renderer()->setStyle(documentStyle.release()); 1663 renderer()->setStyle(documentStyle.release());
1664 } 1664 }
1665 1665
1666 for (Node* n = firstChild(); n; n = n->nextSibling()) { 1666 for (Node* n = lastChild(); n; n = n->previousSibling()) {
1667 if (!n->isElementNode()) 1667 if (!n->isElementNode())
1668 continue; 1668 continue;
1669 Element* element = toElement(n); 1669 Element* element = toElement(n);
1670 if (shouldRecalcStyle(change, element)) 1670 if (shouldRecalcStyle(change, element))
1671 element->recalcStyle(change); 1671 element->recalcStyle(change);
1672 } 1672 }
1673 1673
1674 if (view()) 1674 if (view())
1675 view()->updateCompositingLayersAfterStyleChange(); 1675 view()->updateCompositingLayersAfterStyleChange();
1676 1676
(...skipping 3944 matching lines...) Expand 10 before | Expand all | Expand 10 after
5621 return; 5621 return;
5622 5622
5623 Vector<RefPtr<Element> > associatedFormControls; 5623 Vector<RefPtr<Element> > associatedFormControls;
5624 copyToVector(m_associatedFormControls, associatedFormControls); 5624 copyToVector(m_associatedFormControls, associatedFormControls);
5625 5625
5626 frame()->page()->chrome().client()->didAssociateFormControls(associatedFormC ontrols); 5626 frame()->page()->chrome().client()->didAssociateFormControls(associatedFormC ontrols);
5627 m_associatedFormControls.clear(); 5627 m_associatedFormControls.clear();
5628 } 5628 }
5629 5629
5630 } // namespace WebCore 5630 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698