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 17 matching lines...) Expand all Loading... |
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/bindings/core/v8/Dictionary.h" |
35 #include "sky/engine/bindings/core/v8/ExceptionState.h" | 35 #include "sky/engine/bindings/core/v8/ExceptionState.h" |
36 #include "sky/engine/bindings/core/v8/ScriptState.h" | 36 #include "sky/engine/bindings/core/v8/ScriptState.h" |
37 #include "sky/engine/bindings/core/v8/ScriptValue.h" | 37 #include "sky/engine/bindings/core/v8/ScriptValue.h" |
| 38 #include "sky/engine/core/animation/AnimationTimeline.h" |
38 #include "sky/engine/core/css/StyleSheetContents.h" | 39 #include "sky/engine/core/css/StyleSheetContents.h" |
39 #include "sky/engine/core/dom/Document.h" | 40 #include "sky/engine/core/dom/Document.h" |
40 #include "sky/engine/core/dom/Element.h" | 41 #include "sky/engine/core/dom/Element.h" |
41 #include "sky/engine/core/dom/StyleEngine.h" | 42 #include "sky/engine/core/dom/StyleEngine.h" |
42 #include "sky/engine/core/events/Event.h" | 43 #include "sky/engine/core/events/Event.h" |
43 #include "sky/engine/core/html/HTMLElement.h" | 44 #include "sky/engine/core/html/HTMLElement.h" |
44 #include "sky/engine/core/rendering/RenderObject.h" | 45 #include "sky/engine/core/rendering/RenderObject.h" |
45 #include "sky/engine/core/rendering/RenderView.h" | 46 #include "sky/engine/core/rendering/RenderView.h" |
46 #include "sky/engine/public/platform/WebURL.h" | 47 #include "sky/engine/public/platform/WebURL.h" |
47 #include "sky/engine/public/web/WebElement.h" | 48 #include "sky/engine/public/web/WebElement.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 Document* document = unwrap<Document>(); | 132 Document* document = unwrap<Document>(); |
132 Dictionary dictionary(options, isolate); | 133 Dictionary dictionary(options, isolate); |
133 TrackExceptionState exceptionState; | 134 TrackExceptionState exceptionState; |
134 ScriptValue constructor = document->registerElement(ScriptState::current(iso
late), name, dictionary, exceptionState, CustomElement::EmbedderNames); | 135 ScriptValue constructor = document->registerElement(ScriptState::current(iso
late), name, dictionary, exceptionState, CustomElement::EmbedderNames); |
135 ec = exceptionState.code(); | 136 ec = exceptionState.code(); |
136 if (exceptionState.hadException()) | 137 if (exceptionState.hadException()) |
137 return v8::Handle<v8::Value>(); | 138 return v8::Handle<v8::Value>(); |
138 return constructor.v8Value(); | 139 return constructor.v8Value(); |
139 } | 140 } |
140 | 141 |
| 142 void WebDocument::pauseAnimationsForTesting(double pauseTime) const { |
| 143 constUnwrap<Document>()->frame()->view()->updateLayoutAndStyleForPainting(); |
| 144 constUnwrap<Document>()->timeline().pauseAnimationsForTesting(pauseTime); |
| 145 } |
| 146 |
141 WebDocument::WebDocument(const PassRefPtr<Document>& elem) | 147 WebDocument::WebDocument(const PassRefPtr<Document>& elem) |
142 : WebNode(elem) | 148 : WebNode(elem) |
143 { | 149 { |
144 } | 150 } |
145 | 151 |
146 WebDocument& WebDocument::operator=(const PassRefPtr<Document>& elem) | 152 WebDocument& WebDocument::operator=(const PassRefPtr<Document>& elem) |
147 { | 153 { |
148 m_private = elem; | 154 m_private = elem; |
149 return *this; | 155 return *this; |
150 } | 156 } |
151 | 157 |
152 WebDocument::operator PassRefPtr<Document>() const | 158 WebDocument::operator PassRefPtr<Document>() const |
153 { | 159 { |
154 return toDocument(m_private.get()); | 160 return toDocument(m_private.get()); |
155 } | 161 } |
156 | 162 |
157 } // namespace blink | 163 } // namespace blink |
OLD | NEW |