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

Side by Side Diff: Source/core/html/HTMLTableSectionElement.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
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(HTMLTableSectionElement) 47 DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(HTMLTableSectionElement)
48 48
49 const StylePropertySet* HTMLTableSectionElement::additionalPresentationAttribute Style() 49 const StylePropertySet* HTMLTableSectionElement::additionalPresentationAttribute Style()
50 { 50 {
51 if (HTMLTableElement* table = findParentTable()) 51 if (HTMLTableElement* table = findParentTable())
52 return table->additionalGroupStyle(true); 52 return table->additionalGroupStyle(true);
53 return 0; 53 return 0;
54 } 54 }
55 55
56 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableSectionElement::insertRow(Exception State& exceptionState)
57 {
58 // The default 'index' argument value is -1.
59 return insertRow(-1, exceptionState);
60 }
61
62 // these functions are rather slow, since we need to get the row at 56 // these functions are rather slow, since we need to get the row at
63 // the index... but they aren't used during usual HTML parsing anyway 57 // the index... but they aren't used during usual HTML parsing anyway
64 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableSectionElement::insertRow(int index , ExceptionState& exceptionState) 58 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableSectionElement::insertRow(int index , ExceptionState& exceptionState)
65 { 59 {
66 RefPtrWillBeRawPtr<HTMLCollection> children = rows(); 60 RefPtrWillBeRawPtr<HTMLCollection> children = rows();
67 int numRows = children ? static_cast<int>(children->length()) : 0; 61 int numRows = children ? static_cast<int>(children->length()) : 0;
68 if (index < -1 || index > numRows) { 62 if (index < -1 || index > numRows) {
69 exceptionState.throwDOMException(IndexSizeError, "The provided index (" + String::number(index) + " is outside the range [-1, " + String::number(numRows ) + "]."); 63 exceptionState.throwDOMException(IndexSizeError, "The provided index (" + String::number(index) + " is outside the range [-1, " + String::number(numRows ) + "].");
70 return nullptr; 64 return nullptr;
71 } 65 }
(...skipping 27 matching lines...) Expand all
99 ++rowCount; 93 ++rowCount;
100 return rowCount; 94 return rowCount;
101 } 95 }
102 96
103 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLTableSectionElement::rows() 97 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLTableSectionElement::rows()
104 { 98 {
105 return ensureCachedCollection<HTMLCollection>(TSectionRows); 99 return ensureCachedCollection<HTMLCollection>(TSectionRows);
106 } 100 }
107 101
108 } 102 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTableSectionElement.h ('k') | Source/core/html/HTMLTableSectionElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698