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

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

Issue 1175743002: Minor simplification in Node::previousNodeConsideringAtomicNodes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 * 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 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 999
1000 // FIXME: This code is used by editing. Seems like it could move over there and not pollute Node. 1000 // FIXME: This code is used by editing. Seems like it could move over there and not pollute Node.
1001 Node* Node::previousNodeConsideringAtomicNodes() const 1001 Node* Node::previousNodeConsideringAtomicNodes() const
1002 { 1002 {
1003 if (previousSibling()) { 1003 if (previousSibling()) {
1004 Node* n = previousSibling(); 1004 Node* n = previousSibling();
1005 while (!isAtomicNode(n) && n->lastChild()) 1005 while (!isAtomicNode(n) && n->lastChild())
1006 n = n->lastChild(); 1006 n = n->lastChild();
1007 return n; 1007 return n;
1008 } 1008 }
1009 if (parentNode()) { 1009 return parentNode();
1010 return parentNode();
1011 }
1012 return nullptr;
1013 } 1010 }
1014 1011
1015 Node* Node::nextNodeConsideringAtomicNodes() const 1012 Node* Node::nextNodeConsideringAtomicNodes() const
1016 { 1013 {
1017 if (!isAtomicNode(this) && hasChildren()) 1014 if (!isAtomicNode(this) && hasChildren())
1018 return firstChild(); 1015 return firstChild();
1019 if (nextSibling()) 1016 if (nextSibling())
1020 return nextSibling(); 1017 return nextSibling();
1021 const Node* n = this; 1018 const Node* n = this;
1022 while (n && !n->nextSibling()) 1019 while (n && !n->nextSibling())
(...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after
2499 2496
2500 void showNodePath(const blink::Node* node) 2497 void showNodePath(const blink::Node* node)
2501 { 2498 {
2502 if (node) 2499 if (node)
2503 node->showNodePathForThis(); 2500 node->showNodePathForThis();
2504 else 2501 else
2505 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2502 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2506 } 2503 }
2507 2504
2508 #endif 2505 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698