Changeset 169068 in webkit
- Timestamp:
- May 19, 2014, 2:42:38 PM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
WebProcess/WebPage/ios/WebPageIOS.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r169066 r169068 1 2014-05-19 Benjamin Poulain <bpoulain@apple.com> 2 3 [iOS][WK2] When a page relayout on dynamic resize, keep the same relative width in view 4 https://bugs.webkit.org/show_bug.cgi?id=133026 5 <rdar://problem/16833971> 6 7 Reviewed by Simon Fraser. 8 9 When a page does not relayout, we keep the same width in view. 10 When a page relayout, we should keep the same relative width in view. 11 12 * WebProcess/WebPage/ios/WebPageIOS.mm: 13 (WebKit::isResponsiveDesignWithContentLargerThanLayout): 14 (WebKit::WebPage::dynamicViewportSizeUpdate): 15 1 16 2014-05-19 Benjamin Poulain <benjamin@webkit.org> 2 17 -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r169064 r169068 1942 1942 1943 1943 RefPtr<Node> oldNodeAtCenter; 1944 double visibleHorizontalFraction = 1; 1944 1945 float relativeHorizontalPositionInNodeAtCenter = 0; 1945 1946 float relativeVerticalPositionInNodeAtCenter = 0; 1946 1947 { 1947 1948 IntRect unobscuredContentRect = frameView.unobscuredContentRect(); 1949 visibleHorizontalFraction = static_cast<float>(unobscuredContentRect.width()) / oldContentSize.width(); 1948 1950 IntPoint unobscuredContentRectCenter = unobscuredContentRect.center(); 1949 1951 … … 1978 1980 else 1979 1981 scale = std::max(std::min(targetScale, m_viewportConfiguration.maximumScale()), m_viewportConfiguration.minimumScale()); 1982 1983 if (m_userHasChangedPageScaleFactor && newContentSize.width() != oldContentSize.width()) { 1984 // When the content size change, we keep the same relative horizontal content width in view, otherwise we would 1985 // end up zoom to far in landscape->portrait, and too close in portrait->landscape. 1986 float widthToKeepInView = visibleHorizontalFraction * newContentSize.width(); 1987 double newScale = targetUnobscuredRectInScrollViewCoordinates.width() / widthToKeepInView; 1988 scale = std::max(std::min(newScale, m_viewportConfiguration.maximumScale()), m_viewportConfiguration.minimumScale()); 1989 } 1980 1990 1981 1991 FloatRect newUnobscuredContentRect = targetUnobscuredRect;
Note:
See TracChangeset
for help on using the changeset viewer.