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 20 matching lines...) Expand all Loading... |
31 #include "config.h" | 31 #include "config.h" |
32 #include "public/web/WebElement.h" | 32 #include "public/web/WebElement.h" |
33 | 33 |
34 #include "bindings/core/v8/ExceptionState.h" | 34 #include "bindings/core/v8/ExceptionState.h" |
35 #include "core/HTMLNames.h" | 35 #include "core/HTMLNames.h" |
36 #include "core/dom/Element.h" | 36 #include "core/dom/Element.h" |
37 #include "core/dom/Fullscreen.h" | 37 #include "core/dom/Fullscreen.h" |
38 #include "core/dom/custom/CustomElementProcessingStack.h" | 38 #include "core/dom/custom/CustomElementProcessingStack.h" |
39 #include "core/html/HTMLTextFormControlElement.h" | 39 #include "core/html/HTMLTextFormControlElement.h" |
40 #include "platform/graphics/Image.h" | 40 #include "platform/graphics/Image.h" |
| 41 #include "public/platform/WebFloatRect.h" |
41 #include "public/platform/WebRect.h" | 42 #include "public/platform/WebRect.h" |
42 #include "wtf/PassRefPtr.h" | 43 #include "wtf/PassRefPtr.h" |
43 #include "wtf/text/AtomicString.h" | 44 #include "wtf/text/AtomicString.h" |
44 #include "wtf/text/WTFString.h" | 45 #include "wtf/text/WTFString.h" |
45 | 46 |
46 namespace blink { | 47 namespace blink { |
47 | 48 |
48 using namespace HTMLNames; | 49 using namespace HTMLNames; |
49 | 50 |
50 bool WebElement::isFormControlElement() const | 51 bool WebElement::isFormControlElement() const |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 { | 140 { |
140 Element* element = unwrap<Element>(); | 141 Element* element = unwrap<Element>(); |
141 Fullscreen::from(element->document()).requestFullscreen(*element, Fullscreen
::PrefixedRequest); | 142 Fullscreen::from(element->document()).requestFullscreen(*element, Fullscreen
::PrefixedRequest); |
142 } | 143 } |
143 | 144 |
144 bool WebElement::hasNonEmptyLayoutSize() const | 145 bool WebElement::hasNonEmptyLayoutSize() const |
145 { | 146 { |
146 return constUnwrap<Element>()->hasNonEmptyLayoutSize(); | 147 return constUnwrap<Element>()->hasNonEmptyLayoutSize(); |
147 } | 148 } |
148 | 149 |
149 WebRect WebElement::boundsInViewport() | 150 WebRect WebElement::boundsInViewportInt() |
150 { | 151 { |
151 return unwrap<Element>()->boundsInViewport(); | 152 return unwrap<Element>()->boundsInViewportInt(); |
| 153 } |
| 154 |
| 155 WebFloatRect WebElement::boundsInViewportFloat() |
| 156 { |
| 157 return unwrap<Element>()->boundsInViewportFloat(); |
152 } | 158 } |
153 | 159 |
154 WebImage WebElement::imageContents() | 160 WebImage WebElement::imageContents() |
155 { | 161 { |
156 if (isNull()) | 162 if (isNull()) |
157 return WebImage(); | 163 return WebImage(); |
158 | 164 |
159 return WebImage(unwrap<Element>()->imageContents()); | 165 return WebImage(unwrap<Element>()->imageContents()); |
160 } | 166 } |
161 | 167 |
162 WebElement::WebElement(const PassRefPtrWillBeRawPtr<Element>& elem) | 168 WebElement::WebElement(const PassRefPtrWillBeRawPtr<Element>& elem) |
163 : WebNode(elem) | 169 : WebNode(elem) |
164 { | 170 { |
165 } | 171 } |
166 | 172 |
167 DEFINE_WEB_NODE_TYPE_CASTS(WebElement, isElementNode()); | 173 DEFINE_WEB_NODE_TYPE_CASTS(WebElement, isElementNode()); |
168 | 174 |
169 WebElement& WebElement::operator=(const PassRefPtrWillBeRawPtr<Element>& elem) | 175 WebElement& WebElement::operator=(const PassRefPtrWillBeRawPtr<Element>& elem) |
170 { | 176 { |
171 m_private = elem; | 177 m_private = elem; |
172 return *this; | 178 return *this; |
173 } | 179 } |
174 | 180 |
175 WebElement::operator PassRefPtrWillBeRawPtr<Element>() const | 181 WebElement::operator PassRefPtrWillBeRawPtr<Element>() const |
176 { | 182 { |
177 return toElement(m_private.get()); | 183 return toElement(m_private.get()); |
178 } | 184 } |
179 | 185 |
180 } // namespace blink | 186 } // namespace blink |
OLD | NEW |