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

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

Issue 494653002: Move HTMLTable*Element.insert{Row,Cell}'s argument default into IDL file (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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.h ('k') | Source/core/html/HTMLTableRowElement.idl » ('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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 const Node* n = this; 107 const Node* n = this;
108 do { 108 do {
109 n = n->previousSibling(); 109 n = n->previousSibling();
110 if (n && isHTMLTableRowElement(*n)) 110 if (n && isHTMLTableRowElement(*n))
111 ++rIndex; 111 ++rIndex;
112 } while (n); 112 } while (n);
113 113
114 return rIndex; 114 return rIndex;
115 } 115 }
116 116
117 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableRowElement::insertCell(ExceptionSta te& exceptionState)
118 {
119 // The default 'index' argument value is -1.
120 return insertCell(-1, exceptionState);
121 }
122
123 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, E xceptionState& exceptionState) 117 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, E xceptionState& exceptionState)
124 { 118 {
125 RefPtrWillBeRawPtr<HTMLCollection> children = cells(); 119 RefPtrWillBeRawPtr<HTMLCollection> children = cells();
126 int numCells = children ? children->length() : 0; 120 int numCells = children ? children->length() : 0;
127 if (index < -1 || index > numCells) { 121 if (index < -1 || index > numCells) {
128 exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [-1, " + String::number(numCel ls) + "]."); 122 exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [-1, " + String::number(numCel ls) + "].");
129 return nullptr; 123 return nullptr;
130 } 124 }
131 125
132 RefPtrWillBeRawPtr<HTMLTableCellElement> cell = HTMLTableCellElement::create (tdTag, document()); 126 RefPtrWillBeRawPtr<HTMLTableCellElement> cell = HTMLTableCellElement::create (tdTag, document());
(...skipping 17 matching lines...) Expand all
150 exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [0, " + String::number(numCell s) + ")."); 144 exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [0, " + String::number(numCell s) + ").");
151 } 145 }
152 } 146 }
153 147
154 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLTableRowElement::cells() 148 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLTableRowElement::cells()
155 { 149 {
156 return ensureCachedCollection<HTMLCollection>(TRCells); 150 return ensureCachedCollection<HTMLCollection>(TRCells);
157 } 151 }
158 152
159 } 153 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTableRowElement.h ('k') | Source/core/html/HTMLTableRowElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698