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 "sky/engine/config.h" | 31 #include "sky/engine/config.h" |
32 #include "sky/engine/public/web/WebDocument.h" | 32 #include "sky/engine/public/web/WebDocument.h" |
33 | 33 |
34 #include "sky/engine/bindings/core/v8/Dictionary.h" | 34 #include "sky/engine/bindings2/exception_state.h" |
35 #include "sky/engine/bindings/core/v8/ExceptionState.h" | |
36 #include "sky/engine/bindings/core/v8/ScriptState.h" | |
37 #include "sky/engine/bindings/core/v8/ScriptValue.h" | |
38 #include "sky/engine/core/animation/AnimationTimeline.h" | 35 #include "sky/engine/core/animation/AnimationTimeline.h" |
39 #include "sky/engine/core/css/StyleSheetContents.h" | 36 #include "sky/engine/core/css/StyleSheetContents.h" |
40 #include "sky/engine/core/dom/Document.h" | 37 #include "sky/engine/core/dom/Document.h" |
41 #include "sky/engine/core/dom/Element.h" | 38 #include "sky/engine/core/dom/Element.h" |
42 #include "sky/engine/core/dom/StyleEngine.h" | 39 #include "sky/engine/core/dom/StyleEngine.h" |
43 #include "sky/engine/core/events/Event.h" | 40 #include "sky/engine/core/events/Event.h" |
44 #include "sky/engine/core/html/HTMLElement.h" | 41 #include "sky/engine/core/html/HTMLElement.h" |
45 #include "sky/engine/core/rendering/RenderObject.h" | 42 #include "sky/engine/core/rendering/RenderObject.h" |
46 #include "sky/engine/core/rendering/RenderView.h" | 43 #include "sky/engine/core/rendering/RenderView.h" |
47 #include "sky/engine/public/platform/WebURL.h" | 44 #include "sky/engine/public/platform/WebURL.h" |
48 #include "sky/engine/public/web/WebElement.h" | 45 #include "sky/engine/public/web/WebElement.h" |
49 #include "sky/engine/web/WebLocalFrameImpl.h" | 46 #include "sky/engine/web/WebLocalFrameImpl.h" |
50 #include "sky/engine/wtf/PassRefPtr.h" | 47 #include "sky/engine/wtf/PassRefPtr.h" |
51 #include "v8/include/v8.h" | |
52 | 48 |
53 namespace blink { | 49 namespace blink { |
54 | 50 |
55 WebURL WebDocument::url() const | 51 WebURL WebDocument::url() const |
56 { | 52 { |
57 return constUnwrap<Document>()->url(); | 53 return constUnwrap<Document>()->url(); |
58 } | 54 } |
59 | 55 |
60 WebString WebDocument::encoding() const | 56 WebString WebDocument::encoding() const |
61 { | 57 { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 105 |
110 WebReferrerPolicy WebDocument::referrerPolicy() const | 106 WebReferrerPolicy WebDocument::referrerPolicy() const |
111 { | 107 { |
112 return static_cast<WebReferrerPolicy>(constUnwrap<Document>()->referrerPolic
y()); | 108 return static_cast<WebReferrerPolicy>(constUnwrap<Document>()->referrerPolic
y()); |
113 } | 109 } |
114 | 110 |
115 WebElement WebDocument::createElement(const WebString& tagName) | 111 WebElement WebDocument::createElement(const WebString& tagName) |
116 { | 112 { |
117 TrackExceptionState exceptionState; | 113 TrackExceptionState exceptionState; |
118 WebElement element(unwrap<Document>()->createElement(tagName, exceptionState
)); | 114 WebElement element(unwrap<Document>()->createElement(tagName, exceptionState
)); |
119 if (exceptionState.hadException()) | 115 if (exceptionState.had_exception()) |
120 return WebElement(); | 116 return WebElement(); |
121 return element; | 117 return element; |
122 } | 118 } |
123 | 119 |
124 void WebDocument::pauseAnimationsForTesting(double pauseTime) const { | 120 void WebDocument::pauseAnimationsForTesting(double pauseTime) const { |
125 constUnwrap<Document>()->frame()->view()->updateLayoutAndStyleForPainting(); | 121 constUnwrap<Document>()->frame()->view()->updateLayoutAndStyleForPainting(); |
126 constUnwrap<Document>()->timeline().pauseAnimationsForTesting(pauseTime); | 122 constUnwrap<Document>()->timeline().pauseAnimationsForTesting(pauseTime); |
127 } | 123 } |
128 | 124 |
129 WebDocument::WebDocument(const PassRefPtr<Document>& elem) | 125 WebDocument::WebDocument(const PassRefPtr<Document>& elem) |
130 : WebNode(elem) | 126 : WebNode(elem) |
131 { | 127 { |
132 } | 128 } |
133 | 129 |
134 WebDocument& WebDocument::operator=(const PassRefPtr<Document>& elem) | 130 WebDocument& WebDocument::operator=(const PassRefPtr<Document>& elem) |
135 { | 131 { |
136 m_private = elem; | 132 m_private = elem; |
137 return *this; | 133 return *this; |
138 } | 134 } |
139 | 135 |
140 WebDocument::operator PassRefPtr<Document>() const | 136 WebDocument::operator PassRefPtr<Document>() const |
141 { | 137 { |
142 return toDocument(m_private.get()); | 138 return toDocument(m_private.get()); |
143 } | 139 } |
144 | 140 |
145 } // namespace blink | 141 } // namespace blink |
OLD | NEW |