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 3848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3859 page()->frameHost().visualViewport().mainFrameDidChangeSize(); | 3859 page()->frameHost().visualViewport().mainFrameDidChangeSize(); |
3860 | 3860 |
3861 // Make sure link highlight from previous page is cleared. | 3861 // Make sure link highlight from previous page is cleared. |
3862 m_linkHighlights.clear(); | 3862 m_linkHighlights.clear(); |
3863 endActiveFlingAnimation(); | 3863 endActiveFlingAnimation(); |
3864 m_userGestureObserved = false; | 3864 m_userGestureObserved = false; |
3865 } | 3865 } |
3866 | 3866 |
3867 void WebViewImpl::willInsertBody(WebLocalFrameImpl* webframe) | 3867 void WebViewImpl::willInsertBody(WebLocalFrameImpl* webframe) |
3868 { | 3868 { |
3869 resumeTreeViewCommitsIfNeeded(webframe); | 3869 if (webframe != mainFrameImpl()) |
| 3870 return; |
| 3871 |
| 3872 if (!m_page->mainFrame()->isLocalFrame()) |
| 3873 return; |
| 3874 |
| 3875 // If we get to the <body> tag and we have no pending stylesheet and import
load, we |
| 3876 // can be fairly confident we'll have something sensible to paint soon and |
| 3877 // can turn off deferred commits. |
| 3878 if (m_page->deprecatedLocalMainFrame()->document()->isRenderingReady()) |
| 3879 resumeTreeViewCommits(); |
3870 } | 3880 } |
3871 | 3881 |
3872 void WebViewImpl::didFinishDocumentLoad(WebLocalFrameImpl* webframe) | 3882 void WebViewImpl::didFinishDocumentLoad(WebLocalFrameImpl* webframe) |
3873 { | 3883 { |
3874 resumeTreeViewCommitsIfNeeded(webframe); | 3884 if (webframe != mainFrameImpl()) |
| 3885 return; |
| 3886 // If we finished parsing and there's no sheets to load start painting. |
| 3887 if (webframe->frame()->document()->isRenderingReady()) |
| 3888 resumeTreeViewCommits(); |
3875 } | 3889 } |
3876 | 3890 |
3877 void WebViewImpl::didRemoveAllPendingStylesheet(WebLocalFrameImpl* webframe) | 3891 void WebViewImpl::didRemoveAllPendingStylesheet(WebLocalFrameImpl* webframe) |
3878 { | 3892 { |
3879 resumeTreeViewCommitsIfNeeded(webframe); | 3893 if (webframe != mainFrameImpl()) |
| 3894 return; |
| 3895 |
| 3896 // If we have no more stylesheets to load and we're past the body tag, |
| 3897 // we should have something to paint and should start as soon as possible. |
| 3898 if (m_page->deprecatedLocalMainFrame()->document()->body()) |
| 3899 resumeTreeViewCommits(); |
3880 } | 3900 } |
3881 | 3901 |
3882 void WebViewImpl::resumeTreeViewCommitsIfNeeded(WebLocalFrameImpl* webframe) | 3902 void WebViewImpl::resumeTreeViewCommits() |
3883 { | 3903 { |
3884 if (webframe != mainFrameImpl()) | 3904 if (m_layerTreeView) |
3885 return; | 3905 m_layerTreeView->setDeferCommits(false); |
3886 if (!webframe->frame()->document()->shouldProcessFrameLifecycle()) | |
3887 return; | |
3888 if (!m_layerTreeView) | |
3889 return; | |
3890 m_layerTreeView->setDeferCommits(false); | |
3891 } | 3906 } |
3892 | 3907 |
3893 void WebViewImpl::postLayoutResize(WebLocalFrameImpl* webframe) | 3908 void WebViewImpl::postLayoutResize(WebLocalFrameImpl* webframe) |
3894 { | 3909 { |
3895 FrameView* view = webframe->frame()->view(); | 3910 FrameView* view = webframe->frame()->view(); |
3896 if (webframe == mainFrame()) | 3911 if (webframe == mainFrame()) |
3897 view->resize(mainFrameSize()); | 3912 view->resize(mainFrameSize()); |
3898 else | 3913 else |
3899 view->resize(webframe->frameView()->size()); | 3914 view->resize(webframe->frameView()->size()); |
3900 } | 3915 } |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4406 if (m_pageColorOverlay) | 4421 if (m_pageColorOverlay) |
4407 m_pageColorOverlay->update(); | 4422 m_pageColorOverlay->update(); |
4408 if (m_inspectorOverlay) { | 4423 if (m_inspectorOverlay) { |
4409 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); | 4424 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); |
4410 if (inspectorPageOverlay) | 4425 if (inspectorPageOverlay) |
4411 inspectorPageOverlay->update(); | 4426 inspectorPageOverlay->update(); |
4412 } | 4427 } |
4413 } | 4428 } |
4414 | 4429 |
4415 } // namespace blink | 4430 } // namespace blink |
OLD | NEW |