| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Apple Inc. All rights reserved. | 3 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 #include "config.h" | 32 #include "config.h" |
| 33 #include "core/html/HTMLDataListElement.h" | 33 #include "core/html/HTMLDataListElement.h" |
| 34 | 34 |
| 35 #include "core/HTMLNames.h" | 35 #include "core/HTMLNames.h" |
| 36 #include "core/dom/IdTargetObserverRegistry.h" | 36 #include "core/dom/IdTargetObserverRegistry.h" |
| 37 #include "core/dom/NodeListsNodeData.h" |
| 37 #include "core/frame/UseCounter.h" | 38 #include "core/frame/UseCounter.h" |
| 38 | 39 |
| 39 namespace blink { | 40 namespace blink { |
| 40 | 41 |
| 41 inline HTMLDataListElement::HTMLDataListElement(Document& document) | 42 inline HTMLDataListElement::HTMLDataListElement(Document& document) |
| 42 : HTMLElement(HTMLNames::datalistTag, document) | 43 : HTMLElement(HTMLNames::datalistTag, document) |
| 43 { | 44 { |
| 44 ScriptWrappable::init(this); | 45 ScriptWrappable::init(this); |
| 45 } | 46 } |
| 46 | 47 |
| 47 PassRefPtrWillBeRawPtr<HTMLDataListElement> HTMLDataListElement::create(Document
& document) | 48 PassRefPtrWillBeRawPtr<HTMLDataListElement> HTMLDataListElement::create(Document
& document) |
| 48 { | 49 { |
| 49 UseCounter::count(document, UseCounter::DataListElement); | 50 UseCounter::count(document, UseCounter::DataListElement); |
| 50 return adoptRefWillBeNoop(new HTMLDataListElement(document)); | 51 return adoptRefWillBeNoop(new HTMLDataListElement(document)); |
| 51 } | 52 } |
| 52 | 53 |
| 53 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLDataListElement::options() | 54 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLDataListElement::options() |
| 54 { | 55 { |
| 55 return ensureCachedHTMLCollection(DataListOptions); | 56 return ensureCachedCollection<HTMLCollection>(DataListOptions); |
| 56 } | 57 } |
| 57 | 58 |
| 58 void HTMLDataListElement::childrenChanged(const ChildrenChange& change) | 59 void HTMLDataListElement::childrenChanged(const ChildrenChange& change) |
| 59 { | 60 { |
| 60 HTMLElement::childrenChanged(change); | 61 HTMLElement::childrenChanged(change); |
| 61 if (!change.byParser) | 62 if (!change.byParser) |
| 62 treeScope().idTargetObserverRegistry().notifyObservers(getIdAttribute())
; | 63 treeScope().idTargetObserverRegistry().notifyObservers(getIdAttribute())
; |
| 63 } | 64 } |
| 64 | 65 |
| 65 void HTMLDataListElement::finishParsingChildren() | 66 void HTMLDataListElement::finishParsingChildren() |
| 66 { | 67 { |
| 67 treeScope().idTargetObserverRegistry().notifyObservers(getIdAttribute()); | 68 treeScope().idTargetObserverRegistry().notifyObservers(getIdAttribute()); |
| 68 } | 69 } |
| 69 | 70 |
| 70 void HTMLDataListElement::optionElementChildrenChanged() | 71 void HTMLDataListElement::optionElementChildrenChanged() |
| 71 { | 72 { |
| 72 treeScope().idTargetObserverRegistry().notifyObservers(getIdAttribute()); | 73 treeScope().idTargetObserverRegistry().notifyObservers(getIdAttribute()); |
| 73 } | 74 } |
| 74 | 75 |
| 75 } // namespace blink | 76 } // namespace blink |
| OLD | NEW |