OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Simon Hausmann <hausmann@kde.org> | 5 * 2000 Simon Hausmann <hausmann@kde.org> |
6 * 2000 Stefan Schimanski <1Stein@gmx.de> | 6 * 2000 Stefan Schimanski <1Stein@gmx.de> |
7 * 2001 George Staikos <staikos@kde.org> | 7 * 2001 George Staikos <staikos@kde.org> |
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> | 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> |
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "bindings/v8/ScriptController.h" | 33 #include "bindings/v8/ScriptController.h" |
34 #include "core/dom/DocumentType.h" | 34 #include "core/dom/DocumentType.h" |
35 #include "core/editing/Editor.h" | 35 #include "core/editing/Editor.h" |
36 #include "core/editing/FrameSelection.h" | 36 #include "core/editing/FrameSelection.h" |
37 #include "core/editing/InputMethodController.h" | 37 #include "core/editing/InputMethodController.h" |
38 #include "core/editing/SpellChecker.h" | 38 #include "core/editing/SpellChecker.h" |
39 #include "core/editing/htmlediting.h" | 39 #include "core/editing/htmlediting.h" |
40 #include "core/editing/markup.h" | 40 #include "core/editing/markup.h" |
41 #include "core/events/Event.h" | 41 #include "core/events/Event.h" |
42 #include "core/fetch/ResourceFetcher.h" | 42 #include "core/fetch/ResourceFetcher.h" |
43 #include "core/frame/DOMWindow.h" | 43 #include "core/frame/LocalDOMWindow.h" |
44 #include "core/frame/EventHandlerRegistry.h" | 44 #include "core/frame/EventHandlerRegistry.h" |
45 #include "core/frame/FrameConsole.h" | 45 #include "core/frame/FrameConsole.h" |
46 #include "core/frame/FrameHost.h" | 46 #include "core/frame/FrameHost.h" |
47 #include "core/frame/FrameView.h" | 47 #include "core/frame/FrameView.h" |
48 #include "core/frame/Settings.h" | 48 #include "core/frame/Settings.h" |
49 #include "core/html/HTMLFrameElementBase.h" | 49 #include "core/html/HTMLFrameElementBase.h" |
50 #include "core/inspector/InspectorInstrumentation.h" | 50 #include "core/inspector/InspectorInstrumentation.h" |
51 #include "core/loader/FrameLoaderClient.h" | 51 #include "core/loader/FrameLoaderClient.h" |
52 #include "core/page/Chrome.h" | 52 #include "core/page/Chrome.h" |
53 #include "core/page/EventHandler.h" | 53 #include "core/page/EventHandler.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } | 134 } |
135 | 135 |
136 void LocalFrame::setView(PassRefPtr<FrameView> view) | 136 void LocalFrame::setView(PassRefPtr<FrameView> view) |
137 { | 137 { |
138 // We the custom scroll bars as early as possible to prevent m_doc->detach() | 138 // We the custom scroll bars as early as possible to prevent m_doc->detach() |
139 // from messing with the view such that its scroll bars won't be torn down. | 139 // from messing with the view such that its scroll bars won't be torn down. |
140 // FIXME: We should revisit this. | 140 // FIXME: We should revisit this. |
141 if (m_view) | 141 if (m_view) |
142 m_view->prepareForDetach(); | 142 m_view->prepareForDetach(); |
143 | 143 |
144 // Prepare for destruction now, so any unload event handlers get run and the
DOMWindow is | 144 // Prepare for destruction now, so any unload event handlers get run and the
LocalDOMWindow is |
145 // notified. If we wait until the view is destroyed, then things won't be ho
oked up enough for | 145 // notified. If we wait until the view is destroyed, then things won't be ho
oked up enough for |
146 // these calls to work. | 146 // these calls to work. |
147 if (!view && document() && document()->isActive()) { | 147 if (!view && document() && document()->isActive()) { |
148 // FIXME: We don't call willRemove here. Why is that OK? | 148 // FIXME: We don't call willRemove here. Why is that OK? |
149 document()->prepareForDestruction(); | 149 document()->prepareForDestruction(); |
150 } | 150 } |
151 | 151 |
152 eventHandler().clear(); | 152 eventHandler().clear(); |
153 | 153 |
154 m_view = view; | 154 m_view = view; |
155 | 155 |
156 if (m_view && isMainFrame()) { | 156 if (m_view && isMainFrame()) { |
157 if (settings()->pinchVirtualViewportEnabled()) | 157 if (settings()->pinchVirtualViewportEnabled()) |
158 m_host->pinchViewport().mainFrameDidChangeSize(); | 158 m_host->pinchViewport().mainFrameDidChangeSize(); |
159 else | 159 else |
160 m_view->setVisibleContentScaleFactor(page()->pageScaleFactor()); | 160 m_view->setVisibleContentScaleFactor(page()->pageScaleFactor()); |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
164 void LocalFrame::sendOrientationChangeEvent() | 164 void LocalFrame::sendOrientationChangeEvent() |
165 { | 165 { |
166 if (!RuntimeEnabledFeatures::orientationEventEnabled() && !RuntimeEnabledFea
tures::screenOrientationEnabled()) | 166 if (!RuntimeEnabledFeatures::orientationEventEnabled() && !RuntimeEnabledFea
tures::screenOrientationEnabled()) |
167 return; | 167 return; |
168 | 168 |
169 if (page()->visibilityState() != PageVisibilityStateVisible) | 169 if (page()->visibilityState() != PageVisibilityStateVisible) |
170 return; | 170 return; |
171 | 171 |
172 DOMWindow* window = domWindow(); | 172 LocalDOMWindow* window = domWindow(); |
173 if (!window) | 173 if (!window) |
174 return; | 174 return; |
175 window->dispatchEvent(Event::create(EventTypeNames::orientationchange)); | 175 window->dispatchEvent(Event::create(EventTypeNames::orientationchange)); |
176 | 176 |
177 // Notify subframes. | 177 // Notify subframes. |
178 Vector<RefPtr<LocalFrame> > childFrames; | 178 Vector<RefPtr<LocalFrame> > childFrames; |
179 for (Frame* child = tree().firstChild(); child; child = child->tree().nextSi
bling()) { | 179 for (Frame* child = tree().firstChild(); child; child = child->tree().nextSi
bling()) { |
180 if (child->isLocalFrame()) | 180 if (child->isLocalFrame()) |
181 childFrames.append(toLocalFrame(child)); | 181 childFrames.append(toLocalFrame(child)); |
182 } | 182 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 resultSize.setHeight(floorf(resultSize.width() * ratio)); | 229 resultSize.setHeight(floorf(resultSize.width() * ratio)); |
230 } else { | 230 } else { |
231 ASSERT(fabs(originalSize.height()) > std::numeric_limits<float>::epsilon
()); | 231 ASSERT(fabs(originalSize.height()) > std::numeric_limits<float>::epsilon
()); |
232 float ratio = originalSize.width() / originalSize.height(); | 232 float ratio = originalSize.width() / originalSize.height(); |
233 resultSize.setHeight(floorf(expectedSize.height())); | 233 resultSize.setHeight(floorf(expectedSize.height())); |
234 resultSize.setWidth(floorf(resultSize.height() * ratio)); | 234 resultSize.setWidth(floorf(resultSize.height() * ratio)); |
235 } | 235 } |
236 return resultSize; | 236 return resultSize; |
237 } | 237 } |
238 | 238 |
239 void LocalFrame::setDOMWindow(PassRefPtrWillBeRawPtr<DOMWindow> domWindow) | 239 void LocalFrame::setDOMWindow(PassRefPtrWillBeRawPtr<LocalDOMWindow> domWindow) |
240 { | 240 { |
241 InspectorInstrumentation::frameWindowDiscarded(this, m_domWindow.get()); | 241 InspectorInstrumentation::frameWindowDiscarded(this, m_domWindow.get()); |
242 if (domWindow) | 242 if (domWindow) |
243 script().clearWindowShell(); | 243 script().clearWindowShell(); |
244 Frame::setDOMWindow(domWindow); | 244 Frame::setDOMWindow(domWindow); |
245 } | 245 } |
246 | 246 |
247 void LocalFrame::didChangeVisibilityState() | 247 void LocalFrame::didChangeVisibilityState() |
248 { | 248 { |
249 if (document()) | 249 if (document()) |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 LocalFrame* LocalFrame::localFrameRoot() | 654 LocalFrame* LocalFrame::localFrameRoot() |
655 { | 655 { |
656 LocalFrame* curFrame = this; | 656 LocalFrame* curFrame = this; |
657 while (curFrame && curFrame->tree().parent() && curFrame->tree().parent()->i
sLocalFrame()) | 657 while (curFrame && curFrame->tree().parent() && curFrame->tree().parent()->i
sLocalFrame()) |
658 curFrame = toLocalFrame(curFrame->tree().parent()); | 658 curFrame = toLocalFrame(curFrame->tree().parent()); |
659 | 659 |
660 return curFrame; | 660 return curFrame; |
661 } | 661 } |
662 | 662 |
663 } // namespace WebCore | 663 } // namespace WebCore |
OLD | NEW |