OLD | NEW |
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 ec = TYPE_MISMATCH_ERR; | 52 ec = TYPE_MISMATCH_ERR; |
53 return; | 53 return; |
54 } | 54 } |
55 | 55 |
56 if (index < -1) { | 56 if (index < -1) { |
57 ec = INDEX_SIZE_ERR; | 57 ec = INDEX_SIZE_ERR; |
58 return; | 58 return; |
59 } | 59 } |
60 | 60 |
61 ec = 0; | 61 ec = 0; |
62 HTMLSelectElement* select = toHTMLSelectElement(ownerNode()); | 62 Handle<HTMLSelectElement> select = toHTMLSelectElement(ownerNode()); |
63 | 63 |
64 if (index == -1 || unsigned(index) >= length()) | 64 if (index == -1 || unsigned(index) >= length()) |
65 select->add(newOption, 0, ec); | 65 select->add(newOption, 0, ec); |
66 else | 66 else |
67 select->add(newOption, static_cast<HTMLOptionElement*>(item(index)), ec)
; | 67 select->add(newOption, static_cast<HTMLOptionElement*>(item(index)), ec)
; |
68 | 68 |
69 ASSERT(!ec); | 69 ASSERT(!ec); |
70 } | 70 } |
71 | 71 |
72 void HTMLOptionsCollection::remove(int index) | 72 void HTMLOptionsCollection::remove(int index) |
(...skipping 10 matching lines...) Expand all Loading... |
83 { | 83 { |
84 toHTMLSelectElement(ownerNode())->setSelectedIndex(index); | 84 toHTMLSelectElement(ownerNode())->setSelectedIndex(index); |
85 } | 85 } |
86 | 86 |
87 void HTMLOptionsCollection::setLength(unsigned length, ExceptionCode& ec) | 87 void HTMLOptionsCollection::setLength(unsigned length, ExceptionCode& ec) |
88 { | 88 { |
89 toHTMLSelectElement(ownerNode())->setLength(length, ec); | 89 toHTMLSelectElement(ownerNode())->setLength(length, ec); |
90 } | 90 } |
91 | 91 |
92 } //namespace | 92 } //namespace |
OLD | NEW |