| 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 2973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2984 if (view->needsLayout()) | 2984 if (view->needsLayout()) |
| 2985 view->layout(); | 2985 view->layout(); |
| 2986 } | 2986 } |
| 2987 | 2987 |
| 2988 void WebViewImpl::updatePageDefinedPageScaleConstraints(const ViewportArguments&
arguments) | 2988 void WebViewImpl::updatePageDefinedPageScaleConstraints(const ViewportArguments&
arguments) |
| 2989 { | 2989 { |
| 2990 if (!settings()->viewportEnabled() || !isFixedLayoutModeEnabled() || !page()
|| !m_size.width || !m_size.height) | 2990 if (!settings()->viewportEnabled() || !isFixedLayoutModeEnabled() || !page()
|| !m_size.width || !m_size.height) |
| 2991 return; | 2991 return; |
| 2992 | 2992 |
| 2993 ViewportArguments adjustedArguments = arguments; | 2993 ViewportArguments adjustedArguments = arguments; |
| 2994 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedArguments.type
== ViewportArguments::ViewportMeta) | 2994 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedArguments.type
== ViewportArguments::ViewportMeta) { |
| 2995 adjustedArguments.type = ViewportArguments::ViewportMetaLayoutSizeQuirk; | 2995 if (adjustedArguments.maxWidth.type() == ExtendToZoom) |
| 2996 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedArguments, m_
size, page()->settings().layoutFallbackWidth()); | 2996 adjustedArguments.maxWidth = Length(); // auto |
| 2997 adjustedArguments.minWidth = adjustedArguments.maxWidth; |
| 2998 adjustedArguments.minHeight = adjustedArguments.maxHeight; |
| 2999 } |
| 3000 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedArguments, m_
size); |
| 2997 | 3001 |
| 2998 if (settingsImpl()->supportDeprecatedTargetDensityDPI()) | 3002 if (settingsImpl()->supportDeprecatedTargetDensityDPI()) |
| 2999 m_pageScaleConstraintsSet.adjustPageDefinedConstraintsForAndroidWebView(
adjustedArguments, m_size, page()->settings().layoutFallbackWidth(), deviceScale
Factor(), page()->settings().useWideViewport(), page()->settings().loadWithOverv
iewMode()); | 3003 m_pageScaleConstraintsSet.adjustPageDefinedConstraintsForAndroidWebView(
adjustedArguments, m_size, page()->settings().layoutFallbackWidth(), deviceScale
Factor(), page()->settings().useWideViewport(), page()->settings().loadWithOverv
iewMode()); |
| 3000 | 3004 |
| 3001 WebSize layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedCon
straints().layoutSize); | 3005 WebSize layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedCon
straints().layoutSize); |
| 3002 | 3006 |
| 3003 if (page()->settings().textAutosizingEnabled() && page()->mainFrame() && lay
outSize.width != fixedLayoutSize().width) | 3007 if (page()->settings().textAutosizingEnabled() && page()->mainFrame() && lay
outSize.width != fixedLayoutSize().width) |
| 3004 page()->mainFrame()->document()->textAutosizer()->recalculateMultipliers
(); | 3008 page()->mainFrame()->document()->textAutosizer()->recalculateMultipliers
(); |
| 3005 | 3009 |
| 3006 setFixedLayoutSize(layoutSize); | 3010 setFixedLayoutSize(layoutSize); |
| (...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4110 // the initial viewport width. | 4114 // the initial viewport width. |
| 4111 // 2. The author has disabled viewport zoom. | 4115 // 2. The author has disabled viewport zoom. |
| 4112 | 4116 |
| 4113 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4117 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 4114 | 4118 |
| 4115 return fixedLayoutSize().width == m_size.width | 4119 return fixedLayoutSize().width == m_size.width |
| 4116 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4120 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 4117 } | 4121 } |
| 4118 | 4122 |
| 4119 } // namespace WebKit | 4123 } // namespace WebKit |
| OLD | NEW |