| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| 11 * notice, this list of conditions and the following disclaimer in the | 11 * notice, this list of conditions and the following disclaimer in the |
| 12 * documentation and/or other materials provided with the distribution. | 12 * documentation and/or other materials provided with the distribution. |
| 13 * | 13 * |
| 14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
| 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef SKY_ENGINE_CORE_FRAME_LOCALDOMWINDOW_H_ | 27 #ifndef SKY_ENGINE_CORE_FRAME_LOCALDOMWINDOW_H_ |
| 28 #define SKY_ENGINE_CORE_FRAME_LOCALDOMWINDOW_H_ | 28 #define SKY_ENGINE_CORE_FRAME_LOCALDOMWINDOW_H_ |
| 29 | 29 |
| 30 #include "sky/engine/bindings/core/v8/Dictionary.h" | |
| 31 #include "sky/engine/bindings/core/v8/SerializedScriptValue.h" | |
| 32 #include "sky/engine/core/events/EventTarget.h" | 30 #include "sky/engine/core/events/EventTarget.h" |
| 33 #include "sky/engine/core/frame/DOMWindowBase64.h" | 31 #include "sky/engine/core/frame/DOMWindowBase64.h" |
| 34 #include "sky/engine/core/frame/FrameDestructionObserver.h" | 32 #include "sky/engine/core/frame/FrameDestructionObserver.h" |
| 35 #include "sky/engine/platform/LifecycleContext.h" | 33 #include "sky/engine/platform/LifecycleContext.h" |
| 36 #include "sky/engine/platform/Supplementable.h" | 34 #include "sky/engine/platform/Supplementable.h" |
| 37 #include "sky/engine/platform/heap/Handle.h" | 35 #include "sky/engine/platform/heap/Handle.h" |
| 38 | 36 |
| 39 #include "sky/engine/wtf/Forward.h" | 37 #include "sky/engine/wtf/Forward.h" |
| 40 | 38 |
| 41 namespace blink { | 39 namespace blink { |
| 42 | 40 |
| 43 class Application; | 41 class Application; |
| 44 class CSSStyleDeclaration; | 42 class CSSStyleDeclaration; |
| 45 class Console; | |
| 46 class DOMSelection; | 43 class DOMSelection; |
| 47 class DOMURL; | 44 class DOMURL; |
| 48 class DOMWindowCSS; | 45 class DOMWindowCSS; |
| 49 class DOMWindowEventQueue; | 46 class DOMWindowEventQueue; |
| 50 class DOMWindowLifecycleNotifier; | 47 class DOMWindowLifecycleNotifier; |
| 51 class DOMWindowProperty; | 48 class DOMWindowProperty; |
| 52 class Database; | 49 class Database; |
| 53 class DatabaseCallback; | 50 class DatabaseCallback; |
| 54 class Document; | 51 class Document; |
| 55 class DocumentInit; | 52 class DocumentInit; |
| 56 class Element; | 53 class Element; |
| 57 class EventListener; | 54 class EventListener; |
| 58 class EventQueue; | 55 class EventQueue; |
| 59 class ExceptionState; | 56 class ExceptionState; |
| 60 class FloatRect; | 57 class FloatRect; |
| 61 class FrameConsole; | 58 class FrameConsole; |
| 62 class IDBFactory; | 59 class IDBFactory; |
| 63 class LocalFrame; | 60 class LocalFrame; |
| 64 class Location; | 61 class Location; |
| 65 class MediaQueryList; | 62 class MediaQueryList; |
| 66 class Node; | 63 class Node; |
| 67 class Page; | 64 class Page; |
| 68 class RequestAnimationFrameCallback; | 65 class RequestAnimationFrameCallback; |
| 69 class ScheduledAction; | 66 class ScheduledAction; |
| 70 class Screen; | 67 class Screen; |
| 71 class ScriptCallStack; | 68 class ScriptCallStack; |
| 72 class SerializedScriptValue; | |
| 73 class StyleMedia; | 69 class StyleMedia; |
| 74 | 70 |
| 75 enum PageshowEventPersistence { | 71 enum PageshowEventPersistence { |
| 76 PageshowEventNotPersisted = 0, | 72 PageshowEventNotPersisted = 0, |
| 77 PageshowEventPersisted = 1 | 73 PageshowEventPersisted = 1 |
| 78 }; | 74 }; |
| 79 | 75 |
| 80 enum SetLocationLocking { LockHistoryBasedOnGestureState, LockHistoryAndBackForw
ardList }; | 76 enum SetLocationLocking { LockHistoryBasedOnGestureState, LockHistoryAndBackForw
ardList }; |
| 81 | 77 |
| 82 class LocalDOMWindow final : public RefCounted<LocalDOMWindow>, public EventTarg
etWithInlineData, public DOMWindowBase64, public FrameDestructionObserver, publi
c Supplementable<LocalDOMWindow>, public LifecycleContext<LocalDOMWindow> { | 78 class LocalDOMWindow final : public RefCounted<LocalDOMWindow>, public EventTarg
etWithInlineData, public DOMWindowBase64, public FrameDestructionObserver, publi
c Supplementable<LocalDOMWindow>, public LifecycleContext<LocalDOMWindow> { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 105 | 101 |
| 106 unsigned pendingUnloadEventListeners() const; | 102 unsigned pendingUnloadEventListeners() const; |
| 107 | 103 |
| 108 static FloatRect adjustWindowRect(LocalFrame&, const FloatRect& pendingChang
es); | 104 static FloatRect adjustWindowRect(LocalFrame&, const FloatRect& pendingChang
es); |
| 109 | 105 |
| 110 // DOM Level 0 | 106 // DOM Level 0 |
| 111 | 107 |
| 112 Screen& screen() const; | 108 Screen& screen() const; |
| 113 | 109 |
| 114 Location& location() const; | 110 Location& location() const; |
| 115 void setLocation(const String& location, LocalDOMWindow* callingWindow, Loca
lDOMWindow* enteredWindow, | 111 void setLocation(const String& location, SetLocationLocking = LockHistoryBas
edOnGestureState); |
| 116 SetLocationLocking = LockHistoryBasedOnGestureState); | |
| 117 | 112 |
| 118 DOMSelection* getSelection(); | 113 DOMSelection* getSelection(); |
| 119 | 114 |
| 120 void focus(ExecutionContext* = 0); | 115 void focus(); |
| 121 | 116 |
| 122 int outerHeight() const; | 117 int outerHeight() const; |
| 123 int outerWidth() const; | 118 int outerWidth() const; |
| 124 int innerHeight() const; | 119 int innerHeight() const; |
| 125 int innerWidth() const; | 120 int innerWidth() const; |
| 126 int screenX() const; | 121 int screenX() const; |
| 127 int screenY() const; | 122 int screenY() const; |
| 128 int screenLeft() const { return screenX(); } | 123 int screenLeft() const { return screenX(); } |
| 129 int screenTop() const { return screenY(); } | 124 int screenTop() const { return screenY(); } |
| 130 | 125 |
| 131 // FIXME(sky): keeping self for now since js-test.html uses it. | 126 // FIXME(sky): keeping self for now since js-test.html uses it. |
| 132 LocalDOMWindow* window() const; | 127 LocalDOMWindow* window() const; |
| 133 | 128 |
| 134 // DOM Level 2 AbstractView Interface | 129 // DOM Level 2 AbstractView Interface |
| 135 | 130 |
| 136 Document* document() const; | 131 Document* document() const; |
| 137 | 132 |
| 138 // CSSOM View Module | 133 // CSSOM View Module |
| 139 | 134 |
| 140 StyleMedia& styleMedia() const; | 135 StyleMedia& styleMedia() const; |
| 141 | 136 |
| 142 // DOM Level 2 Style Interface | 137 // DOM Level 2 Style Interface |
| 143 | 138 |
| 144 PassRefPtr<CSSStyleDeclaration> getComputedStyle(Element*) const; | 139 PassRefPtr<CSSStyleDeclaration> getComputedStyle(Element*) const; |
| 145 | 140 |
| 146 // WebKit extensions | 141 // WebKit extensions |
| 147 | 142 |
| 148 double devicePixelRatio() const; | 143 double devicePixelRatio() const; |
| 149 | 144 |
| 150 Console& console() const; | |
| 151 FrameConsole* frameConsole() const; | 145 FrameConsole* frameConsole() const; |
| 152 | 146 |
| 153 void printErrorMessage(const String&); | 147 void printErrorMessage(const String&); |
| 154 | 148 |
| 155 void moveBy(float x, float y) const; | 149 void moveBy(float x, float y) const; |
| 156 void moveTo(float x, float y) const; | 150 void moveTo(float x, float y) const; |
| 157 | 151 |
| 158 void resizeBy(float x, float y) const; | 152 void resizeBy(float x, float y) const; |
| 159 void resizeTo(float width, float height) const; | 153 void resizeTo(float width, float height) const; |
| 160 | 154 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 RefPtr<Application> m_application; | 223 RefPtr<Application> m_application; |
| 230 RefPtr<Document> m_document; | 224 RefPtr<Document> m_document; |
| 231 | 225 |
| 232 #if ENABLE(ASSERT) | 226 #if ENABLE(ASSERT) |
| 233 bool m_hasBeenReset; | 227 bool m_hasBeenReset; |
| 234 #endif | 228 #endif |
| 235 | 229 |
| 236 HashSet<DOMWindowProperty*> m_properties; | 230 HashSet<DOMWindowProperty*> m_properties; |
| 237 | 231 |
| 238 mutable RefPtr<Screen> m_screen; | 232 mutable RefPtr<Screen> m_screen; |
| 239 mutable RefPtr<Console> m_console; | |
| 240 mutable RefPtr<Location> m_location; | 233 mutable RefPtr<Location> m_location; |
| 241 | 234 |
| 242 mutable RefPtr<DOMWindowCSS> m_css; | 235 mutable RefPtr<DOMWindowCSS> m_css; |
| 243 | 236 |
| 244 RefPtr<DOMWindowEventQueue> m_eventQueue; | 237 RefPtr<DOMWindowEventQueue> m_eventQueue; |
| 245 }; | 238 }; |
| 246 | 239 |
| 247 } // namespace blink | 240 } // namespace blink |
| 248 | 241 |
| 249 #endif // SKY_ENGINE_CORE_FRAME_LOCALDOMWINDOW_H_ | 242 #endif // SKY_ENGINE_CORE_FRAME_LOCALDOMWINDOW_H_ |
| OLD | NEW |