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 2896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2907 view->layout(); | 2907 view->layout(); |
2908 } | 2908 } |
2909 | 2909 |
2910 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription
& description) | 2910 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription
& description) |
2911 { | 2911 { |
2912 if (!settings()->viewportEnabled() || !page() || (!m_size.width && !m_size.h
eight)) | 2912 if (!settings()->viewportEnabled() || !page() || (!m_size.width && !m_size.h
eight)) |
2913 return; | 2913 return; |
2914 | 2914 |
2915 Document* document = page()->mainFrame()->document(); | 2915 Document* document = page()->mainFrame()->document(); |
2916 | 2916 |
2917 m_matchesHeuristicsForGpuRasterization = description.minimalUI | 2917 m_matchesHeuristicsForGpuRasterization = description.maxWidth == Length(Devi
ceWidth) |
2918 && description.minZoom == 1.0 | 2918 && description.minZoom == 1.0 |
2919 && description.minWidth == Length(ExtendToZoom) | 2919 && description.minZoomIsExplicit |
2920 && description.maxWidth == Length(DeviceWidth); | 2920 && description.zoom == 1.0 |
| 2921 && description.zoomIsExplicit |
| 2922 && description.userZoom |
| 2923 && description.userZoomIsExplicit; |
2921 if (m_layerTreeView) | 2924 if (m_layerTreeView) |
2922 m_layerTreeView->heuristicsForGpuRasterizationUpdated(m_matchesHeuristic
sForGpuRasterization); | 2925 m_layerTreeView->heuristicsForGpuRasterizationUpdated(m_matchesHeuristic
sForGpuRasterization); |
2923 | 2926 |
2924 Length defaultMinWidth = document->viewportDefaultMinWidth(); | 2927 Length defaultMinWidth = document->viewportDefaultMinWidth(); |
2925 if (defaultMinWidth.isAuto()) | 2928 if (defaultMinWidth.isAuto()) |
2926 defaultMinWidth = Length(ExtendToZoom); | 2929 defaultMinWidth = Length(ExtendToZoom); |
2927 | 2930 |
2928 ViewportDescription adjustedDescription = description; | 2931 ViewportDescription adjustedDescription = description; |
2929 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ
e == ViewportDescription::ViewportMeta) { | 2932 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ
e == ViewportDescription::ViewportMeta) { |
2930 const int legacyWidthSnappingMagicNumber = 320; | 2933 const int legacyWidthSnappingMagicNumber = 320; |
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4083 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4086 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4084 | 4087 |
4085 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4088 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4086 return false; | 4089 return false; |
4087 | 4090 |
4088 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4091 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4089 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4092 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4090 } | 4093 } |
4091 | 4094 |
4092 } // namespace blink | 4095 } // namespace blink |
OLD | NEW |