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

Side by Side Diff: Source/core/html/HTMLTableRowElement.cpp

Issue 412033004: Use Traversal<>::firstChild() instead of firstWithin() when iterating over children (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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/html/HTMLTableElement.cpp ('k') | Source/core/html/track/vtt/VTTRegion.cpp » ('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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserv ed. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserv ed.
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 int rIndex = 0; 73 int rIndex = 0;
74 74
75 if (HTMLTableSectionElement* head = toHTMLTableElement(table)->tHead()) { 75 if (HTMLTableSectionElement* head = toHTMLTableElement(table)->tHead()) {
76 for (HTMLTableRowElement* row = Traversal<HTMLTableRowElement>::firstChi ld(*head); row; row = Traversal<HTMLTableRowElement>::nextSibling(*row)) { 76 for (HTMLTableRowElement* row = Traversal<HTMLTableRowElement>::firstChi ld(*head); row; row = Traversal<HTMLTableRowElement>::nextSibling(*row)) {
77 if (row == this) 77 if (row == this)
78 return rIndex; 78 return rIndex;
79 ++rIndex; 79 ++rIndex;
80 } 80 }
81 } 81 }
82 82
83 for (HTMLElement* child = Traversal<HTMLElement>::firstWithin(*table); child ; child = Traversal<HTMLElement>::nextSibling(*child)) { 83 for (HTMLElement* child = Traversal<HTMLElement>::firstChild(*table); child; child = Traversal<HTMLElement>::nextSibling(*child)) {
84 if (child->hasTagName(tbodyTag)) { 84 if (child->hasTagName(tbodyTag)) {
85 HTMLTableSectionElement* section = toHTMLTableSectionElement(child); 85 HTMLTableSectionElement* section = toHTMLTableSectionElement(child);
86 for (HTMLTableRowElement* row = Traversal<HTMLTableRowElement>::firs tChild(*section); row; row = Traversal<HTMLTableRowElement>::nextSibling(*row)) { 86 for (HTMLTableRowElement* row = Traversal<HTMLTableRowElement>::firs tChild(*section); row; row = Traversal<HTMLTableRowElement>::nextSibling(*row)) {
87 if (row == this) 87 if (row == this)
88 return rIndex; 88 return rIndex;
89 ++rIndex; 89 ++rIndex;
90 } 90 }
91 } 91 }
92 } 92 }
93 93
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [0, " + String::number(numCell s) + ")."); 152 exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [0, " + String::number(numCell s) + ").");
153 } 153 }
154 } 154 }
155 155
156 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLTableRowElement::cells() 156 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLTableRowElement::cells()
157 { 157 {
158 return ensureCachedHTMLCollection(TRCells); 158 return ensureCachedHTMLCollection(TRCells);
159 } 159 }
160 160
161 } 161 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTableElement.cpp ('k') | Source/core/html/track/vtt/VTTRegion.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698