| 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 2997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3008 if (view->needsLayout()) | 3008 if (view->needsLayout()) |
| 3009 view->layout(); | 3009 view->layout(); |
| 3010 } | 3010 } |
| 3011 | 3011 |
| 3012 void WebViewImpl::updatePageDefinedPageScaleConstraints(const ViewportArguments&
arguments) | 3012 void WebViewImpl::updatePageDefinedPageScaleConstraints(const ViewportArguments&
arguments) |
| 3013 { | 3013 { |
| 3014 if (!settings()->viewportEnabled() || !isFixedLayoutModeEnabled() || !page()
|| !m_size.width || !m_size.height) | 3014 if (!settings()->viewportEnabled() || !isFixedLayoutModeEnabled() || !page()
|| !m_size.width || !m_size.height) |
| 3015 return; | 3015 return; |
| 3016 | 3016 |
| 3017 ViewportArguments adjustedArguments = arguments; | 3017 ViewportArguments adjustedArguments = arguments; |
| 3018 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedArguments.type
== ViewportArguments::ViewportMeta) | 3018 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedArguments.type
== ViewportArguments::ViewportMeta) { |
| 3019 adjustedArguments.type = ViewportArguments::ViewportMetaLayoutSizeQuirk; | 3019 if (adjustedArguments.maxWidth.type() == ExtendToZoom) |
| 3020 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedArguments, m_
size, page()->settings().layoutFallbackWidth()); | 3020 adjustedArguments.maxWidth = Length(); // auto |
| 3021 adjustedArguments.minWidth = adjustedArguments.maxWidth; |
| 3022 adjustedArguments.minHeight = adjustedArguments.maxHeight; |
| 3023 } |
| 3024 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedArguments, m_
size); |
| 3021 | 3025 |
| 3022 if (settingsImpl()->supportDeprecatedTargetDensityDPI()) | 3026 if (settingsImpl()->supportDeprecatedTargetDensityDPI()) |
| 3023 m_pageScaleConstraintsSet.adjustPageDefinedConstraintsForAndroidWebView(
adjustedArguments, m_size, page()->settings().layoutFallbackWidth(), deviceScale
Factor(), page()->settings().useWideViewport(), page()->settings().loadWithOverv
iewMode()); | 3027 m_pageScaleConstraintsSet.adjustPageDefinedConstraintsForAndroidWebView(
adjustedArguments, m_size, page()->settings().layoutFallbackWidth(), deviceScale
Factor(), page()->settings().useWideViewport(), page()->settings().loadWithOverv
iewMode()); |
| 3024 | 3028 |
| 3025 WebSize layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedCon
straints().layoutSize); | 3029 WebSize layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedCon
straints().layoutSize); |
| 3026 | 3030 |
| 3027 if (page()->settings().textAutosizingEnabled() && page()->mainFrame() && lay
outSize.width != fixedLayoutSize().width) | 3031 if (page()->settings().textAutosizingEnabled() && page()->mainFrame() && lay
outSize.width != fixedLayoutSize().width) |
| 3028 page()->mainFrame()->document()->textAutosizer()->recalculateMultipliers
(); | 3032 page()->mainFrame()->document()->textAutosizer()->recalculateMultipliers
(); |
| 3029 | 3033 |
| 3030 setFixedLayoutSize(layoutSize); | 3034 setFixedLayoutSize(layoutSize); |
| (...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4122 | 4126 |
| 4123 if (page()) | 4127 if (page()) |
| 4124 page()->pointerLockController().dispatchLockedMouseEvent( | 4128 page()->pointerLockController().dispatchLockedMouseEvent( |
| 4125 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), mouseEvent), | 4129 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), mouseEvent), |
| 4126 eventType); | 4130 eventType); |
| 4127 } | 4131 } |
| 4128 | 4132 |
| 4129 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 4133 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
| 4130 { | 4134 { |
| 4131 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport
Arguments(); | 4135 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport
Arguments(); |
| 4132 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.
userZoom | 4136 return arguments.maxWidth.isViewportPercentage() || !arguments.userZoom |
| 4133 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp
ortArguments::ValueAuto); | 4137 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp
ortArguments::ValueAuto); |
| 4134 } | 4138 } |
| 4135 | 4139 |
| 4136 } // namespace WebKit | 4140 } // namespace WebKit |
| OLD | NEW |