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

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

Issue 280123002: Oilpan: move LiveNodeList collections to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have NodeRareData clear out NodeListsNodeData instead. Created 6 years, 7 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/HTMLTableRowsCollection.h » ('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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 121
122 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableRowElement::insertCell(ExceptionSta te& exceptionState) 122 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableRowElement::insertCell(ExceptionSta te& exceptionState)
123 { 123 {
124 // The default 'index' argument value is -1. 124 // The default 'index' argument value is -1.
125 return insertCell(-1, exceptionState); 125 return insertCell(-1, exceptionState);
126 } 126 }
127 127
128 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, E xceptionState& exceptionState) 128 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, E xceptionState& exceptionState)
129 { 129 {
130 RefPtr<HTMLCollection> children = cells(); 130 RefPtrWillBeRawPtr<HTMLCollection> children = cells();
131 int numCells = children ? children->length() : 0; 131 int numCells = children ? children->length() : 0;
132 if (index < -1 || index > numCells) { 132 if (index < -1 || index > numCells) {
133 exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [-1, " + String::number(numCel ls) + "]."); 133 exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [-1, " + String::number(numCel ls) + "].");
134 return nullptr; 134 return nullptr;
135 } 135 }
136 136
137 RefPtrWillBeRawPtr<HTMLTableCellElement> cell = HTMLTableCellElement::create (tdTag, document()); 137 RefPtrWillBeRawPtr<HTMLTableCellElement> cell = HTMLTableCellElement::create (tdTag, document());
138 if (numCells == index || index == -1) 138 if (numCells == index || index == -1)
139 appendChild(cell, exceptionState); 139 appendChild(cell, exceptionState);
140 else 140 else
141 insertBefore(cell, children->item(index), exceptionState); 141 insertBefore(cell, children->item(index), exceptionState);
142 return cell.release(); 142 return cell.release();
143 } 143 }
144 144
145 void HTMLTableRowElement::deleteCell(int index, ExceptionState& exceptionState) 145 void HTMLTableRowElement::deleteCell(int index, ExceptionState& exceptionState)
146 { 146 {
147 RefPtr<HTMLCollection> children = cells(); 147 RefPtrWillBeRawPtr<HTMLCollection> children = cells();
148 int numCells = children ? children->length() : 0; 148 int numCells = children ? children->length() : 0;
149 if (index == -1) 149 if (index == -1)
150 index = numCells-1; 150 index = numCells-1;
151 if (index >= 0 && index < numCells) { 151 if (index >= 0 && index < numCells) {
152 RefPtrWillBeRawPtr<Element> cell = children->item(index); 152 RefPtrWillBeRawPtr<Element> cell = children->item(index);
153 HTMLElement::removeChild(cell.get(), exceptionState); 153 HTMLElement::removeChild(cell.get(), exceptionState);
154 } else { 154 } else {
155 exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [0, " + String::number(numCell s) + ")."); 155 exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [0, " + String::number(numCell s) + ").");
156 } 156 }
157 } 157 }
158 158
159 PassRefPtr<HTMLCollection> HTMLTableRowElement::cells() 159 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLTableRowElement::cells()
160 { 160 {
161 return ensureCachedHTMLCollection(TRCells); 161 return ensureCachedHTMLCollection(TRCells);
162 } 162 }
163 163
164 } 164 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTableRowElement.h ('k') | Source/core/html/HTMLTableRowsCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698