OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights
reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. |
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
(...skipping 2320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2331 enqueuePageshowEvent(PageshowEventNotPersisted); | 2331 enqueuePageshowEvent(PageshowEventNotPersisted); |
2332 enqueuePopstateEvent(m_pendingStateObject ? m_pendingStateObject.release() :
SerializedScriptValue::nullValue()); | 2332 enqueuePopstateEvent(m_pendingStateObject ? m_pendingStateObject.release() :
SerializedScriptValue::nullValue()); |
2333 | 2333 |
2334 if (f) | 2334 if (f) |
2335 f->loader()->handledOnloadEvents(); | 2335 f->loader()->handledOnloadEvents(); |
2336 #ifdef INSTRUMENT_LAYOUT_SCHEDULING | 2336 #ifdef INSTRUMENT_LAYOUT_SCHEDULING |
2337 if (!ownerElement()) | 2337 if (!ownerElement()) |
2338 printf("onload fired at %d\n", elapsedTime()); | 2338 printf("onload fired at %d\n", elapsedTime()); |
2339 #endif | 2339 #endif |
2340 | 2340 |
2341 m_processingLoadEvent = false; | |
2342 | |
2343 // An event handler may have removed the frame | 2341 // An event handler may have removed the frame |
2344 if (!frame()) | 2342 if (!frame()) { |
| 2343 m_processingLoadEvent = false; |
2345 return; | 2344 return; |
| 2345 } |
2346 | 2346 |
2347 // Make sure both the initial layout and reflow happen after the onload | 2347 // Make sure both the initial layout and reflow happen after the onload |
2348 // fires. This will improve onload scores, and other browsers do it. | 2348 // fires. This will improve onload scores, and other browsers do it. |
2349 // If they wanna cheat, we can too. -dwh | 2349 // If they wanna cheat, we can too. -dwh |
2350 | 2350 |
2351 if (frame()->navigationScheduler()->locationChangePending() && elapsedTime()
< cLayoutScheduleThreshold) { | 2351 if (frame()->navigationScheduler()->locationChangePending() && elapsedTime()
< cLayoutScheduleThreshold) { |
2352 // Just bail out. Before or during the onload we were shifted to another
page. | 2352 // Just bail out. Before or during the onload we were shifted to another
page. |
2353 // The old i-Bench suite does this. When this happens don't bother paint
ing or laying out. | 2353 // The old i-Bench suite does this. When this happens don't bother paint
ing or laying out. |
| 2354 m_processingLoadEvent = false; |
2354 view()->unscheduleRelayout(); | 2355 view()->unscheduleRelayout(); |
2355 return; | 2356 return; |
2356 } | 2357 } |
2357 | 2358 |
2358 frame()->loader()->checkCallImplicitClose(); | 2359 frame()->loader()->checkCallImplicitClose(); |
2359 RenderObject* renderObject = renderer(); | 2360 RenderObject* renderObject = renderer(); |
2360 | 2361 |
2361 // We used to force a synchronous display and flush here. This really isn't | 2362 // We used to force a synchronous display and flush here. This really isn't |
2362 // necessary and can in fact be actively harmful if pages are loading at a r
ate of > 60fps | 2363 // necessary and can in fact be actively harmful if pages are loading at a r
ate of > 60fps |
2363 // (if your platform is syncing flushes and limiting them to 60fps). | 2364 // (if your platform is syncing flushes and limiting them to 60fps). |
2364 m_overMinimumLayoutThreshold = true; | 2365 m_overMinimumLayoutThreshold = true; |
2365 if (!ownerElement() || (ownerElement()->renderer() && !ownerElement()->rende
rer()->needsLayout())) { | 2366 if (!ownerElement() || (ownerElement()->renderer() && !ownerElement()->rende
rer()->needsLayout())) { |
2366 updateStyleIfNeeded(); | 2367 updateStyleIfNeeded(); |
2367 | 2368 |
2368 // Always do a layout after loading if needed. | 2369 // Always do a layout after loading if needed. |
2369 if (view() && renderObject && (!renderObject->firstChild() || renderObje
ct->needsLayout())) | 2370 if (view() && renderObject && (!renderObject->firstChild() || renderObje
ct->needsLayout())) |
2370 view()->layout(); | 2371 view()->layout(); |
2371 } | 2372 } |
2372 | 2373 |
| 2374 m_processingLoadEvent = false; |
| 2375 |
2373 // If painting and compositing layer updates were suppressed pending the loa
d event, do these actions now. | 2376 // If painting and compositing layer updates were suppressed pending the loa
d event, do these actions now. |
2374 if (renderer() && settings() && settings()->suppressesIncrementalRendering()
) { | 2377 if (renderer() && settings() && settings()->suppressesIncrementalRendering()
) { |
2375 #if USE(ACCELERATED_COMPOSITING) | 2378 #if USE(ACCELERATED_COMPOSITING) |
2376 view()->updateCompositingLayers(); | 2379 view()->updateCompositingLayers(); |
2377 #endif | 2380 #endif |
2378 renderer()->repaint(); | 2381 renderer()->repaint(); |
2379 } | 2382 } |
2380 | 2383 |
2381 #if PLATFORM(MAC) || PLATFORM(CHROMIUM) | 2384 #if PLATFORM(MAC) || PLATFORM(CHROMIUM) |
2382 if (f && renderObject && AXObjectCache::accessibilityEnabled()) { | 2385 if (f && renderObject && AXObjectCache::accessibilityEnabled()) { |
(...skipping 3136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5519 #endif | 5522 #endif |
5520 | 5523 |
5521 IntSize Document::viewportSize() const | 5524 IntSize Document::viewportSize() const |
5522 { | 5525 { |
5523 if (!view()) | 5526 if (!view()) |
5524 return IntSize(); | 5527 return IntSize(); |
5525 return view()->visibleContentRect(/* includeScrollbars */ true).size(); | 5528 return view()->visibleContentRect(/* includeScrollbars */ true).size(); |
5526 } | 5529 } |
5527 | 5530 |
5528 } // namespace WebCore | 5531 } // namespace WebCore |
OLD | NEW |