OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 3458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3469 { | 3469 { |
3470 if (isNewNavigation && !isNavigationWithinPage) | 3470 if (isNewNavigation && !isNavigationWithinPage) |
3471 m_pageScaleConstraintsSet.setNeedsReset(true); | 3471 m_pageScaleConstraintsSet.setNeedsReset(true); |
3472 | 3472 |
3473 // Make sure link highlight from previous page is cleared. | 3473 // Make sure link highlight from previous page is cleared. |
3474 m_linkHighlights.clear(); | 3474 m_linkHighlights.clear(); |
3475 endActiveFlingAnimation(); | 3475 endActiveFlingAnimation(); |
3476 resetSavedScrollAndScaleState(); | 3476 resetSavedScrollAndScaleState(); |
3477 } | 3477 } |
3478 | 3478 |
| 3479 void WebViewImpl::willInsertBody(WebFrameImpl* webframe) |
| 3480 { |
| 3481 if (webframe != mainFrameImpl()) |
| 3482 return; |
| 3483 |
| 3484 // If we get to the <body> tag and we have no pending stylesheet loads, we |
| 3485 // can be fairly confident we'll have something sensible to paint soon and |
| 3486 // can turn off deferred commits. |
| 3487 if (m_page->mainFrame()->document()->haveStylesheetsLoaded()) |
| 3488 resumeTreeViewCommits(); |
| 3489 } |
| 3490 |
| 3491 void WebViewImpl::resumeTreeViewCommits() |
| 3492 { |
| 3493 if (m_layerTreeViewCommitsDeferred) { |
| 3494 if (m_layerTreeView) |
| 3495 m_layerTreeView->setDeferCommits(false); |
| 3496 m_layerTreeViewCommitsDeferred = false; |
| 3497 } |
| 3498 } |
| 3499 |
3479 void WebViewImpl::layoutUpdated(WebFrameImpl* webframe) | 3500 void WebViewImpl::layoutUpdated(WebFrameImpl* webframe) |
3480 { | 3501 { |
3481 if (!m_client || webframe != mainFrameImpl()) | 3502 if (!m_client || webframe != mainFrameImpl()) |
3482 return; | 3503 return; |
3483 | 3504 |
3484 if (m_layerTreeViewCommitsDeferred) { | 3505 // If we finished a layout while in deferred commit mode, |
3485 // If we finished a layout while in deferred commit mode, | 3506 // that means it's time to start producing frames again so un-defer. |
3486 // that means it's time to start producing frames again so un-defer. | 3507 resumeTreeViewCommits(); |
3487 if (m_layerTreeView) | |
3488 m_layerTreeView->setDeferCommits(false); | |
3489 m_layerTreeViewCommitsDeferred = false; | |
3490 } | |
3491 | 3508 |
3492 if (m_shouldAutoResize && mainFrameImpl()->frame() && mainFrameImpl()->frame
()->view()) { | 3509 if (m_shouldAutoResize && mainFrameImpl()->frame() && mainFrameImpl()->frame
()->view()) { |
3493 WebSize frameSize = mainFrameImpl()->frame()->view()->frameRect().size()
; | 3510 WebSize frameSize = mainFrameImpl()->frame()->view()->frameRect().size()
; |
3494 if (frameSize != m_size) { | 3511 if (frameSize != m_size) { |
3495 m_size = frameSize; | 3512 m_size = frameSize; |
3496 m_client->didAutoResize(m_size); | 3513 m_client->didAutoResize(m_size); |
3497 sendResizeEventAndRepaint(); | 3514 sendResizeEventAndRepaint(); |
3498 } | 3515 } |
3499 } | 3516 } |
3500 | 3517 |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3981 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 3998 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
3982 | 3999 |
3983 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4000 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
3984 return false; | 4001 return false; |
3985 | 4002 |
3986 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4003 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
3987 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4004 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
3988 } | 4005 } |
3989 | 4006 |
3990 } // namespace blink | 4007 } // namespace blink |
OLD | NEW |