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 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 #include "core/page/FrameView.h" | 28 #include "core/page/FrameView.h" |
29 | 29 |
30 #include "HTMLNames.h" | 30 #include "HTMLNames.h" |
31 #include "RuntimeEnabledFeatures.h" | 31 #include "RuntimeEnabledFeatures.h" |
32 #include "core/accessibility/AXObjectCache.h" | 32 #include "core/accessibility/AXObjectCache.h" |
33 #include "core/animation/DocumentTimeline.h" | 33 #include "core/animation/DocumentTimeline.h" |
34 #include "core/css/FontLoader.h" | 34 #include "core/css/FontLoader.h" |
35 #include "core/css/resolver/StyleResolver.h" | 35 #include "core/css/resolver/StyleResolver.h" |
| 36 #include "core/css/resolver/ViewportStyleResolver.h" |
36 #include "core/dom/DocumentMarkerController.h" | 37 #include "core/dom/DocumentMarkerController.h" |
37 #include "core/dom/OverflowEvent.h" | 38 #include "core/dom/OverflowEvent.h" |
38 #include "core/editing/FrameSelection.h" | 39 #include "core/editing/FrameSelection.h" |
39 #include "core/html/HTMLFrameElement.h" | 40 #include "core/html/HTMLFrameElement.h" |
40 #include "core/html/HTMLHtmlElement.h" | 41 #include "core/html/HTMLHtmlElement.h" |
41 #include "core/html/HTMLPlugInImageElement.h" | 42 #include "core/html/HTMLPlugInImageElement.h" |
42 #include "core/inspector/InspectorInstrumentation.h" | 43 #include "core/inspector/InspectorInstrumentation.h" |
43 #include "core/loader/FrameLoader.h" | 44 #include "core/loader/FrameLoader.h" |
44 #include "core/loader/FrameLoaderClient.h" | 45 #include "core/loader/FrameLoaderClient.h" |
45 #include "core/loader/TextResourceDecoder.h" | 46 #include "core/loader/TextResourceDecoder.h" |
(...skipping 2153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2199 | 2200 |
2200 m_frame->selection()->setCaretRectNeedsUpdate(); | 2201 m_frame->selection()->setCaretRectNeedsUpdate(); |
2201 m_frame->selection()->updateAppearance(); | 2202 m_frame->selection()->updateAppearance(); |
2202 | 2203 |
2203 LayoutMilestones milestonesOfInterest = 0; | 2204 LayoutMilestones milestonesOfInterest = 0; |
2204 LayoutMilestones milestonesAchieved = 0; | 2205 LayoutMilestones milestonesAchieved = 0; |
2205 Page* page = m_frame->page(); | 2206 Page* page = m_frame->page(); |
2206 if (page) | 2207 if (page) |
2207 milestonesOfInterest = page->layoutMilestones(); | 2208 milestonesOfInterest = page->layoutMilestones(); |
2208 | 2209 |
| 2210 bool viewportDidChange = false; |
| 2211 |
2209 if (m_nestedLayoutCount <= 1) { | 2212 if (m_nestedLayoutCount <= 1) { |
2210 if (m_firstLayoutCallbackPending) { | 2213 if (m_firstLayoutCallbackPending) { |
2211 m_firstLayoutCallbackPending = false; | 2214 m_firstLayoutCallbackPending = false; |
| 2215 viewportDidChange = true; |
2212 m_frame->loader()->didFirstLayout(); | 2216 m_frame->loader()->didFirstLayout(); |
2213 if (milestonesOfInterest & DidFirstLayout) | 2217 if (milestonesOfInterest & DidFirstLayout) |
2214 milestonesAchieved |= DidFirstLayout; | 2218 milestonesAchieved |= DidFirstLayout; |
2215 if (page) { | 2219 if (page) { |
2216 if (page->mainFrame() == m_frame) | 2220 if (page->mainFrame() == m_frame) |
2217 page->startCountingRelevantRepaintedObjects(); | 2221 page->startCountingRelevantRepaintedObjects(); |
2218 } | 2222 } |
2219 } | 2223 } |
2220 | 2224 |
2221 // Ensure that we always send this eventually. | 2225 // Ensure that we always send this eventually. |
(...skipping 22 matching lines...) Expand all Loading... |
2244 | 2248 |
2245 if (page) { | 2249 if (page) { |
2246 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina
tor()) | 2250 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina
tor()) |
2247 scrollingCoordinator->frameViewLayoutUpdated(this); | 2251 scrollingCoordinator->frameViewLayoutUpdated(this); |
2248 } | 2252 } |
2249 | 2253 |
2250 scrollToAnchor(); | 2254 scrollToAnchor(); |
2251 | 2255 |
2252 m_actionScheduler->resume(); | 2256 m_actionScheduler->resume(); |
2253 | 2257 |
2254 // Viewport-dependent media queries may cause us to need completely differen
t style information. | 2258 IntSize currentSize = layoutSize(IncludeScrollbars); |
2255 if (m_frame->document()->styleResolver()->affectedByViewportChange()) { | 2259 float currentZoomFactor = renderView->style()->zoom(); |
| 2260 |
| 2261 bool didResize = currentSize != m_lastViewportSize || currentZoomFactor != m
_lastZoomFactor; |
| 2262 viewportDidChange |= didResize; |
| 2263 |
| 2264 m_lastViewportSize = currentSize; |
| 2265 m_lastZoomFactor = currentZoomFactor; |
| 2266 |
| 2267 // Viewport-dependent media queries and @viewport rue may cause us to need c
ompletely |
| 2268 // different style information. |
| 2269 if (viewportDidChange && m_frame->document()->styleResolver()->affectedByVie
wportChange()) { |
| 2270 m_frame->document()->styleResolver()->viewportStyleResolver()->resolve()
; |
2256 m_frame->document()->styleResolverChanged(DeferRecalcStyle); | 2271 m_frame->document()->styleResolverChanged(DeferRecalcStyle); |
2257 InspectorInstrumentation::mediaQueryResultChanged(m_frame->document()); | 2272 InspectorInstrumentation::mediaQueryResultChanged(m_frame->document()); |
2258 } | 2273 } |
2259 | 2274 |
2260 // Refetch render view since it can be destroyed by updateWidget() call abov
e. | 2275 // Refetch render view since it can be destroyed by updateWidget() call abov
e. |
2261 renderView = this->renderView(); | 2276 renderView = this->renderView(); |
2262 if (renderView && !renderView->printing()) { | 2277 if (renderView && !renderView->printing() && !m_firstLayout && didResize) { |
2263 IntSize currentSize = layoutSize(IncludeScrollbars); | 2278 m_frame->eventHandler()->sendResizeEvent(); |
2264 float currentZoomFactor = renderView->style()->zoom(); | 2279 if (page && page->mainFrame() == m_frame) |
2265 bool resized = !m_firstLayout && (currentSize != m_lastViewportSize || c
urrentZoomFactor != m_lastZoomFactor); | 2280 InspectorInstrumentation::didResizeMainFrame(page); |
2266 m_lastViewportSize = currentSize; | |
2267 m_lastZoomFactor = currentZoomFactor; | |
2268 if (resized) { | |
2269 m_frame->eventHandler()->sendResizeEvent(); | |
2270 if (page && page->mainFrame() == m_frame) | |
2271 InspectorInstrumentation::didResizeMainFrame(page); | |
2272 } | |
2273 } | 2281 } |
2274 } | 2282 } |
2275 | 2283 |
2276 void FrameView::postLayoutTimerFired(Timer<FrameView>*) | 2284 void FrameView::postLayoutTimerFired(Timer<FrameView>*) |
2277 { | 2285 { |
2278 performPostLayoutTasks(); | 2286 performPostLayoutTasks(); |
2279 } | 2287 } |
2280 | 2288 |
2281 void FrameView::autoSizeIfEnabled() | 2289 void FrameView::autoSizeIfEnabled() |
2282 { | 2290 { |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3373 } | 3381 } |
3374 | 3382 |
3375 AXObjectCache* FrameView::axObjectCache() const | 3383 AXObjectCache* FrameView::axObjectCache() const |
3376 { | 3384 { |
3377 if (frame() && frame()->document()) | 3385 if (frame() && frame()->document()) |
3378 return frame()->document()->existingAXObjectCache(); | 3386 return frame()->document()->existingAXObjectCache(); |
3379 return 0; | 3387 return 0; |
3380 } | 3388 } |
3381 | 3389 |
3382 } // namespace WebCore | 3390 } // namespace WebCore |
OLD | NEW |