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 2847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2858 updateLayerTreeViewport(); | 2858 updateLayerTreeViewport(); |
2859 | 2859 |
2860 // Relayout immediately to avoid violating the rule that needsLayout() | 2860 // Relayout immediately to avoid violating the rule that needsLayout() |
2861 // isn't set at the end of a layout. | 2861 // isn't set at the end of a layout. |
2862 if (view->needsLayout()) | 2862 if (view->needsLayout()) |
2863 view->layout(); | 2863 view->layout(); |
2864 } | 2864 } |
2865 | 2865 |
2866 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription
& description) | 2866 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription
& description) |
2867 { | 2867 { |
2868 if (!settings()->viewportEnabled() || !page() || !m_size.width || !m_size.he
ight) | 2868 if (!settings()->viewportEnabled() || !page() || (!m_size.width && !m_size.h
eight)) |
2869 return; | 2869 return; |
2870 | 2870 |
2871 ViewportDescription adjustedDescription = description; | 2871 ViewportDescription adjustedDescription = description; |
2872 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ
e == ViewportDescription::ViewportMeta) { | 2872 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ
e == ViewportDescription::ViewportMeta) { |
2873 if (adjustedDescription.maxWidth.type() == ExtendToZoom) | 2873 if (adjustedDescription.maxWidth.type() == ExtendToZoom) |
2874 adjustedDescription.maxWidth = Length(); // auto | 2874 adjustedDescription.maxWidth = Length(); // auto |
2875 const int legacyWidthSnappingMagicNumber = 320; | 2875 const int legacyWidthSnappingMagicNumber = 320; |
2876 if (adjustedDescription.maxWidth.isFixed() && adjustedDescription.maxWid
th.value() <= legacyWidthSnappingMagicNumber) | 2876 if (adjustedDescription.maxWidth.isFixed() && adjustedDescription.maxWid
th.value() <= legacyWidthSnappingMagicNumber) |
2877 adjustedDescription.maxWidth = Length(DeviceWidth); | 2877 adjustedDescription.maxWidth = Length(DeviceWidth); |
2878 if (adjustedDescription.maxHeight.isFixed() && adjustedDescription.maxHe
ight.value() <= m_size.height) | 2878 if (adjustedDescription.maxHeight.isFixed() && adjustedDescription.maxHe
ight.value() <= m_size.height) |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4026 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4026 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4027 | 4027 |
4028 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4028 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4029 return false; | 4029 return false; |
4030 | 4030 |
4031 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4031 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4032 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4032 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4033 } | 4033 } |
4034 | 4034 |
4035 } // namespace blink | 4035 } // namespace blink |
OLD | NEW |