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 3687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3698 if (!m_page->mainFrame()->isLocalFrame()) | 3698 if (!m_page->mainFrame()->isLocalFrame()) |
3699 return; | 3699 return; |
3700 | 3700 |
3701 // If we get to the <body> tag and we have no pending stylesheet and import
load, we | 3701 // If we get to the <body> tag and we have no pending stylesheet and import
load, we |
3702 // can be fairly confident we'll have something sensible to paint soon and | 3702 // can be fairly confident we'll have something sensible to paint soon and |
3703 // can turn off deferred commits. | 3703 // can turn off deferred commits. |
3704 if (m_page->deprecatedLocalMainFrame()->document()->isRenderingReady()) | 3704 if (m_page->deprecatedLocalMainFrame()->document()->isRenderingReady()) |
3705 resumeTreeViewCommits(); | 3705 resumeTreeViewCommits(); |
3706 } | 3706 } |
3707 | 3707 |
| 3708 void WebViewImpl::didRemoveAllPendingStylesheet(WebLocalFrameImpl* webframe) |
| 3709 { |
| 3710 if (webframe != mainFrameImpl()) |
| 3711 return; |
| 3712 |
| 3713 // If we have no more stylesheets to load and we're past the body tag, |
| 3714 // we should have something to paint and should start as soon as possible. |
| 3715 if (m_page->deprecatedLocalMainFrame()->document()->body()) |
| 3716 resumeTreeViewCommits(); |
| 3717 } |
| 3718 |
3708 void WebViewImpl::resumeTreeViewCommits() | 3719 void WebViewImpl::resumeTreeViewCommits() |
3709 { | 3720 { |
3710 if (m_layerTreeViewCommitsDeferred) { | 3721 if (m_layerTreeViewCommitsDeferred) { |
3711 if (m_layerTreeView) | 3722 if (m_layerTreeView) |
3712 m_layerTreeView->setDeferCommits(false); | 3723 m_layerTreeView->setDeferCommits(false); |
3713 m_layerTreeViewCommitsDeferred = false; | 3724 m_layerTreeViewCommitsDeferred = false; |
3714 } | 3725 } |
3715 } | 3726 } |
3716 | 3727 |
3717 void WebViewImpl::layoutUpdated(WebLocalFrameImpl* webframe) | 3728 void WebViewImpl::layoutUpdated(WebLocalFrameImpl* webframe) |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4235 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4246 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4236 | 4247 |
4237 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4248 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4238 return false; | 4249 return false; |
4239 | 4250 |
4240 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4251 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4241 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4252 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4242 } | 4253 } |
4243 | 4254 |
4244 } // namespace blink | 4255 } // namespace blink |
OLD | NEW |