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 21 matching lines...) Expand all Loading... |
32 #define WebElement_h | 32 #define WebElement_h |
33 | 33 |
34 #include "../platform/WebImage.h" | 34 #include "../platform/WebImage.h" |
35 #include "WebNode.h" | 35 #include "WebNode.h" |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 class Element; | 39 class Element; |
40 struct WebRect; | 40 struct WebRect; |
41 | 41 |
42 // Provides access to some properties of a DOM element node. | 42 // Provides access to some properties of a DOM element node. |
43 class WebElement : public WebNode { | 43 class WebElement : public WebNode { |
44 public: | 44 public: |
45 WebElement() : WebNode() { } | 45 WebElement() : WebNode() { } |
46 WebElement(const WebElement& e) : WebNode(e) { } | 46 WebElement(const WebElement& e) : WebNode(e) { } |
47 | 47 |
48 WebElement& operator=(const WebElement& e) { WebNode::assign(e); return
*this; } | 48 WebElement& operator=(const WebElement& e) { WebNode::assign(e); return *thi
s; } |
49 void assign(const WebElement& e) { WebNode::assign(e); } | 49 void assign(const WebElement& e) { WebNode::assign(e); } |
50 | 50 |
51 BLINK_EXPORT bool isFormControlElement() const; | 51 BLINK_EXPORT bool isFormControlElement() const; |
52 BLINK_EXPORT bool isTextFormControlElement() const; | 52 BLINK_EXPORT bool isTextFormControlElement() const; |
53 // Returns the qualified name, which may contain a prefix and a colon. | 53 // Returns the qualified name, which may contain a prefix and a colon. |
54 BLINK_EXPORT WebString tagName() const; | 54 BLINK_EXPORT WebString tagName() const; |
55 // Check if this element has the specified local tag name, and the HTML | 55 // Check if this element has the specified local tag name, and the HTML |
56 // namespace. Tag name matching is case-insensitive. | 56 // namespace. Tag name matching is case-insensitive. |
57 BLINK_EXPORT bool hasHTMLTagName(const WebString&) const; | 57 BLINK_EXPORT bool hasHTMLTagName(const WebString&) const; |
58 BLINK_EXPORT bool hasAttribute(const WebString&) const; | 58 BLINK_EXPORT bool hasAttribute(const WebString&) const; |
59 BLINK_EXPORT void removeAttribute(const WebString&); | 59 BLINK_EXPORT void removeAttribute(const WebString&); |
60 BLINK_EXPORT WebString getAttribute(const WebString&) const; | 60 BLINK_EXPORT WebString getAttribute(const WebString&) const; |
61 BLINK_EXPORT bool setAttribute(const WebString& name, const WebString& v
alue); | 61 BLINK_EXPORT bool setAttribute(const WebString& name, const WebString& value
); |
62 BLINK_EXPORT WebString innerText(); | 62 BLINK_EXPORT WebString innerText(); |
63 BLINK_EXPORT void requestFullScreen(); | 63 BLINK_EXPORT void requestFullScreen(); |
64 BLINK_EXPORT WebString attributeLocalName(unsigned index) const; | 64 BLINK_EXPORT WebString attributeLocalName(unsigned index) const; |
65 BLINK_EXPORT WebString attributeValue(unsigned index) const; | 65 BLINK_EXPORT WebString attributeValue(unsigned index) const; |
66 BLINK_EXPORT unsigned attributeCount() const; | 66 BLINK_EXPORT unsigned attributeCount() const; |
67 BLINK_EXPORT WebNode shadowRoot() const; | 67 BLINK_EXPORT WebNode shadowRoot() const; |
68 | 68 |
69 // Returns the language code specified for this element. This attribute | 69 // Returns the language code specified for this element. This attribute |
70 // is inherited, so the returned value is drawn from the closest parent | 70 // is inherited, so the returned value is drawn from the closest parent |
71 // element that has the lang attribute set, or from the HTTP | 71 // element that has the lang attribute set, or from the HTTP |
72 // "Content-Language" header as a fallback. | 72 // "Content-Language" header as a fallback. |
73 BLINK_EXPORT WebString computeInheritedLanguage() const; | 73 BLINK_EXPORT WebString computeInheritedLanguage() const; |
74 | 74 |
75 // Returns the bounds of the element in viewport space. The bounds | 75 // Returns the bounds of the element in viewport space. The bounds |
76 // have been adjusted to include any transformations. This view is | 76 // have been adjusted to include any transformations. This view is |
77 // also called the Root View in WebKit. | 77 // also called the Root View in Blink. |
78 // This function will update the layout if required. | 78 // This function will update the layout if required. |
79 BLINK_EXPORT WebRect boundsInViewportSpace(); | 79 BLINK_EXPORT WebRect boundsInViewportSpace(); |
80 | 80 |
81 // Returns the image contents of this element or a null WebImage | 81 // Returns the image contents of this element or a null WebImage |
82 // if there isn't any. | 82 // if there isn't any. |
83 BLINK_EXPORT WebImage imageContents(); | 83 BLINK_EXPORT WebImage imageContents(); |
84 | 84 |
85 #if BLINK_IMPLEMENTATION | 85 #if BLINK_IMPLEMENTATION |
86 WebElement(const PassRefPtrWillBeRawPtr<Element>&); | 86 WebElement(const PassRefPtrWillBeRawPtr<Element>&); |
87 WebElement& operator=(const PassRefPtrWillBeRawPtr<Element>&); | 87 WebElement& operator=(const PassRefPtrWillBeRawPtr<Element>&); |
88 operator PassRefPtrWillBeRawPtr<Element>() const; | 88 operator PassRefPtrWillBeRawPtr<Element>() const; |
89 #endif | 89 #endif |
90 }; | 90 }; |
91 | 91 |
92 } // namespace blink | 92 } // namespace blink |
93 | 93 |
94 #endif | 94 #endif |
OLD | NEW |