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

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

Issue 132923003: Make sure the rootNode of a LiveNodeListBase is always a ContainerNode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 11 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/HTMLOptionsCollection.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) 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 12 matching lines...) Expand all
23 23
24 #include "bindings/v8/ExceptionMessages.h" 24 #include "bindings/v8/ExceptionMessages.h"
25 #include "bindings/v8/ExceptionState.h" 25 #include "bindings/v8/ExceptionState.h"
26 #include "core/dom/ExceptionCode.h" 26 #include "core/dom/ExceptionCode.h"
27 #include "core/dom/NamedNodesCollection.h" 27 #include "core/dom/NamedNodesCollection.h"
28 #include "core/html/HTMLOptionElement.h" 28 #include "core/html/HTMLOptionElement.h"
29 #include "core/html/HTMLSelectElement.h" 29 #include "core/html/HTMLSelectElement.h"
30 30
31 namespace WebCore { 31 namespace WebCore {
32 32
33 HTMLOptionsCollection::HTMLOptionsCollection(Node* select) 33 HTMLOptionsCollection::HTMLOptionsCollection(ContainerNode* select)
34 : HTMLCollection(select, SelectOptions, DoesNotOverrideItemAfter) 34 : HTMLCollection(select, SelectOptions, DoesNotOverrideItemAfter)
35 { 35 {
36 ASSERT(select->hasTagName(HTMLNames::selectTag)); 36 ASSERT(select->hasTagName(HTMLNames::selectTag));
37 ScriptWrappable::init(this); 37 ScriptWrappable::init(this);
38 } 38 }
39 39
40 PassRefPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(Node* select, Co llectionType) 40 PassRefPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(ContainerNode* s elect, CollectionType)
41 { 41 {
42 return adoptRef(new HTMLOptionsCollection(select)); 42 return adoptRef(new HTMLOptionsCollection(select));
43 } 43 }
44 44
45 void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, Exception State& exceptionState) 45 void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, Exception State& exceptionState)
46 { 46 {
47 add(element, length(), exceptionState); 47 add(element, length(), exceptionState);
48 } 48 }
49 49
50 void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index , ExceptionState& exceptionState) 50 void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index , ExceptionState& exceptionState)
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 if (!value) { 127 if (!value) {
128 exceptionState.throwTypeError(ExceptionMessages::failedToSet(String::num ber(index), "HTMLOptionsCollection", "The element provided was not an HTMLOption Element.")); 128 exceptionState.throwTypeError(ExceptionMessages::failedToSet(String::num ber(index), "HTMLOptionsCollection", "The element provided was not an HTMLOption Element."));
129 return true; 129 return true;
130 } 130 }
131 base->setOption(index, value.get(), exceptionState); 131 base->setOption(index, value.get(), exceptionState);
132 return true; 132 return true;
133 } 133 }
134 134
135 } //namespace 135 } //namespace
136 136
OLDNEW
« no previous file with comments | « Source/core/html/HTMLOptionsCollection.h ('k') | Source/core/html/HTMLTableRowsCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698