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

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

Issue 24469004: Amusingly deprecate the generic version of 'ExceptionState::throwDOMException'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/HTMLMeterElement.cpp ('k') | Source/core/html/HTMLProgressElement.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) 2006, 2011, 2012 Apple Computer, Inc. 2 * Copyright (C) 2006, 2011, 2012 Apple Computer, Inc.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, Exception State& es) 44 void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, Exception State& es)
45 { 45 {
46 add(element, length(), es); 46 add(element, length(), es);
47 } 47 }
48 48
49 void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index , ExceptionState& es) 49 void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index , ExceptionState& es)
50 { 50 {
51 HTMLOptionElement* newOption = element.get(); 51 HTMLOptionElement* newOption = element.get();
52 52
53 if (!newOption) { 53 if (!newOption) {
54 es.throwDOMException(TypeMismatchError); 54 es.throwUninformativeAndGenericDOMException(TypeMismatchError);
55 return; 55 return;
56 } 56 }
57 57
58 if (index < -1) { 58 if (index < -1) {
59 es.throwDOMException(IndexSizeError); 59 es.throwUninformativeAndGenericDOMException(IndexSizeError);
60 return; 60 return;
61 } 61 }
62 62
63 HTMLSelectElement* select = toHTMLSelectElement(ownerNode()); 63 HTMLSelectElement* select = toHTMLSelectElement(ownerNode());
64 64
65 if (index == -1 || unsigned(index) >= length()) 65 if (index == -1 || unsigned(index) >= length())
66 select->add(newOption, 0, es); 66 select->add(newOption, 0, es);
67 else 67 else
68 select->add(newOption, toHTMLOptionElement(item(index)), es); 68 select->add(newOption, toHTMLOptionElement(item(index)), es);
69 69
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 { 117 {
118 HTMLSelectElement* base = toHTMLSelectElement(ownerNode()); 118 HTMLSelectElement* base = toHTMLSelectElement(ownerNode());
119 base->remove(index); 119 base->remove(index);
120 return true; 120 return true;
121 } 121 }
122 122
123 bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtr<HT MLOptionElement> value, ExceptionState& es) 123 bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtr<HT MLOptionElement> value, ExceptionState& es)
124 { 124 {
125 HTMLSelectElement* base = toHTMLSelectElement(ownerNode()); 125 HTMLSelectElement* base = toHTMLSelectElement(ownerNode());
126 if (!value) { 126 if (!value) {
127 es.throwDOMException(TypeMismatchError); 127 es.throwUninformativeAndGenericDOMException(TypeMismatchError);
128 return true; 128 return true;
129 } 129 }
130 base->setOption(index, value.get(), es); 130 base->setOption(index, value.get(), es);
131 return true; 131 return true;
132 } 132 }
133 133
134 } //namespace 134 } //namespace
135 135
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMeterElement.cpp ('k') | Source/core/html/HTMLProgressElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698