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

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

Issue 170603003: Use nullptr_t for RefPtr, PassRefPtr and RawPtr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Final 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLSelectElement.cpp ('k') | Source/core/html/HTMLTableRowElement.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, 2008, 2010, 2011 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010, 2011 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 if (child->hasTagName(tbodyTag)) 180 if (child->hasTagName(tbodyTag))
181 return toHTMLTableSectionElement(child); 181 return toHTMLTableSectionElement(child);
182 } 182 }
183 return 0; 183 return 0;
184 } 184 }
185 185
186 PassRefPtr<HTMLElement> HTMLTableElement::insertRow(int index, ExceptionState& e xceptionState) 186 PassRefPtr<HTMLElement> HTMLTableElement::insertRow(int index, ExceptionState& e xceptionState)
187 { 187 {
188 if (index < -1) { 188 if (index < -1) {
189 exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is less than -1."); 189 exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is less than -1.");
190 return 0; 190 return nullptr;
191 } 191 }
192 192
193 RefPtr<Node> protectFromMutationEvents(this); 193 RefPtr<Node> protectFromMutationEvents(this);
194 194
195 RefPtr<HTMLTableRowElement> lastRow = 0; 195 RefPtr<HTMLTableRowElement> lastRow = nullptr;
196 RefPtr<HTMLTableRowElement> row = 0; 196 RefPtr<HTMLTableRowElement> row = nullptr;
197 if (index == -1) 197 if (index == -1)
198 lastRow = HTMLTableRowsCollection::lastRow(this); 198 lastRow = HTMLTableRowsCollection::lastRow(this);
199 else { 199 else {
200 for (int i = 0; i <= index; ++i) { 200 for (int i = 0; i <= index; ++i) {
201 row = HTMLTableRowsCollection::rowAfter(this, lastRow.get()); 201 row = HTMLTableRowsCollection::rowAfter(this, lastRow.get());
202 if (!row) { 202 if (!row) {
203 if (i != index) { 203 if (i != index) {
204 exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is greater than the number of rows in t he table (" + String::number(i) + ")."); 204 exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is greater than the number of rows in t he table (" + String::number(i) + ").");
205 return 0; 205 return nullptr;
206 } 206 }
207 break; 207 break;
208 } 208 }
209 lastRow = row; 209 lastRow = row;
210 } 210 }
211 } 211 }
212 212
213 RefPtr<ContainerNode> parent; 213 RefPtr<ContainerNode> parent;
214 if (lastRow) 214 if (lastRow)
215 parent = row ? row->parentNode() : lastRow->parentNode(); 215 parent = row ? row->parentNode() : lastRow->parentNode();
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 if (!value.isEmpty()) 389 if (!value.isEmpty())
390 m_padding = max(0, value.toInt()); 390 m_padding = max(0, value.toInt());
391 else 391 else
392 m_padding = 1; 392 m_padding = 1;
393 } else if (name == colsAttr) { 393 } else if (name == colsAttr) {
394 // ### 394 // ###
395 } else 395 } else
396 HTMLElement::parseAttribute(name, value); 396 HTMLElement::parseAttribute(name, value);
397 397
398 if (bordersBefore != cellBorders() || oldPadding != m_padding) { 398 if (bordersBefore != cellBorders() || oldPadding != m_padding) {
399 m_sharedCellStyle = 0; 399 m_sharedCellStyle = nullptr;
400 setNeedsTableStyleRecalc(); 400 setNeedsTableStyleRecalc();
401 } 401 }
402 } 402 }
403 403
404 static PassRefPtr<StylePropertySet> createBorderStyle(CSSValueID value) 404 static PassRefPtr<StylePropertySet> createBorderStyle(CSSValueID value)
405 { 405 {
406 RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(); 406 RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
407 style->setProperty(CSSPropertyBorderTopStyle, value); 407 style->setProperty(CSSPropertyBorderTopStyle, value);
408 style->setProperty(CSSPropertyBorderBottomStyle, value); 408 style->setProperty(CSSPropertyBorderBottomStyle, value);
409 style->setProperty(CSSPropertyBorderLeftStyle, value); 409 style->setProperty(CSSPropertyBorderLeftStyle, value);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 { 553 {
554 return getAttribute(rulesAttr); 554 return getAttribute(rulesAttr);
555 } 555 }
556 556
557 const AtomicString& HTMLTableElement::summary() const 557 const AtomicString& HTMLTableElement::summary() const
558 { 558 {
559 return getAttribute(summaryAttr); 559 return getAttribute(summaryAttr);
560 } 560 }
561 561
562 } 562 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLSelectElement.cpp ('k') | Source/core/html/HTMLTableRowElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698