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

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: Again, updating to 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 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 if ((change == Force) || (shouldDisplaySeamlesslyWithParent() && (change >= Inherit))) { 1674 if ((change == Force) || (shouldDisplaySeamlesslyWithParent() && (change >= Inherit))) {
1675 // style selector may set this again during recalc 1675 // style selector may set this again during recalc
1676 m_hasNodesWithPlaceholderStyle = false; 1676 m_hasNodesWithPlaceholderStyle = false;
1677 1677
1678 RefPtr<RenderStyle> documentStyle = StyleResolver::styleForDocument( this, m_styleResolver ? m_styleResolver->fontSelector() : 0); 1678 RefPtr<RenderStyle> documentStyle = StyleResolver::styleForDocument( this, m_styleResolver ? m_styleResolver->fontSelector() : 0);
1679 StyleChange ch = Node::diff(documentStyle.get(), renderer()->style() , this); 1679 StyleChange ch = Node::diff(documentStyle.get(), renderer()->style() , this);
1680 if (ch != NoChange) 1680 if (ch != NoChange)
1681 renderer()->setStyle(documentStyle.release()); 1681 renderer()->setStyle(documentStyle.release());
1682 } 1682 }
1683 1683
1684 for (Node* n = firstChild(); n; n = n->nextSibling()) { 1684 for (Node* n = lastChild(); n; n = n->previousSibling()) {
1685 // for (Node* n = firstChild(); n; n = n->nextSibling()) {
ojan 2013/06/03 23:03:29 derp.
1685 if (!n->isElementNode()) 1686 if (!n->isElementNode())
1686 continue; 1687 continue;
1687 Element* element = toElement(n); 1688 Element* element = toElement(n);
1688 if (shouldRecalcStyle(change, element)) 1689 if (shouldRecalcStyle(change, element))
1689 element->recalcStyle(change); 1690 element->recalcStyle(change);
1690 } 1691 }
1691 1692
1692 if (view()) 1693 if (view())
1693 view()->updateCompositingLayersAfterStyleChange(); 1694 view()->updateCompositingLayersAfterStyleChange();
1694 1695
(...skipping 3931 matching lines...) Expand 10 before | Expand all | Expand 10 after
5626 return; 5627 return;
5627 5628
5628 Vector<RefPtr<Element> > associatedFormControls; 5629 Vector<RefPtr<Element> > associatedFormControls;
5629 copyToVector(m_associatedFormControls, associatedFormControls); 5630 copyToVector(m_associatedFormControls, associatedFormControls);
5630 5631
5631 frame()->page()->chrome().client()->didAssociateFormControls(associatedFormC ontrols); 5632 frame()->page()->chrome().client()->didAssociateFormControls(associatedFormC ontrols);
5632 m_associatedFormControls.clear(); 5633 m_associatedFormControls.clear();
5633 } 5634 }
5634 5635
5635 } // namespace WebCore 5636 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698