Changeset 136129 in webkit
- Timestamp:
- Nov 29, 2012, 7:00:49 AM (14 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 1 added
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/API/qt/tests/qmltests/WebView/tst_resize.qml (added)
-
UIProcess/PageViewportController.cpp (modified) (4 diffs)
-
UIProcess/PageViewportController.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r136126 r136129 1 2012-11-29 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 3 Possible to resize out of bounds 4 https://bugs.webkit.org/show_bug.cgi?id=103521 5 6 Reviewed by Jocelyn Turcotte. 7 8 Enforce the viewportBounds after resize, and ensure a user fitted page remains 9 fit on viewport resize, but not on content growth. 10 11 * UIProcess/API/qt/tests/qmltests/WebView/tst_resize.qml: Added. 12 * UIProcess/PageViewportController.cpp: 13 (WebKit::PageViewportController::didChangeContentsSize): 14 (WebKit::PageViewportController::didChangeViewportAttributes): 15 (WebKit::PageViewportController::updateMinimumScaleToFit): 16 * UIProcess/PageViewportController.h: 17 (PageViewportController): 18 1 19 2012-11-29 Michael Brüning <michael.bruning@digia.com> 2 20 -
trunk/Source/WebKit2/UIProcess/PageViewportController.cpp
r135864 r136129 112 112 m_contentsSize = newSize; 113 113 114 bool minimumScaleUpdated = updateMinimumScaleToFit( );114 bool minimumScaleUpdated = updateMinimumScaleToFit(false); 115 115 116 116 if (m_initiallyFitToViewport) { … … 233 233 WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(m_rawAttributes); 234 234 235 if (updateMinimumScaleToFit( ))235 if (updateMinimumScaleToFit(true)) 236 236 m_client->didChangeViewportAttributes(); 237 237 … … 278 278 } 279 279 280 bool PageViewportController::updateMinimumScaleToFit( )280 bool PageViewportController::updateMinimumScaleToFit(bool userInitiatedUpdate) 281 281 { 282 282 if (m_viewportSize.isEmpty() || m_contentsSize.isEmpty()) 283 283 return false; 284 284 285 bool currentlyScaledToFit = fuzzyCompare(m_effectiveScale, toViewportScale(m_minimumScaleToFit), 0.001); 286 285 287 float minimumScale = WebCore::computeMinimumScaleFactorForContentContained(m_rawAttributes, WebCore::roundedIntSize(m_viewportSize), WebCore::roundedIntSize(m_contentsSize), devicePixelRatio()); 286 288 … … 291 293 m_minimumScaleToFit = minimumScale; 292 294 293 if (!m_hadUserInteraction && !hasSuspendedContent()) 294 applyScaleAfterRenderingContents(toViewportScale(minimumScale)); 295 if (!hasSuspendedContent()) { 296 if (!m_hadUserInteraction || (userInitiatedUpdate && currentlyScaledToFit)) 297 applyScaleAfterRenderingContents(toViewportScale(m_minimumScaleToFit)); 298 else { 299 // Ensure the effective scale stays within bounds. 300 float boundedScale = innerBoundedViewportScale(m_effectiveScale); 301 if (!fuzzyCompare(boundedScale, m_effectiveScale, 0.001)) 302 applyScaleAfterRenderingContents(boundedScale); 303 } 304 } 295 305 296 306 return true; -
trunk/Source/WebKit2/UIProcess/PageViewportController.h
r135669 r136129 85 85 void applyScaleAfterRenderingContents(float scale); 86 86 void applyPositionAfterRenderingContents(const WebCore::FloatPoint& pos); 87 bool updateMinimumScaleToFit( );87 bool updateMinimumScaleToFit(bool userInitiatedUpdate); 88 88 WebCore::FloatSize viewportSizeInContentsCoordinates() const; 89 89
Note:
See TracChangeset
for help on using the changeset viewer.