Changeset 246852 in webkit
- Timestamp:
- Jun 26, 2019 4:10:21 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r246850 r246852 1 2019-06-26 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iPadOS] eddm.usps.com scrolls horizontally due to explicit width set in viewport meta tag 4 https://bugs.webkit.org/show_bug.cgi?id=199219 5 <rdar://problem/50425765> 6 7 Reviewed by Tim Horton. 8 9 Add a new test to verify that if the meta viewport tag specifies a wide fixed width value, we will still try to 10 shrink the page down to fit within the viewport. 11 12 * fast/viewport/ios/shrink-to-fit-content-large-constant-width-expected.txt: Added. 13 * fast/viewport/ios/shrink-to-fit-content-large-constant-width.html: Added. 14 1 15 2019-06-26 Joseph Pecoraro <pecoraro@apple.com> 2 16 -
trunk/Source/WebKit/ChangeLog
r246835 r246852 1 2019-06-26 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iPadOS] eddm.usps.com scrolls horizontally due to explicit width set in viewport meta tag 4 https://bugs.webkit.org/show_bug.cgi?id=199219 5 <rdar://problem/50425765> 6 7 Reviewed by Tim Horton. 8 9 Currently, the heuristic to determine whether the page should be shrunk to fit the content width after loading 10 works by checking whether the page's content is wider than the layout width we've provided for the page. 11 However, in the case where an explicit width larger than the true view width is specified by the page's meta 12 viewport, we'll end up believing that the page's content is not wider than the layout width, which is dictated 13 by the fixed meta viewport width. Instead, we can shrink the page down in this scenario by comparing the content 14 width against the scaled size of the view when computing the amount of horizontal overflow. 15 16 Test: fast/viewport/ios/shrink-to-fit-content-large-constant-width.html 17 18 * WebProcess/WebPage/ios/WebPageIOS.mm: 19 (WebKit::WebPage::immediatelyShrinkToFitContent): 20 1 21 2019-06-26 Zalan Bujtas <zalan@apple.com> 2 22 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r246835 r246852 3318 3318 static const int toleratedHorizontalScrollingDistance = 20; 3319 3319 static const int maximumExpandedLayoutWidth = 1280; 3320 3321 auto scaledViewWidth = [&] () -> int { 3322 return std::round(m_viewportConfiguration.viewLayoutSize().width() / m_viewportConfiguration.initialScale()); 3323 }; 3324 3320 3325 int originalContentWidth = view->contentsWidth(); 3326 int originalViewWidth = scaledViewWidth(); 3321 3327 int originalLayoutWidth = m_viewportConfiguration.layoutWidth(); 3322 int originalHorizontalOverflowAmount = originalContentWidth - original LayoutWidth;3323 if (originalHorizontalOverflowAmount <= toleratedHorizontalScrollingDistance || originalLayoutWidth >= maximumExpandedLayoutWidth || originalContentWidth <= m_viewportConfiguration.viewLayoutSize().width())3328 int originalHorizontalOverflowAmount = originalContentWidth - originalViewWidth; 3329 if (originalHorizontalOverflowAmount <= toleratedHorizontalScrollingDistance || originalLayoutWidth >= maximumExpandedLayoutWidth || originalContentWidth <= originalViewWidth) 3324 3330 return false; 3325 3331 … … 3335 3341 m_viewportConfiguration.setIsKnownToLayOutWiderThanViewport(true); 3336 3342 double originalMinimumDeviceWidth = m_viewportConfiguration.minimumEffectiveDeviceWidth(); 3337 if (changeMinimumEffectiveDeviceWidth(std::min(maximumExpandedLayoutWidth, originalContentWidth)) && view->contentsWidth() - m_viewportConfiguration.layoutWidth() > originalHorizontalOverflowAmount) {3343 if (changeMinimumEffectiveDeviceWidth(std::min(maximumExpandedLayoutWidth, originalContentWidth)) && view->contentsWidth() - scaledViewWidth() > originalHorizontalOverflowAmount) { 3338 3344 changeMinimumEffectiveDeviceWidth(originalMinimumDeviceWidth); 3339 3345 m_viewportConfiguration.setIsKnownToLayOutWiderThanViewport(false);
Note: See TracChangeset
for help on using the changeset viewer.