| 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/node.h" |
| 14 |
| 15 #include "core/dom/ChildNode.h" |
| 16 #include "core/dom/Element.h" |
| 17 #include "core/dom/Node.h" |
| 18 #include "web/api/element.h" |
| 19 |
| 20 namespace web { |
| 21 |
| 22 Node::Node(blink::Node* node) : EventTarget(node) {} |
| 23 |
| 24 Node* Node::Create(blink::Node* node) { |
| 25 return node ? new Node(node) : nullptr; |
| 26 } |
| 27 |
| 28 String Node::GetNodeName() const { |
| 29 return node()->nodeName(); |
| 30 } |
| 31 |
| 32 Element* Node::GetParentElement() const { |
| 33 return Element::Create(node()->parentElement()); |
| 34 } |
| 35 |
| 36 blink::Node* Node::node() const { |
| 37 // toNode API is inconsistent with toElement, will probably need a whitelist |
| 38 // of exceptions in real codegen. |
| 39 return event_target()->toNode(); |
| 40 } |
| 41 |
| 42 blink::NodeOrString Node::CreateNodeOrString(String string) const { |
| 43 return blink::NodeOrString::fromString(string); |
| 44 } |
| 45 blink::NodeOrString Node::CreateNodeOrString(Node* node) const { |
| 46 return blink::NodeOrString::fromNode(node->node()); |
| 47 } |
| 48 |
| 49 } // namespace web |
| OLD | NEW |