| 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 26 matching lines...) Expand all Loading... |
| 37 #include "bindings/core/v8/ScriptValue.h" | 37 #include "bindings/core/v8/ScriptValue.h" |
| 38 #include "core/css/StyleSheetContents.h" | 38 #include "core/css/StyleSheetContents.h" |
| 39 #include "core/dom/Document.h" | 39 #include "core/dom/Document.h" |
| 40 #include "core/dom/Element.h" | 40 #include "core/dom/Element.h" |
| 41 #include "core/dom/StyleEngine.h" | 41 #include "core/dom/StyleEngine.h" |
| 42 #include "core/events/Event.h" | 42 #include "core/events/Event.h" |
| 43 #include "core/html/HTMLElement.h" | 43 #include "core/html/HTMLElement.h" |
| 44 #include "core/rendering/RenderObject.h" | 44 #include "core/rendering/RenderObject.h" |
| 45 #include "core/rendering/RenderView.h" | 45 #include "core/rendering/RenderView.h" |
| 46 #include "public/platform/WebURL.h" | 46 #include "public/platform/WebURL.h" |
| 47 #include "public/web/WebDOMEvent.h" | |
| 48 #include "public/web/WebDocumentType.h" | |
| 49 #include "public/web/WebElement.h" | 47 #include "public/web/WebElement.h" |
| 50 #include "web/WebLocalFrameImpl.h" | 48 #include "web/WebLocalFrameImpl.h" |
| 51 #include "wtf/PassRefPtr.h" | 49 #include "wtf/PassRefPtr.h" |
| 52 #include <v8.h> | 50 #include <v8.h> |
| 53 | 51 |
| 54 namespace blink { | 52 namespace blink { |
| 55 | 53 |
| 56 WebURL WebDocument::url() const | 54 WebURL WebDocument::url() const |
| 57 { | 55 { |
| 58 return constUnwrap<Document>()->url(); | 56 return constUnwrap<Document>()->url(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 WebElement WebDocument::getElementById(const WebString& id) const | 104 WebElement WebDocument::getElementById(const WebString& id) const |
| 107 { | 105 { |
| 108 return WebElement(constUnwrap<Document>()->getElementById(id)); | 106 return WebElement(constUnwrap<Document>()->getElementById(id)); |
| 109 } | 107 } |
| 110 | 108 |
| 111 WebElement WebDocument::focusedElement() const | 109 WebElement WebDocument::focusedElement() const |
| 112 { | 110 { |
| 113 return WebElement(constUnwrap<Document>()->focusedElement()); | 111 return WebElement(constUnwrap<Document>()->focusedElement()); |
| 114 } | 112 } |
| 115 | 113 |
| 116 WebDOMEvent WebDocument::createEvent(const WebString& eventType) | |
| 117 { | |
| 118 TrackExceptionState exceptionState; | |
| 119 WebDOMEvent event(unwrap<Document>()->createEvent(eventType, exceptionState)
); | |
| 120 if (exceptionState.hadException()) | |
| 121 return WebDOMEvent(); | |
| 122 return event; | |
| 123 } | |
| 124 | |
| 125 WebReferrerPolicy WebDocument::referrerPolicy() const | 114 WebReferrerPolicy WebDocument::referrerPolicy() const |
| 126 { | 115 { |
| 127 return static_cast<WebReferrerPolicy>(constUnwrap<Document>()->referrerPolic
y()); | 116 return static_cast<WebReferrerPolicy>(constUnwrap<Document>()->referrerPolic
y()); |
| 128 } | 117 } |
| 129 | 118 |
| 130 WebElement WebDocument::createElement(const WebString& tagName) | 119 WebElement WebDocument::createElement(const WebString& tagName) |
| 131 { | 120 { |
| 132 TrackExceptionState exceptionState; | 121 TrackExceptionState exceptionState; |
| 133 WebElement element(unwrap<Document>()->createElement(tagName, exceptionState
)); | 122 WebElement element(unwrap<Document>()->createElement(tagName, exceptionState
)); |
| 134 if (exceptionState.hadException()) | 123 if (exceptionState.hadException()) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 159 m_private = elem; | 148 m_private = elem; |
| 160 return *this; | 149 return *this; |
| 161 } | 150 } |
| 162 | 151 |
| 163 WebDocument::operator PassRefPtr<Document>() const | 152 WebDocument::operator PassRefPtr<Document>() const |
| 164 { | 153 { |
| 165 return toDocument(m_private.get()); | 154 return toDocument(m_private.get()); |
| 166 } | 155 } |
| 167 | 156 |
| 168 } // namespace blink | 157 } // namespace blink |
| OLD | NEW |