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

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

Issue 137433008: Have HTMLCollection::item() return an Element as per specification (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 10 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
« no previous file with comments | « Source/core/html/HTMLSelectElement.idl ('k') | Source/core/html/HTMLTableSectionElement.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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 return cell.release(); 135 return cell.release();
136 } 136 }
137 137
138 void HTMLTableRowElement::deleteCell(int index, ExceptionState& exceptionState) 138 void HTMLTableRowElement::deleteCell(int index, ExceptionState& exceptionState)
139 { 139 {
140 RefPtr<HTMLCollection> children = cells(); 140 RefPtr<HTMLCollection> children = cells();
141 int numCells = children ? children->length() : 0; 141 int numCells = children ? children->length() : 0;
142 if (index == -1) 142 if (index == -1)
143 index = numCells-1; 143 index = numCells-1;
144 if (index >= 0 && index < numCells) { 144 if (index >= 0 && index < numCells) {
145 RefPtr<Node> cell = children->item(index); 145 RefPtr<Element> cell = children->item(index);
146 HTMLElement::removeChild(cell.get(), exceptionState); 146 HTMLElement::removeChild(cell.get(), exceptionState);
147 } else { 147 } else {
148 exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [0, " + String::number(numCell s) + ")."); 148 exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [0, " + String::number(numCell s) + ").");
149 } 149 }
150 } 150 }
151 151
152 PassRefPtr<HTMLCollection> HTMLTableRowElement::cells() 152 PassRefPtr<HTMLCollection> HTMLTableRowElement::cells()
153 { 153 {
154 return ensureCachedHTMLCollection(TRCells); 154 return ensureCachedHTMLCollection(TRCells);
155 } 155 }
156 156
157 } 157 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLSelectElement.idl ('k') | Source/core/html/HTMLTableSectionElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698