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

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

Issue 18276003: Avoid N^2 walk placing renderers when building the render tree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removing extra parens (whoops) Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/resolver/StyleResolverState.cpp ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 if ((change == Force) || (shouldDisplaySeamlesslyWithParent() && (change >= Inherit))) { 1619 if ((change == Force) || (shouldDisplaySeamlesslyWithParent() && (change >= Inherit))) {
1620 // style selector may set this again during recalc 1620 // style selector may set this again during recalc
1621 m_hasNodesWithPlaceholderStyle = false; 1621 m_hasNodesWithPlaceholderStyle = false;
1622 1622
1623 RefPtr<RenderStyle> documentStyle = StyleResolver::styleForDocument( this, m_styleResolver ? m_styleResolver->fontSelector() : 0); 1623 RefPtr<RenderStyle> documentStyle = StyleResolver::styleForDocument( this, m_styleResolver ? m_styleResolver->fontSelector() : 0);
1624 StyleChange ch = Node::diff(documentStyle.get(), renderer()->style() , this); 1624 StyleChange ch = Node::diff(documentStyle.get(), renderer()->style() , this);
1625 if (ch != NoChange) 1625 if (ch != NoChange)
1626 renderer()->setStyle(documentStyle.release()); 1626 renderer()->setStyle(documentStyle.release());
1627 } 1627 }
1628 1628
1629 for (Node* n = firstChild(); n; n = n->nextSibling()) { 1629 for (Node* n = lastChild(); n; n = n->previousSibling()) {
1630 if (!n->isElementNode()) 1630 if (!n->isElementNode())
1631 continue; 1631 continue;
1632 Element* element = toElement(n); 1632 Element* element = toElement(n);
1633 if (shouldRecalcStyle(change, element)) 1633 if (shouldRecalcStyle(change, element))
1634 element->recalcStyle(change); 1634 element->recalcStyle(change);
1635 } 1635 }
1636 1636
1637 if (view()) 1637 if (view())
1638 view()->updateCompositingLayersAfterStyleChange(); 1638 view()->updateCompositingLayersAfterStyleChange();
1639 1639
(...skipping 3491 matching lines...) Expand 10 before | Expand all | Expand 10 after
5131 { 5131 {
5132 return DocumentLifecycleNotifier::create(this); 5132 return DocumentLifecycleNotifier::create(this);
5133 } 5133 }
5134 5134
5135 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5135 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5136 { 5136 {
5137 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5137 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5138 } 5138 }
5139 5139
5140 } // namespace WebCore 5140 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolverState.cpp ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698