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

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

Issue 24350009: Reverse style resolution to avoid N^2 walk when building the render tree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixing loops in Regions Created 7 years, 2 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
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 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 } 1023 }
1024 } 1024 }
1025 1025
1026 clearAttached(); 1026 clearAttached();
1027 1027
1028 #ifndef NDEBUG 1028 #ifndef NDEBUG
1029 detachingNode = 0; 1029 detachingNode = 0;
1030 #endif 1030 #endif
1031 } 1031 }
1032 1032
1033 void Node::reattachWhitespaceSiblings() const
1034 {
1035 for (Node* sibling = nextSibling(); sibling; sibling = sibling->nextSibling( )) {
1036 if (sibling->renderer())
1037 return;
1038 if (sibling->isTextNode()) {
1039 if (toText(sibling)->containsOnlyWhitespace())
1040 sibling->reattach();
1041 else
1042 return;
1043 }
1044 }
1045 }
1046
1033 // FIXME: This code is used by editing. Seems like it could move over there and not pollute Node. 1047 // FIXME: This code is used by editing. Seems like it could move over there and not pollute Node.
1034 Node *Node::previousNodeConsideringAtomicNodes() const 1048 Node *Node::previousNodeConsideringAtomicNodes() const
1035 { 1049 {
1036 if (previousSibling()) { 1050 if (previousSibling()) {
1037 Node *n = previousSibling(); 1051 Node *n = previousSibling();
1038 while (!isAtomicNode(n) && n->lastChild()) 1052 while (!isAtomicNode(n) && n->lastChild())
1039 n = n->lastChild(); 1053 n = n->lastChild();
1040 return n; 1054 return n;
1041 } 1055 }
1042 else if (parentNode()) { 1056 else if (parentNode()) {
(...skipping 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after
2652 node->showTreeForThis(); 2666 node->showTreeForThis();
2653 } 2667 }
2654 2668
2655 void showNodePath(const WebCore::Node* node) 2669 void showNodePath(const WebCore::Node* node)
2656 { 2670 {
2657 if (node) 2671 if (node)
2658 node->showNodePathForThis(); 2672 node->showNodePathForThis();
2659 } 2673 }
2660 2674
2661 #endif 2675 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698