| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "public/platform/WebPrivatePtr.h" | 35 #include "public/platform/WebPrivatePtr.h" |
| 36 #include "public/platform/WebString.h" | 36 #include "public/platform/WebString.h" |
| 37 #include "public/platform/WebVector.h" | 37 #include "public/platform/WebVector.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 class Node; | 41 class Node; |
| 42 class WebDocument; | 42 class WebDocument; |
| 43 class WebElement; | 43 class WebElement; |
| 44 class WebElementCollection; | 44 class WebElementCollection; |
| 45 class WebFrame; |
| 45 class WebPluginContainer; | 46 class WebPluginContainer; |
| 46 | 47 |
| 47 // Provides access to some properties of a DOM node. | 48 // Provides access to some properties of a DOM node. |
| 48 // Note that the class design requires that neither this class nor any of its | 49 // Note that the class design requires that neither this class nor any of its |
| 49 // subclasses have any virtual methods (other than the destructor), so that it | 50 // subclasses have any virtual methods (other than the destructor), so that it |
| 50 // is possible to safely static_cast an instance of one class to the appropriate | 51 // is possible to safely static_cast an instance of one class to the appropriate |
| 51 // subclass based on the actual type of the wrapped blink::Node. For the same | 52 // subclass based on the actual type of the wrapped blink::Node. For the same |
| 52 // reason, subclasses must not add any additional data members. | 53 // reason, subclasses must not add any additional data members. |
| 53 class BLINK_EXPORT WebNode { | 54 class BLINK_EXPORT WebNode { |
| 54 public: | 55 public: |
| 55 virtual ~WebNode(); | 56 virtual ~WebNode(); |
| 56 | 57 |
| 57 WebNode(); | 58 WebNode(); |
| 58 WebNode(const WebNode&); | 59 WebNode(const WebNode&); |
| 59 WebNode& operator=(const WebNode&); | 60 WebNode& operator=(const WebNode&); |
| 60 | 61 |
| 61 void Reset(); | 62 void Reset(); |
| 62 void Assign(const WebNode&); | 63 void Assign(const WebNode&); |
| 63 | 64 |
| 64 bool Equals(const WebNode&) const; | 65 bool Equals(const WebNode&) const; |
| 65 // Required for using WebNodes in std maps. Note the order used is | 66 // Required for using WebNodes in std maps. Note the order used is |
| 66 // arbitrary and should not be expected to have any specific meaning. | 67 // arbitrary and should not be expected to have any specific meaning. |
| 67 bool LessThan(const WebNode&) const; | 68 bool LessThan(const WebNode&) const; |
| 68 | 69 |
| 69 bool IsNull() const; | 70 bool IsNull() const; |
| 70 | 71 |
| 71 WebNode ParentNode() const; | 72 WebNode ParentNode() const; |
| 72 WebString NodeValue() const; | 73 WebString NodeValue() const; |
| 73 WebDocument GetDocument() const; | 74 WebDocument GetDocument() const; |
| 75 WebFrame* ContentFrame() const; |
| 74 WebNode FirstChild() const; | 76 WebNode FirstChild() const; |
| 75 WebNode LastChild() const; | 77 WebNode LastChild() const; |
| 76 WebNode PreviousSibling() const; | 78 WebNode PreviousSibling() const; |
| 77 WebNode NextSibling() const; | 79 WebNode NextSibling() const; |
| 78 | 80 |
| 79 bool IsLink() const; | 81 bool IsLink() const; |
| 80 bool IsDocumentNode() const; | 82 bool IsDocumentNode() const; |
| 81 bool IsDocumentTypeNode() const; | 83 bool IsDocumentTypeNode() const; |
| 82 bool IsCommentNode() const; | 84 bool IsCommentNode() const; |
| 83 bool IsTextNode() const; | 85 bool IsTextNode() const; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return !(a == b); | 158 return !(a == b); |
| 157 } | 159 } |
| 158 | 160 |
| 159 inline bool operator<(const WebNode& a, const WebNode& b) { | 161 inline bool operator<(const WebNode& a, const WebNode& b) { |
| 160 return a.LessThan(b); | 162 return a.LessThan(b); |
| 161 } | 163 } |
| 162 | 164 |
| 163 } // namespace blink | 165 } // namespace blink |
| 164 | 166 |
| 165 #endif | 167 #endif |
| OLD | NEW |