| 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 #ifndef WEB_API_NODE_H |
| 14 #define WEB_API_NODE_H |
| 15 |
| 16 #include "bindings/core/v8/NodeOrString.h" |
| 17 #include "core/dom/ChildNode.h" |
| 18 #include "web/api/event_target.h" |
| 19 |
| 20 namespace blink { |
| 21 class Element; |
| 22 class Node; |
| 23 } |
| 24 |
| 25 namespace web { |
| 26 |
| 27 class Element; |
| 28 |
| 29 class Node : public EventTarget { |
| 30 public: |
| 31 virtual ~Node() = default; |
| 32 |
| 33 static Node* Create(blink::Node* node); |
| 34 |
| 35 // readonly attribute DOMString nodeName; |
| 36 String GetNodeName() const; |
| 37 |
| 38 // readonly attribute Element? parentElement; |
| 39 Element* GetParentElement() const; |
| 40 |
| 41 // void before((Node or DOMString) ... nodes); |
| 42 template<typename... Args> |
| 43 void Before(Args... args) { |
| 44 blink::NodeOrString array[] = { CreateNodeOrString(args)... }; |
| 45 blink::HeapVector<blink::NodeOrString> vector(sizeof...(args)); |
| 46 for (auto item : array) |
| 47 vector.push_back(item); |
| 48 blink::ChildNode::before(*node(), vector, ASSERT_NO_EXCEPTION); |
| 49 } |
| 50 |
| 51 protected: |
| 52 explicit Node(blink::Node* node); |
| 53 blink::Node* node() const; |
| 54 |
| 55 private: |
| 56 blink::NodeOrString CreateNodeOrString(String) const; |
| 57 blink::NodeOrString CreateNodeOrString(Node*) const; |
| 58 }; |
| 59 |
| 60 } // namespace web |
| 61 |
| 62 #endif // WEB_API_NODE_H |
| OLD | NEW |