| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // This file has been auto-generated by code_generator_web_module.py. |
| 6 // DO NOT MODIFY! |
| 7 |
| 8 // This file has been generated from the Jinja2 template in |
| 9 // third_party/WebKit/Source/bindings/templates/web_module_interface.h.tmpl |
| 10 |
| 11 // clang-format off |
| 12 |
| 13 #include "web/api/element.h" |
| 14 |
| 15 #include "core/dom/Element.h" |
| 16 #include "core/dom/ParentNode.h" |
| 17 |
| 18 namespace web { |
| 19 |
| 20 Element::Element(blink::Element* element) : Node(element) {} |
| 21 |
| 22 Element* Element::Create(blink::Element* element) { |
| 23 return element ? new Element(element) : nullptr; |
| 24 } |
| 25 |
| 26 String Element::GetLocalName() const { |
| 27 return element()->localName(); |
| 28 } |
| 29 |
| 30 String Element::GetId() const { |
| 31 return element()->getIdAttribute(); |
| 32 } |
| 33 |
| 34 void Element::SetId(AtomicString id) { |
| 35 element()->setIdAttribute(id); |
| 36 } |
| 37 |
| 38 Element* Element::GetFirstElementChild() const { |
| 39 return Element::Create(blink::ParentNode::firstElementChild(*element())); |
| 40 } |
| 41 |
| 42 blink::Element* Element::element() const { |
| 43 return blink::toElement(node()); |
| 44 } |
| 45 |
| 46 } // namespace web |
| OLD | NEW |