| 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 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1121 } | 1121 } |
| 1122 | 1122 |
| 1123 bool scaleUnchanged = true; | 1123 bool scaleUnchanged = true; |
| 1124 if (!rect.isEmpty()) { | 1124 if (!rect.isEmpty()) { |
| 1125 // Pages should be as legible as on desktop when at dpi scale, so no | 1125 // Pages should be as legible as on desktop when at dpi scale, so no |
| 1126 // need to zoom in further when automatically determining zoom level | 1126 // need to zoom in further when automatically determining zoom level |
| 1127 // (after double tap, find in page, etc), though the user should still | 1127 // (after double tap, find in page, etc), though the user should still |
| 1128 // be allowed to manually pinch zoom in further if they desire. | 1128 // be allowed to manually pinch zoom in further if they desire. |
| 1129 const float defaultScaleWhenAlreadyLegible = m_minimumPageScaleFactor *
doubleTapZoomAlreadyLegibleRatio; | 1129 const float defaultScaleWhenAlreadyLegible = m_minimumPageScaleFactor *
doubleTapZoomAlreadyLegibleRatio; |
| 1130 float legibleScale = deviceScaleFactor(); | 1130 float legibleScale = deviceScaleFactor(); |
| 1131 #if ENABLE(TEXT_AUTOSIZING) |
| 1132 if (page() && page()->settings()) |
| 1133 legibleScale *= page()->settings()->textAutosizingFontScaleFactor(); |
| 1134 #endif |
| 1131 if (legibleScale < defaultScaleWhenAlreadyLegible) | 1135 if (legibleScale < defaultScaleWhenAlreadyLegible) |
| 1132 legibleScale = (scale == m_minimumPageScaleFactor) ? defaultScaleWhe
nAlreadyLegible : m_minimumPageScaleFactor; | 1136 legibleScale = (scale == m_minimumPageScaleFactor) ? defaultScaleWhe
nAlreadyLegible : m_minimumPageScaleFactor; |
| 1133 | 1137 |
| 1134 const float defaultMargin = doubleTapZoomContentDefaultMargin * deviceSc
aleFactor(); | 1138 const float defaultMargin = doubleTapZoomContentDefaultMargin * deviceSc
aleFactor(); |
| 1135 const float minimumMargin = doubleTapZoomContentMinimumMargin * deviceSc
aleFactor(); | 1139 const float minimumMargin = doubleTapZoomContentMinimumMargin * deviceSc
aleFactor(); |
| 1136 // We want the margins to have the same physical size, which means we | 1140 // We want the margins to have the same physical size, which means we |
| 1137 // need to express them in post-scale size. To do that we'd need to know | 1141 // need to express them in post-scale size. To do that we'd need to know |
| 1138 // the scale we're scaling to, but that depends on the margins. Instead | 1142 // the scale we're scaling to, but that depends on the margins. Instead |
| 1139 // we express them as a fraction of the target rectangle: this will be | 1143 // we express them as a fraction of the target rectangle: this will be |
| 1140 // correct if we end up fully zooming to it, and won't matter if we | 1144 // correct if we end up fully zooming to it, and won't matter if we |
| (...skipping 3149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4290 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event); | 4294 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event); |
| 4291 | 4295 |
| 4292 if (page()) | 4296 if (page()) |
| 4293 page()->pointerLockController()->dispatchLockedMouseEvent( | 4297 page()->pointerLockController()->dispatchLockedMouseEvent( |
| 4294 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), mouseEvent), | 4298 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), mouseEvent), |
| 4295 eventType); | 4299 eventType); |
| 4296 } | 4300 } |
| 4297 #endif | 4301 #endif |
| 4298 | 4302 |
| 4299 } // namespace WebKit | 4303 } // namespace WebKit |
| OLD | NEW |