| 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 2840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2851 updateLayerTreeViewport(); | 2851 updateLayerTreeViewport(); |
| 2852 | 2852 |
| 2853 // Relayout immediately to avoid violating the rule that needsLayout() | 2853 // Relayout immediately to avoid violating the rule that needsLayout() |
| 2854 // isn't set at the end of a layout. | 2854 // isn't set at the end of a layout. |
| 2855 if (view->needsLayout()) | 2855 if (view->needsLayout()) |
| 2856 view->layout(); | 2856 view->layout(); |
| 2857 } | 2857 } |
| 2858 | 2858 |
| 2859 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription
& description) | 2859 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription
& description) |
| 2860 { | 2860 { |
| 2861 if (!settings()->viewportEnabled() || !page() || !m_size.width || !m_size.he
ight) | 2861 if (!settings()->viewportEnabled() || !page() || (!m_size.width && !m_size.h
eight)) |
| 2862 return; | 2862 return; |
| 2863 | 2863 |
| 2864 ViewportDescription adjustedDescription = description; | 2864 ViewportDescription adjustedDescription = description; |
| 2865 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ
e == ViewportDescription::ViewportMeta) { | 2865 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ
e == ViewportDescription::ViewportMeta) { |
| 2866 if (adjustedDescription.maxWidth.type() == ExtendToZoom) | 2866 if (adjustedDescription.maxWidth.type() == ExtendToZoom) |
| 2867 adjustedDescription.maxWidth = Length(); // auto | 2867 adjustedDescription.maxWidth = Length(); // auto |
| 2868 const int legacyWidthSnappingMagicNumber = 320; | 2868 const int legacyWidthSnappingMagicNumber = 320; |
| 2869 if (adjustedDescription.maxWidth.isFixed() && adjustedDescription.maxWid
th.value() <= legacyWidthSnappingMagicNumber) | 2869 if (adjustedDescription.maxWidth.isFixed() && adjustedDescription.maxWid
th.value() <= legacyWidthSnappingMagicNumber) |
| 2870 adjustedDescription.maxWidth = Length(DeviceWidth); | 2870 adjustedDescription.maxWidth = Length(DeviceWidth); |
| 2871 if (adjustedDescription.maxHeight.isFixed() && adjustedDescription.maxWi
dth.value() <= m_size.height) | 2871 if (adjustedDescription.maxHeight.isFixed() && adjustedDescription.maxWi
dth.value() <= m_size.height) |
| (...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3985 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 3985 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 3986 | 3986 |
| 3987 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 3987 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 3988 return false; | 3988 return false; |
| 3989 | 3989 |
| 3990 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 3990 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 3991 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 3991 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 3992 } | 3992 } |
| 3993 | 3993 |
| 3994 } // namespace blink | 3994 } // namespace blink |
| OLD | NEW |