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

Side by Side Diff: Source/core/html/HTMLTableSectionElement.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/HTMLTableRowElement.cpp ('k') | Source/core/html/forms/RangeInputType.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, 2010 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return row.release(); 79 return row.release();
80 } 80 }
81 81
82 void HTMLTableSectionElement::deleteRow(int index, ExceptionState& exceptionStat e) 82 void HTMLTableSectionElement::deleteRow(int index, ExceptionState& exceptionStat e)
83 { 83 {
84 RefPtr<HTMLCollection> children = rows(); 84 RefPtr<HTMLCollection> children = rows();
85 int numRows = children ? (int)children->length() : 0; 85 int numRows = children ? (int)children->length() : 0;
86 if (index == -1) 86 if (index == -1)
87 index = numRows - 1; 87 index = numRows - 1;
88 if (index >= 0 && index < numRows) { 88 if (index >= 0 && index < numRows) {
89 RefPtr<Node> row = children->item(index); 89 RefPtr<Element> row = children->item(index);
90 HTMLElement::removeChild(row.get(), exceptionState); 90 HTMLElement::removeChild(row.get(), exceptionState);
91 } else { 91 } else {
92 exceptionState.throwDOMException(IndexSizeError, "The provided index (" + String::number(index) + " is outside the range [-1, " + String::number(numRows ) + "]."); 92 exceptionState.throwDOMException(IndexSizeError, "The provided index (" + String::number(index) + " is outside the range [-1, " + String::number(numRows ) + "].");
93 } 93 }
94 } 94 }
95 95
96 int HTMLTableSectionElement::numRows() const 96 int HTMLTableSectionElement::numRows() const
97 { 97 {
98 int rows = 0; 98 int rows = 0;
99 const Node *n = firstChild(); 99 const Node *n = firstChild();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 { 145 {
146 setAttribute(valignAttr, value); 146 setAttribute(valignAttr, value);
147 } 147 }
148 148
149 PassRefPtr<HTMLCollection> HTMLTableSectionElement::rows() 149 PassRefPtr<HTMLCollection> HTMLTableSectionElement::rows()
150 { 150 {
151 return ensureCachedHTMLCollection(TSectionRows); 151 return ensureCachedHTMLCollection(TSectionRows);
152 } 152 }
153 153
154 } 154 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTableRowElement.cpp ('k') | Source/core/html/forms/RangeInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698