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 2980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2991 // isn't set at the end of a layout. | 2991 // isn't set at the end of a layout. |
2992 if (view->needsLayout()) | 2992 if (view->needsLayout()) |
2993 view->layout(); | 2993 view->layout(); |
2994 } | 2994 } |
2995 | 2995 |
2996 void WebViewImpl::updatePageDefinedPageScaleConstraints(const ViewportArguments&
arguments) | 2996 void WebViewImpl::updatePageDefinedPageScaleConstraints(const ViewportArguments&
arguments) |
2997 { | 2997 { |
2998 if (!settings()->viewportEnabled() || !isFixedLayoutModeEnabled() || !page()
|| !m_size.width || !m_size.height) | 2998 if (!settings()->viewportEnabled() || !isFixedLayoutModeEnabled() || !page()
|| !m_size.width || !m_size.height) |
2999 return; | 2999 return; |
3000 | 3000 |
3001 m_pageScaleConstraintsSet.updatePageDefinedConstraints(arguments, m_size, pa
ge()->settings().layoutFallbackWidth()); | 3001 ViewportArguments adjustedArguments = arguments; |
| 3002 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedArguments.type
== ViewportArguments::ViewportMeta) |
| 3003 adjustedArguments.type = ViewportArguments::ViewportMetaLayoutSizeQuirk; |
| 3004 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedArguments, m_
size, page()->settings().layoutFallbackWidth()); |
3002 | 3005 |
3003 if (settingsImpl()->supportDeprecatedTargetDensityDPI()) | 3006 if (settingsImpl()->supportDeprecatedTargetDensityDPI()) |
3004 m_pageScaleConstraintsSet.adjustPageDefinedConstraintsForAndroidWebView(
arguments, m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor()
, page()->settings().useWideViewport(), page()->settings().loadWithOverviewMode(
)); | 3007 m_pageScaleConstraintsSet.adjustPageDefinedConstraintsForAndroidWebView(
adjustedArguments, m_size, page()->settings().layoutFallbackWidth(), deviceScale
Factor(), page()->settings().useWideViewport(), page()->settings().loadWithOverv
iewMode()); |
3005 | 3008 |
3006 WebSize layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedCon
straints().layoutSize); | 3009 WebSize layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedCon
straints().layoutSize); |
3007 | 3010 |
3008 if (page()->settings().textAutosizingEnabled() && page()->mainFrame() && lay
outSize.width != fixedLayoutSize().width) | 3011 if (page()->settings().textAutosizingEnabled() && page()->mainFrame() && lay
outSize.width != fixedLayoutSize().width) |
3009 page()->mainFrame()->document()->textAutosizer()->recalculateMultipliers
(); | 3012 page()->mainFrame()->document()->textAutosizer()->recalculateMultipliers
(); |
3010 | 3013 |
3011 setFixedLayoutSize(layoutSize); | 3014 setFixedLayoutSize(layoutSize); |
3012 } | 3015 } |
3013 | 3016 |
3014 IntSize WebViewImpl::contentsSize() const | 3017 IntSize WebViewImpl::contentsSize() const |
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4116 } | 4119 } |
4117 | 4120 |
4118 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 4121 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
4119 { | 4122 { |
4120 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport
Arguments(); | 4123 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport
Arguments(); |
4121 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.
userZoom | 4124 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.
userZoom |
4122 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp
ortArguments::ValueAuto); | 4125 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp
ortArguments::ValueAuto); |
4123 } | 4126 } |
4124 | 4127 |
4125 } // namespace WebKit | 4128 } // namespace WebKit |
OLD | NEW |