OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 #ifndef HEADLESS_PUBLIC_WEB_NODE_H_ |
| 6 #define HEADLESS_PUBLIC_WEB_NODE_H_ |
| 7 |
| 8 #include "third_party/WebKit/public/web/WebNode.h" |
| 9 |
| 10 namespace headless { |
| 11 |
| 12 class WebElement; |
| 13 class WebDocument; |
| 14 |
| 15 class WebNode { |
| 16 public: |
| 17 WebNode(const blink::WebNode&); |
| 18 |
| 19 std::string Value() const; |
| 20 |
| 21 WebNode Parent() const; |
| 22 WebNode FirstChild() const; |
| 23 WebNode LastChild() const; |
| 24 WebNode NextSibling() const; |
| 25 WebNode PreviousSibling() const; |
| 26 bool HasChildNodes() const; |
| 27 |
| 28 bool IsDocument() const; |
| 29 bool IsElement() const; |
| 30 |
| 31 WebElement AsElement() const; |
| 32 WebDocument AsDocument() const; |
| 33 |
| 34 inline bool operator==(const WebNode& other) const { |
| 35 return web_node() == other.web_node(); |
| 36 } |
| 37 inline bool operator!=(const WebNode& other) const { |
| 38 return !(*this == other); |
| 39 } |
| 40 |
| 41 protected: |
| 42 blink::WebNode& web_node(); |
| 43 const blink::WebNode& web_node() const; |
| 44 |
| 45 blink::WebNode web_node_; |
| 46 }; |
| 47 |
| 48 } // namespace headless |
| 49 |
| 50 #endif // HEADLESS_PUBLIC_WEB_NODE_H_ |
OLD | NEW |