| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "WebDocument.h" | 32 #include "WebDocument.h" |
| 33 | 33 |
| 34 #include "public/platform/WebURL.h" | 34 #include "WebAXObject.h" |
| 35 #include "wtf/PassRefPtr.h" | |
| 36 #include "WebAccessibilityObject.h" | |
| 37 #include "WebDOMEvent.h" | 35 #include "WebDOMEvent.h" |
| 38 #include "WebDocumentType.h" | 36 #include "WebDocumentType.h" |
| 39 #include "WebElement.h" | 37 #include "WebElement.h" |
| 40 #include "WebFormElement.h" | 38 #include "WebFormElement.h" |
| 41 #include "WebFrameImpl.h" | 39 #include "WebFrameImpl.h" |
| 42 #include "WebNodeCollection.h" | 40 #include "WebNodeCollection.h" |
| 43 #include "WebNodeList.h" | 41 #include "WebNodeList.h" |
| 44 #include "bindings/v8/Dictionary.h" | 42 #include "bindings/v8/Dictionary.h" |
| 45 #include "bindings/v8/ExceptionState.h" | 43 #include "bindings/v8/ExceptionState.h" |
| 46 #include "bindings/v8/ScriptState.h" | 44 #include "bindings/v8/ScriptState.h" |
| 47 #include "bindings/v8/ScriptValue.h" | 45 #include "bindings/v8/ScriptValue.h" |
| 48 #include "core/accessibility/AXObjectCache.h" | 46 #include "core/accessibility/AXObjectCache.h" |
| 49 #include "core/css/CSSParserMode.h" | 47 #include "core/css/CSSParserMode.h" |
| 50 #include "core/css/StyleSheetContents.h" | 48 #include "core/css/StyleSheetContents.h" |
| 51 #include "core/dom/Document.h" | 49 #include "core/dom/Document.h" |
| 52 #include "core/dom/DocumentType.h" | 50 #include "core/dom/DocumentType.h" |
| 53 #include "core/dom/Element.h" | 51 #include "core/dom/Element.h" |
| 54 #include "core/dom/FullscreenElementStack.h" | 52 #include "core/dom/FullscreenElementStack.h" |
| 55 #include "core/dom/NodeList.h" | 53 #include "core/dom/NodeList.h" |
| 56 #include "core/dom/StyleSheetCollections.h" | 54 #include "core/dom/StyleSheetCollections.h" |
| 57 #include "core/html/HTMLAllCollection.h" | 55 #include "core/html/HTMLAllCollection.h" |
| 58 #include "core/html/HTMLBodyElement.h" | 56 #include "core/html/HTMLBodyElement.h" |
| 59 #include "core/html/HTMLCollection.h" | 57 #include "core/html/HTMLCollection.h" |
| 60 #include "core/html/HTMLElement.h" | 58 #include "core/html/HTMLElement.h" |
| 61 #include "core/html/HTMLFormElement.h" | 59 #include "core/html/HTMLFormElement.h" |
| 62 #include "core/html/HTMLHeadElement.h" | 60 #include "core/html/HTMLHeadElement.h" |
| 63 #include "core/loader/DocumentLoader.h" | 61 #include "core/loader/DocumentLoader.h" |
| 64 #include "core/rendering/RenderObject.h" | 62 #include "core/rendering/RenderObject.h" |
| 63 #include "public/platform/WebURL.h" |
| 65 #include "weborigin/SecurityOrigin.h" | 64 #include "weborigin/SecurityOrigin.h" |
| 65 #include "wtf/PassRefPtr.h" |
| 66 #include <v8.h> | 66 #include <v8.h> |
| 67 | 67 |
| 68 using namespace WebCore; | 68 using namespace WebCore; |
| 69 | 69 |
| 70 namespace WebKit { | 70 namespace WebKit { |
| 71 | 71 |
| 72 WebURL WebDocument::url() const | 72 WebURL WebDocument::url() const |
| 73 { | 73 { |
| 74 return constUnwrap<Document>()->url(); | 74 return constUnwrap<Document>()->url(); |
| 75 } | 75 } |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 243 |
| 244 WebElement WebDocument::createElement(const WebString& tagName) | 244 WebElement WebDocument::createElement(const WebString& tagName) |
| 245 { | 245 { |
| 246 TrackExceptionState es; | 246 TrackExceptionState es; |
| 247 WebElement element(unwrap<Document>()->createElement(tagName, es)); | 247 WebElement element(unwrap<Document>()->createElement(tagName, es)); |
| 248 if (es.hadException()) | 248 if (es.hadException()) |
| 249 return WebElement(); | 249 return WebElement(); |
| 250 return element; | 250 return element; |
| 251 } | 251 } |
| 252 | 252 |
| 253 WebAccessibilityObject WebDocument::accessibilityObject() const | 253 WebAXObject WebDocument::accessibilityObject() const |
| 254 { | 254 { |
| 255 const Document* document = constUnwrap<Document>(); | 255 const Document* document = constUnwrap<Document>(); |
| 256 return WebAccessibilityObject( | 256 return WebAXObject(document->axObjectCache()->getOrCreate(document->renderer
())); |
| 257 document->axObjectCache()->getOrCreate(document->renderer())); | |
| 258 } | 257 } |
| 259 | 258 |
| 260 WebAccessibilityObject WebDocument::accessibilityObjectFromID(int axID) const | 259 WebAXObject WebDocument::accessibilityObjectFromID(int axID) const |
| 261 { | 260 { |
| 262 const Document* document = constUnwrap<Document>(); | 261 const Document* document = constUnwrap<Document>(); |
| 263 return WebAccessibilityObject( | 262 return WebAXObject(document->axObjectCache()->objectFromAXID(axID)); |
| 264 document->axObjectCache()->objectFromAXID(axID)); | |
| 265 } | 263 } |
| 266 | 264 |
| 267 WebVector<WebDraggableRegion> WebDocument::draggableRegions() const | 265 WebVector<WebDraggableRegion> WebDocument::draggableRegions() const |
| 268 { | 266 { |
| 269 WebVector<WebDraggableRegion> draggableRegions; | 267 WebVector<WebDraggableRegion> draggableRegions; |
| 270 const Document* document = constUnwrap<Document>(); | 268 const Document* document = constUnwrap<Document>(); |
| 271 if (document->hasAnnotatedRegions()) { | 269 if (document->hasAnnotatedRegions()) { |
| 272 const Vector<AnnotatedRegionValue>& regions = document->annotatedRegions
(); | 270 const Vector<AnnotatedRegionValue>& regions = document->annotatedRegions
(); |
| 273 draggableRegions = WebVector<WebDraggableRegion>(regions.size()); | 271 draggableRegions = WebVector<WebDraggableRegion>(regions.size()); |
| 274 for (size_t i = 0; i < regions.size(); i++) { | 272 for (size_t i = 0; i < regions.size(); i++) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 302 m_private = elem; | 300 m_private = elem; |
| 303 return *this; | 301 return *this; |
| 304 } | 302 } |
| 305 | 303 |
| 306 WebDocument::operator PassRefPtr<Document>() const | 304 WebDocument::operator PassRefPtr<Document>() const |
| 307 { | 305 { |
| 308 return toDocument(m_private.get()); | 306 return toDocument(m_private.get()); |
| 309 } | 307 } |
| 310 | 308 |
| 311 } // namespace WebKit | 309 } // namespace WebKit |
| OLD | NEW |