Chromium Code Reviews| 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 19 matching lines...) Expand all Loading... | |
| 30 | 30 |
| 31 #ifndef WebNode_h | 31 #ifndef WebNode_h |
| 32 #define WebNode_h | 32 #define WebNode_h |
| 33 | 33 |
| 34 #include "../platform/WebCommon.h" | 34 #include "../platform/WebCommon.h" |
| 35 #include "../platform/WebPrivatePtr.h" | 35 #include "../platform/WebPrivatePtr.h" |
| 36 #include "../platform/WebString.h" | 36 #include "../platform/WebString.h" |
| 37 #include "../platform/WebVector.h" | 37 #include "../platform/WebVector.h" |
| 38 #include "WebExceptionCode.h" | 38 #include "WebExceptionCode.h" |
| 39 | 39 |
| 40 struct ExportedBoundingBox { | |
| 41 int minX; | |
| 42 int minY; | |
| 43 int maxX; | |
| 44 int maxY; | |
| 45 }; | |
| 46 | |
| 40 namespace blink { | 47 namespace blink { |
| 41 | 48 |
| 42 class Node; | 49 class Node; |
| 43 class WebAXObject; | 50 class WebAXObject; |
| 44 class WebDOMEvent; | 51 class WebDOMEvent; |
| 45 class WebDocument; | 52 class WebDocument; |
| 46 class WebElement; | 53 class WebElement; |
| 47 class WebElementCollection; | 54 class WebElementCollection; |
| 48 class WebNodeList; | 55 class WebNodeList; |
| 49 class WebPluginContainer; | 56 class WebPluginContainer; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 69 BLINK_EXPORT void assign(const WebNode&); | 76 BLINK_EXPORT void assign(const WebNode&); |
| 70 | 77 |
| 71 BLINK_EXPORT bool equals(const WebNode&) const; | 78 BLINK_EXPORT bool equals(const WebNode&) const; |
| 72 // Required for using WebNodes in std maps. Note the order used is | 79 // Required for using WebNodes in std maps. Note the order used is |
| 73 // arbitrary and should not be expected to have any specific meaning. | 80 // arbitrary and should not be expected to have any specific meaning. |
| 74 BLINK_EXPORT bool lessThan(const WebNode&) const; | 81 BLINK_EXPORT bool lessThan(const WebNode&) const; |
| 75 | 82 |
| 76 bool isNull() const { return m_private.isNull(); } | 83 bool isNull() const { return m_private.isNull(); } |
| 77 | 84 |
| 78 BLINK_EXPORT WebNode parentNode() const; | 85 BLINK_EXPORT WebNode parentNode() const; |
| 86 BLINK_EXPORT WebString nodeName() const; | |
| 79 BLINK_EXPORT WebString nodeValue() const; | 87 BLINK_EXPORT WebString nodeValue() const; |
| 80 BLINK_EXPORT WebDocument document() const; | 88 BLINK_EXPORT WebDocument document() const; |
| 81 BLINK_EXPORT WebNode firstChild() const; | 89 BLINK_EXPORT WebNode firstChild() const; |
| 82 BLINK_EXPORT WebNode lastChild() const; | 90 BLINK_EXPORT WebNode lastChild() const; |
| 83 BLINK_EXPORT WebNode previousSibling() const; | 91 BLINK_EXPORT WebNode previousSibling() const; |
| 84 BLINK_EXPORT WebNode nextSibling() const; | 92 BLINK_EXPORT WebNode nextSibling() const; |
| 85 BLINK_EXPORT bool hasChildNodes() const; | 93 BLINK_EXPORT bool hasChildNodes() const; |
| 86 BLINK_EXPORT WebNodeList childNodes(); | 94 BLINK_EXPORT WebNodeList childNodes() const; |
| 87 BLINK_EXPORT bool isLink() const; | 95 BLINK_EXPORT bool isLink() const; |
| 88 BLINK_EXPORT bool isDocumentNode() const; | 96 BLINK_EXPORT bool isDocumentNode() const; |
| 89 BLINK_EXPORT bool isCommentNode() const; | 97 BLINK_EXPORT bool isCommentNode() const; |
| 90 BLINK_EXPORT bool isTextNode() const; | 98 BLINK_EXPORT bool isTextNode() const; |
| 91 BLINK_EXPORT bool isFocusable() const; | 99 BLINK_EXPORT bool isFocusable() const; |
| 92 BLINK_EXPORT bool isContentEditable() const; | 100 BLINK_EXPORT bool isContentEditable() const; |
| 93 BLINK_EXPORT bool isElementNode() const; | 101 BLINK_EXPORT bool isElementNode() const; |
| 94 BLINK_EXPORT void dispatchEvent(const WebDOMEvent&); | 102 BLINK_EXPORT void dispatchEvent(const WebDOMEvent&); |
| 95 BLINK_EXPORT void simulateClick(); | 103 BLINK_EXPORT void simulateClick(); |
| 96 // The argument should be lower-cased. | 104 // The argument should be lower-cased. |
| 97 BLINK_EXPORT WebElementCollection getElementsByHTMLTagName(const WebString&) const; | 105 BLINK_EXPORT WebElementCollection getElementsByHTMLTagName(const WebString&) const; |
| 98 | 106 |
| 107 BLINK_EXPORT ExportedBoundingBox boundingBox() const; | |
|
Sami
2015/10/30 11:12:18
I think we can just use WebElement::boundsInViewpo
| |
| 108 | |
| 99 | 109 |
| 100 BLINK_EXPORT WebElement querySelector(const WebString& selector, WebExceptio nCode&) const; | 110 BLINK_EXPORT WebElement querySelector(const WebString& selector, WebExceptio nCode&) const; |
| 101 BLINK_EXPORT void querySelectorAll(const WebString& selector, WebVector<WebE lement>& results, WebExceptionCode&) const; | 111 BLINK_EXPORT void querySelectorAll(const WebString& selector, WebVector<WebE lement>& results, WebExceptionCode&) const; |
| 102 | 112 |
| 103 // Same as querySelector and querySelectorAll, but ASSERT if an exception | 113 // Same as querySelector and querySelectorAll, but ASSERT if an exception |
| 104 // code would be generated. | 114 // code would be generated. |
| 105 BLINK_EXPORT WebElement querySelector(const WebString& selector) const; | 115 BLINK_EXPORT WebElement querySelector(const WebString& selector) const; |
| 106 BLINK_EXPORT void querySelectorAll(const WebString& selector, WebVector<WebE lement>& results) const; | 116 BLINK_EXPORT void querySelectorAll(const WebString& selector, WebVector<WebE lement>& results) const; |
| 107 | 117 |
| 108 BLINK_EXPORT bool focused() const; | 118 BLINK_EXPORT bool focused() const; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 } | 180 } |
| 171 | 181 |
| 172 inline bool operator<(const WebNode& a, const WebNode& b) | 182 inline bool operator<(const WebNode& a, const WebNode& b) |
| 173 { | 183 { |
| 174 return a.lessThan(b); | 184 return a.lessThan(b); |
| 175 } | 185 } |
| 176 | 186 |
| 177 } // namespace blink | 187 } // namespace blink |
| 178 | 188 |
| 179 #endif | 189 #endif |
| OLD | NEW |