Changeset 229063 in webkit
- Timestamp:
- Feb 27, 2018 9:16:31 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r229062 r229063 1 2018-02-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior 4 https://bugs.webkit.org/show_bug.cgi?id=183100 5 <rdar://problem/37840987> 6 7 Reviewed by Tim Horton. 8 9 Introduce new customization options to ViewportConfiguration. The first is m_forceHorizontalShrinkToFit, which 10 (when set to true) forces the viewport to scale using shrink-to-fit heuristics, regardless of whether 11 "shrink-to-fit=no" is specified via viewport parameters or if content width did not exceed minimum layout size. 12 The second is m_viewSize, which reflects the true size of the viewport. See WebKit ChangeLog for more details. 13 14 Tests: ViewportSizingTests.ForceShrinkToFitViewportOverridesViewportParameters 15 ViewportSizingTests.ShrinkToFitViewportWithMinimumAllowedLayoutWidth 16 17 * page/ViewportConfiguration.cpp: 18 (WebCore::ViewportConfiguration::ViewportConfiguration): 19 (WebCore::ViewportConfiguration::setMinimumLayoutSize): 20 21 Plumb the real size of the view alongside the minimum layout size when updating the minimum layout size. 22 23 (WebCore::ViewportConfiguration::setForceHorizontalShrinkToFit): 24 (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const): 25 26 Bail early and return true if forceHorizontalShrinkToFit is set. This forces shrink-to-fit even in cases where 27 "shrink-to-fit" is set to "no", or content dimensions don't exceed layout dimensions. 28 29 (WebCore::ViewportConfiguration::initialScaleFromSize const): 30 31 Use view dimensions rather than minimum layout dimensions when computing the initial scale. Minimum layout size 32 is no longer always equal to the size of the view if the client has specified a minimum allowed layout width. As 33 such, when computing the initial scale, to ensure that the content (which was laid out using the minimum layout 34 size) fits within the real viewport, we need to divide real viewport dimensions by content dimensions. 35 36 (WebCore::ViewportConfiguration::minimumScale const): 37 38 Similarly, use view size instead of minimum layout size to compute minimum scale. 39 40 (WebCore::ViewportConfiguration::description const): 41 * page/ViewportConfiguration.h: 42 1 43 2018-02-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 44 -
trunk/Source/WebCore/page/ViewportConfiguration.cpp
r225449 r229063 50 50 , m_canIgnoreScalingConstraints(false) 51 51 , m_forceAlwaysUserScalable(false) 52 , m_forceHorizontalShrinkToFit(false) 52 53 { 53 54 // Setup a reasonable default configuration to avoid computing infinite scale/sizes. … … 83 84 } 84 85 85 bool ViewportConfiguration::setMinimumLayoutSize(const FloatSize& minimumLayoutSize )86 { 87 if (m_minimumLayoutSize == minimumLayoutSize )86 bool ViewportConfiguration::setMinimumLayoutSize(const FloatSize& minimumLayoutSize, const FloatSize& viewSize) 87 { 88 if (m_minimumLayoutSize == minimumLayoutSize && m_viewSize == viewSize) 88 89 return false; 89 90 90 91 m_minimumLayoutSize = minimumLayoutSize; 92 m_viewSize = viewSize; 93 91 94 updateConfiguration(); 92 95 return true; … … 104 107 } 105 108 109 bool ViewportConfiguration::setForceHorizontalShrinkToFit(bool forceHorizontalShrinkToFit) 110 { 111 if (m_forceHorizontalShrinkToFit == forceHorizontalShrinkToFit) 112 return false; 113 114 m_forceHorizontalShrinkToFit = forceHorizontalShrinkToFit; 115 return true; 116 } 117 106 118 bool ViewportConfiguration::setCanIgnoreScalingConstraints(bool canIgnoreScalingConstraints) 107 119 { … … 124 136 return false; 125 137 138 if (m_forceHorizontalShrinkToFit) 139 return true; 140 126 141 if (!m_configuration.allowsShrinkToFit) 127 142 return false; … … 168 183 // If not, it is up to us to determine the initial scale. 169 184 // We want a scale small enough to fit the document width-wise. 170 const FloatSize& minimumLayoutSize = m_minimumLayoutSize;171 185 double initialScale = 0; 172 186 if (width > 0 && !shouldIgnoreVerticalScalingConstraints()) 173 initialScale = m inimumLayoutSize.width() / width;187 initialScale = m_viewSize.width() / width; 174 188 175 189 // Prevent the initial scale from shrinking to a height smaller than our view's minimum height. 176 if (height > 0 && height * initialScale < minimumLayoutSize.height() && !shouldIgnoreHorizontalScalingConstraints()) 177 initialScale = minimumLayoutSize.height() / height; 190 if (height > 0 && height * initialScale < m_viewSize.height() && !shouldIgnoreHorizontalScalingConstraints()) 191 initialScale = m_viewSize.height() / height; 192 178 193 return std::min(std::max(initialScale, shouldIgnoreScalingConstraints ? m_defaultConfiguration.minimumScale : m_configuration.minimumScale), m_configuration.maximumScale); 179 194 } … … 201 216 minimumScale = std::min(minimumScale, forceAlwaysUserScalableMinimumScale); 202 217 203 const FloatSize& minimumLayoutSize = m_minimumLayoutSize;204 218 double contentWidth = m_contentSize.width(); 205 if (contentWidth > 0 && contentWidth * minimumScale < m inimumLayoutSize.width() && !shouldIgnoreVerticalScalingConstraints())206 minimumScale = m inimumLayoutSize.width() / contentWidth;219 if (contentWidth > 0 && contentWidth * minimumScale < m_viewSize.width() && !shouldIgnoreVerticalScalingConstraints()) 220 minimumScale = m_viewSize.width() / contentWidth; 207 221 208 222 double contentHeight = m_contentSize.height(); 209 if (contentHeight > 0 && contentHeight * minimumScale < m inimumLayoutSize.height() && !shouldIgnoreHorizontalScalingConstraints())210 minimumScale = m inimumLayoutSize.height() / contentHeight;223 if (contentHeight > 0 && contentHeight * minimumScale < m_viewSize.height() && !shouldIgnoreHorizontalScalingConstraints()) 224 minimumScale = m_viewSize.height() / contentHeight; 211 225 212 226 minimumScale = std::min(std::max(minimumScale, m_configuration.minimumScale), m_configuration.maximumScale); … … 491 505 ts.dumpProperty("ignoring vertical scaling constraints", shouldIgnoreVerticalScalingConstraints() ? "true" : "false"); 492 506 ts.dumpProperty("avoids unsafe area", avoidsUnsafeArea() ? "true" : "false"); 507 ts.dumpProperty("force horizontal shrink to fit", m_forceHorizontalShrinkToFit ? "true" : "false"); 493 508 494 509 ts.endGroup(); -
trunk/Source/WebCore/page/ViewportConfiguration.h
r225449 r229063 76 76 77 77 const FloatSize& minimumLayoutSize() const { return m_minimumLayoutSize; } 78 WEBCORE_EXPORT bool setMinimumLayoutSize(const FloatSize& );78 WEBCORE_EXPORT bool setMinimumLayoutSize(const FloatSize&, const FloatSize& viewSize); 79 79 80 80 const ViewportArguments& viewportArguments() const { return m_viewportArguments; } 81 81 WEBCORE_EXPORT bool setViewportArguments(const ViewportArguments&); 82 83 WEBCORE_EXPORT bool setForceHorizontalShrinkToFit(bool); 82 84 83 85 WEBCORE_EXPORT bool setCanIgnoreScalingConstraints(bool); … … 121 123 IntSize m_contentSize; 122 124 FloatSize m_minimumLayoutSize; 125 FloatSize m_viewSize; 123 126 ViewportArguments m_viewportArguments; 124 127 125 128 bool m_canIgnoreScalingConstraints; 126 129 bool m_forceAlwaysUserScalable; 130 bool m_forceHorizontalShrinkToFit; 127 131 }; 128 132 -
trunk/Source/WebKit/ChangeLog
r229055 r229063 1 2018-02-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior 4 https://bugs.webkit.org/show_bug.cgi?id=183100 5 <rdar://problem/37840987> 6 7 Reviewed by Tim Horton. 8 9 Add new SPI hooks to provide finer control over certain aspects of the shrink-to-fit viewport heuristic. 10 Currently, in certain cases of iPad multitasking, Safari allows shrinking content to fit by default. This means 11 that even when "width=device-width" is used, if the contents of the page are too wide to fit within the 12 viewport's width, we'll adjust the initial scale such that the viewport can fit all of the content. 13 14 However, in certain viewport dimensions, this heuristic is insufficient to ensure that pages are laid out and 15 displayed properly within the viewport. Namely, one could imagine that an element with a hard-coded width that 16 is larger than the real viewport width would cause all other elements with dimensions relative to the body to be 17 excessively shrunk down once shrink-to-fit is applied, so the page would still look broken even if the contents 18 of the page all fit within the viewport. 19 20 To mitigate this, we decouple the notions of minimum layout size from the size of the actual viewport (which we 21 simply refer to as "view size"). This allows us to introduce a mechanism where we lay out the page at a given 22 minimum layout size that is larger than the size of the view; later, when we determine the initial scale, we 23 then apply shrink-to-fit scaling using the view size rather than the minimum layout size. This grants us the 24 ability to lay out content as if our view were large, but still ensure that the contents of the page fit within 25 the actual view. 26 27 * Shared/VisibleContentRectUpdateInfo.cpp: 28 (WebKit::VisibleContentRectUpdateInfo::encode const): 29 (WebKit::VisibleContentRectUpdateInfo::decode): 30 (WebKit::operator<<): 31 * Shared/VisibleContentRectUpdateInfo.h: 32 (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): 33 (WebKit::VisibleContentRectUpdateInfo::forceHorizontalShrinkToFit const): 34 (WebKit::operator==): 35 36 Plumb the forceHorizontalShrinkToFit flag through VisibleContentRectUpdateInfo. 37 38 * Shared/WebPageCreationParameters.cpp: 39 (WebKit::WebPageCreationParameters::encode const): 40 (WebKit::WebPageCreationParameters::decode): 41 * Shared/WebPageCreationParameters.h: 42 43 Plumb viewSize through IPC to WebPage. 44 45 * UIProcess/API/Cocoa/WKWebView.mm: 46 (-[WKWebView _initializeWithConfiguration:]): 47 48 Start off WKWebView flags at their initial values. 49 50 (-[WKWebView _minimumAllowedLayoutWidth]): 51 (-[WKWebView _setMinimumAllowedLayoutWidth:]): 52 53 This provides the minimum width at which the page will lay out, such that if the view width dips below this 54 value, we'll use this minimum allowed layout width instead. 0 by default. 55 56 (-[WKWebView activeMinimumLayoutSizes:]): 57 58 Refactor this from a static function to a helper method on WKWebView that computes both the minimum layout size 59 (which takes minimum allowed layout width into account) as well as the real view size. Refactor all call sites 60 to use this new method, and also propagate the view size down via IPC, alongside the minimum layout size. 61 62 (-[WKWebView _dispatchSetMinimumLayoutSize:viewSize:]): 63 (-[WKWebView _frameOrBoundsChanged]): 64 (-[WKWebView _setMinimumLayoutSizeOverride:]): 65 (-[WKWebView _setForceHorizontalViewportShrinkToFit:]): 66 (-[WKWebView _forceHorizontalViewportShrinkToFit]): 67 68 Setting this flag to YES forces us to always shrink-to-fit in the horizontal axis. NO by default. 69 70 (-[WKWebView _beginAnimatedResizeWithUpdates:]): 71 (-[WKWebView _endAnimatedResize]): 72 (activeMinimumLayoutSize): Deleted. 73 74 More refactoring to replace activeMinimumLayoutSize() with -activeMinimumLayoutSizes:. 75 76 (-[WKWebView _dispatchSetMinimumLayoutSize:]): Deleted. 77 * UIProcess/API/Cocoa/WKWebViewPrivate.h: 78 * UIProcess/WebPageProxy.cpp: 79 (WebKit::WebPageProxy::creationParameters): 80 * UIProcess/WebPageProxy.h: 81 * UIProcess/ios/WKContentView.mm: 82 (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): 83 84 Pass _forceHorizontalViewportShrinkToFit into the visible content rect update. 85 86 * UIProcess/ios/WebPageProxyIOS.mm: 87 (WebKit::WebPageProxy::dynamicViewportSizeUpdate): 88 (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize): 89 90 Plumb viewSize alongside the existing minimumLayoutSize. 91 92 * WebProcess/WebPage/WebPage.cpp: 93 (WebKit::m_credentialsMessenger): 94 * WebProcess/WebPage/WebPage.h: 95 * WebProcess/WebPage/WebPage.messages.in: 96 * WebProcess/WebPage/ios/WebPageIOS.mm: 97 (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): 98 (WebKit::WebPage::dynamicViewportSizeUpdate): 99 (WebKit::WebPage::updateVisibleContentRects): 100 101 Set forceHorizontalShrinkToFit on the viewport configuration here. 102 1 103 2018-02-27 Tim Horton <timothy_horton@apple.com> 2 104 -
trunk/Source/WebKit/Shared/VisibleContentRectUpdateInfo.cpp
r225715 r229063 54 54 encoder << m_isChangingObscuredInsetsInteractively; 55 55 encoder << m_allowShrinkToFit; 56 encoder << m_forceHorizontalShrinkToFit; 56 57 encoder << m_enclosedInScrollableAncestorView; 57 58 } … … 93 94 if (!decoder.decode(result.m_allowShrinkToFit)) 94 95 return false; 96 if (!decoder.decode(result.m_forceHorizontalShrinkToFit)) 97 return false; 95 98 if (!decoder.decode(result.m_enclosedInScrollableAncestorView)) 96 99 return false; … … 131 134 132 135 ts.dumpProperty("timestamp", info.timestamp().secondsSinceEpoch().value()); 136 ts.dumpProperty("allowShrinkToFit", info.allowShrinkToFit()); 137 ts.dumpProperty("forceHorizontalShrinkToFit", info.forceHorizontalShrinkToFit()); 133 138 if (info.horizontalVelocity()) 134 139 ts.dumpProperty("horizontalVelocity", info.horizontalVelocity()); -
trunk/Source/WebKit/Shared/VisibleContentRectUpdateInfo.h
r225715 r229063 46 46 VisibleContentRectUpdateInfo() = default; 47 47 48 VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedContentRect, const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& customFixedPositionRect, const WebCore::FloatBoxExtent& obscuredInsets, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double scale, bool inStableState, bool isFirstUpdateForNewViewSize, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, bool enclosedInScrollableAncestorView, MonotonicTime timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId)48 VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedContentRect, const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& customFixedPositionRect, const WebCore::FloatBoxExtent& obscuredInsets, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double scale, bool inStableState, bool isFirstUpdateForNewViewSize, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, bool forceHorizontalShrinkToFit, bool enclosedInScrollableAncestorView, MonotonicTime timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId) 49 49 : m_exposedContentRect(exposedContentRect) 50 50 , m_unobscuredContentRect(unobscuredContentRect) … … 64 64 , m_isChangingObscuredInsetsInteractively(isChangingObscuredInsetsInteractively) 65 65 , m_allowShrinkToFit(allowShrinkToFit) 66 , m_forceHorizontalShrinkToFit(forceHorizontalShrinkToFit) 66 67 , m_enclosedInScrollableAncestorView(enclosedInScrollableAncestorView) 67 68 { … … 81 82 bool isChangingObscuredInsetsInteractively() const { return m_isChangingObscuredInsetsInteractively; } 82 83 bool allowShrinkToFit() const { return m_allowShrinkToFit; } 84 bool forceHorizontalShrinkToFit() const { return m_forceHorizontalShrinkToFit; } 83 85 bool enclosedInScrollableAncestorView() const { return m_enclosedInScrollableAncestorView; } 84 86 … … 113 115 bool m_isChangingObscuredInsetsInteractively { false }; 114 116 bool m_allowShrinkToFit { false }; 117 bool m_forceHorizontalShrinkToFit { false }; 115 118 bool m_enclosedInScrollableAncestorView { false }; 116 119 }; … … 131 134 && a.isFirstUpdateForNewViewSize() == b.isFirstUpdateForNewViewSize() 132 135 && a.allowShrinkToFit() == b.allowShrinkToFit() 136 && a.forceHorizontalShrinkToFit() == b.forceHorizontalShrinkToFit() 133 137 && a.enclosedInScrollableAncestorView() == b.enclosedInScrollableAncestorView(); 134 138 } -
trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp
r228188 r229063 89 89 encoder << ignoresViewportScaleLimits; 90 90 encoder << viewportConfigurationMinimumLayoutSize; 91 encoder << viewportConfigurationViewSize; 91 92 encoder << maximumUnobscuredSize; 92 93 #endif … … 245 246 if (!decoder.decode(parameters.viewportConfigurationMinimumLayoutSize)) 246 247 return std::nullopt; 248 if (!decoder.decode(parameters.viewportConfigurationViewSize)) 249 return std::nullopt; 247 250 if (!decoder.decode(parameters.maximumUnobscuredSize)) 248 251 return std::nullopt; -
trunk/Source/WebKit/Shared/WebPageCreationParameters.h
r228188 r229063 146 146 bool ignoresViewportScaleLimits; 147 147 WebCore::FloatSize viewportConfigurationMinimumLayoutSize; 148 WebCore::FloatSize viewportConfigurationViewSize; 148 149 WebCore::FloatSize maximumUnobscuredSize; 149 150 #endif -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r229055 r229063 190 190 }; 191 191 192 struct ActiveViewportLayoutSizes { 193 WebCore::FloatSize minimumLayoutSize; 194 WebCore::FloatSize viewSize; 195 }; 196 192 197 #endif // PLATFORM(IOS) 193 198 … … 303 308 304 309 BOOL _allowsViewportShrinkToFit; 310 BOOL _forceHorizontalViewportShrinkToFit; 311 CGFloat _minimumAllowedLayoutWidth; 305 312 306 313 BOOL _hasCommittedLoadForMainFrame; … … 699 706 #if PLATFORM(IOS) 700 707 _dragInteractionPolicy = _WKDragInteractionPolicyDefault; 701 #endif 708 #if ENABLE(EXTRA_ZOOM_MODE) 709 _minimumAllowedLayoutWidth = 320; 710 _allowsViewportShrinkToFit = YES; 711 _forceHorizontalViewportShrinkToFit = YES; 712 #else 713 _minimumAllowedLayoutWidth = 0; 714 _allowsViewportShrinkToFit = NO; 715 _forceHorizontalViewportShrinkToFit = NO; 716 #endif 717 #endif // PLATFORM(IOS) 702 718 } 703 719 … … 2482 2498 } 2483 2499 2484 static WebCore::FloatSize activeMinimumLayoutSize(WKWebView *webView, const CGRect& bounds) 2485 { 2486 if (webView->_overridesMinimumLayoutSize) 2487 return WebCore::FloatSize(webView->_minimumLayoutSizeOverride); 2488 2500 - (CGFloat)_minimumAllowedLayoutWidth 2501 { 2502 return _minimumAllowedLayoutWidth; 2503 } 2504 2505 - (void)_setMinimumAllowedLayoutWidth:(CGFloat)minimumAllowedLayoutWidth 2506 { 2507 if (_minimumAllowedLayoutWidth == minimumAllowedLayoutWidth) 2508 return; 2509 2510 _minimumAllowedLayoutWidth = minimumAllowedLayoutWidth; 2511 2512 auto sizes = [self activeMinimumLayoutSizes:self.bounds]; 2513 [self _dispatchSetMinimumLayoutSize:sizes.minimumLayoutSize viewSize:sizes.viewSize]; 2514 } 2515 2516 - (ActiveViewportLayoutSizes)activeMinimumLayoutSizes:(const CGRect&)bounds 2517 { 2518 if (_overridesMinimumLayoutSize) 2519 return { WebCore::FloatSize(_minimumLayoutSizeOverride), WebCore::FloatSize(_minimumLayoutSizeOverride) }; 2520 2521 ActiveViewportLayoutSizes sizes; 2489 2522 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 2490 return WebCore::FloatSize(UIEdgeInsetsInsetRect(CGRectMake(0, 0, bounds.size.width, bounds.size.height), webView._scrollViewSystemContentInset).size);2523 sizes.viewSize = WebCore::FloatSize(UIEdgeInsetsInsetRect(CGRectMake(0, 0, bounds.size.width, bounds.size.height), self._scrollViewSystemContentInset).size); 2491 2524 #else 2492 return WebCore::FloatSize(bounds.size); 2493 #endif 2494 } 2495 2496 - (void)_dispatchSetMinimumLayoutSize:(WebCore::FloatSize)minimumLayoutSize 2525 sizes.viewSize = WebCore::FloatSize { bounds.size }; 2526 #endif 2527 2528 sizes.minimumLayoutSize = { std::max<float>(sizes.viewSize.width(), self._minimumAllowedLayoutWidth), sizes.viewSize.height() }; 2529 return sizes; 2530 } 2531 2532 - (void)_dispatchSetMinimumLayoutSize:(WebCore::FloatSize)minimumLayoutSize viewSize:(WebCore::FloatSize)viewSize 2497 2533 { 2498 2534 if (_lastSentMinimumLayoutSize && CGSizeEqualToSize(_lastSentMinimumLayoutSize.value(), minimumLayoutSize)) 2499 2535 return; 2500 2536 2501 LOG_WITH_STREAM(VisibleRects, stream << "-[WKWebView " << _page->pageID() << " _dispatchSetMinimumLayoutSize:] " << minimumLayoutSize << " contentZoomScale " << contentZoomScale(self));2502 _page->setViewportConfigurationMinimumLayoutSize(minimumLayoutSize );2537 LOG_WITH_STREAM(VisibleRects, stream << "-[WKWebView " << _page->pageID() << " _dispatchSetMinimumLayoutSize:] " << minimumLayoutSize << " viewSize " << viewSize << " contentZoomScale " << contentZoomScale(self)); 2538 _page->setViewportConfigurationMinimumLayoutSize(minimumLayoutSize, viewSize); 2503 2539 _lastSentMinimumLayoutSize = minimumLayoutSize; 2504 2540 } … … 2528 2564 2529 2565 if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing) { 2530 if (!_overridesMinimumLayoutSize) 2531 [self _dispatchSetMinimumLayoutSize:activeMinimumLayoutSize(self, self.bounds)]; 2566 if (!_overridesMinimumLayoutSize) { 2567 auto sizes = [self activeMinimumLayoutSizes:self.bounds]; 2568 [self _dispatchSetMinimumLayoutSize:sizes.minimumLayoutSize viewSize:sizes.viewSize]; 2569 } 2532 2570 if (!_overridesMaximumUnobscuredSize) 2533 2571 [self _dispatchSetMaximumUnobscuredSize:WebCore::FloatSize(bounds.size)]; … … 4903 4941 4904 4942 if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing) 4905 [self _dispatchSetMinimumLayoutSize:WebCore::FloatSize(minimumLayoutSizeOverride) ];4943 [self _dispatchSetMinimumLayoutSize:WebCore::FloatSize(minimumLayoutSizeOverride) viewSize:WebCore::FloatSize(minimumLayoutSizeOverride)]; 4906 4944 4907 4945 } … … 5010 5048 } 5011 5049 5050 - (void)_setForceHorizontalViewportShrinkToFit:(BOOL)forceHorizontalViewportShrinkToFit 5051 { 5052 if (_forceHorizontalViewportShrinkToFit == forceHorizontalViewportShrinkToFit) 5053 return; 5054 5055 _forceHorizontalViewportShrinkToFit = forceHorizontalViewportShrinkToFit; 5056 [self _scheduleVisibleContentRectUpdate]; 5057 } 5058 5059 - (BOOL)_forceHorizontalViewportShrinkToFit 5060 { 5061 return _forceHorizontalViewportShrinkToFit; 5062 } 5063 5012 5064 - (void)_setAllowsViewportShrinkToFit:(BOOL)allowShrinkToFit 5013 5065 { … … 5051 5103 _dynamicViewportUpdateMode = DynamicViewportUpdateMode::ResizingWithAnimation; 5052 5104 5053 WebCore::FloatSize oldMinimumLayoutSize = activeMinimumLayoutSize(self, oldBounds);5054 WebCore::FloatSizeoldMaximumUnobscuredSize = activeMaximumUnobscuredSize(self, oldBounds);5105 auto oldSizes = [self activeMinimumLayoutSizes:self.bounds]; 5106 auto oldMaximumUnobscuredSize = activeMaximumUnobscuredSize(self, oldBounds); 5055 5107 int32_t oldOrientation = activeOrientation(self); 5056 5108 UIEdgeInsets oldObscuredInsets = _obscuredInsets; … … 5059 5111 5060 5112 CGRect newBounds = self.bounds; 5061 WebCore::FloatSize newMinimumLayoutSize = activeMinimumLayoutSize(self, newBounds);5062 WebCore::FloatSizenewMaximumUnobscuredSize = activeMaximumUnobscuredSize(self, newBounds);5113 auto newSizes = [self activeMinimumLayoutSizes:newBounds]; 5114 auto newMaximumUnobscuredSize = activeMaximumUnobscuredSize(self, newBounds); 5063 5115 int32_t newOrientation = activeOrientation(self); 5064 5116 UIEdgeInsets newObscuredInsets = _obscuredInsets; … … 5066 5118 CGRect contentViewBounds = [_contentView bounds]; 5067 5119 5068 ASSERT_WITH_MESSAGE(!(_overridesMinimumLayoutSize && new MinimumLayoutSize.isEmpty()), "Clients controlling the layout size should maintain a valid layout size to minimize layouts.");5069 if (CGRectIsEmpty(newBounds) || new MinimumLayoutSize.isEmpty() || CGRectIsEmpty(futureUnobscuredRectInSelfCoordinates) || CGRectIsEmpty(contentViewBounds)) {5120 ASSERT_WITH_MESSAGE(!(_overridesMinimumLayoutSize && newSizes.minimumLayoutSize.isEmpty()), "Clients controlling the layout size should maintain a valid layout size to minimize layouts."); 5121 if (CGRectIsEmpty(newBounds) || newSizes.minimumLayoutSize.isEmpty() || CGRectIsEmpty(futureUnobscuredRectInSelfCoordinates) || CGRectIsEmpty(contentViewBounds)) { 5070 5122 _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing; 5071 5123 [self _frameOrBoundsChanged]; 5072 5124 if (_overridesMinimumLayoutSize) 5073 [self _dispatchSetMinimumLayoutSize: WebCore::FloatSize(newMinimumLayoutSize)];5125 [self _dispatchSetMinimumLayoutSize:newSizes.minimumLayoutSize viewSize:newSizes.viewSize]; 5074 5126 if (_overridesMaximumUnobscuredSize) 5075 5127 [self _dispatchSetMaximumUnobscuredSize:WebCore::FloatSize(newMaximumUnobscuredSize)]; … … 5082 5134 5083 5135 if (CGRectEqualToRect(oldBounds, newBounds) 5084 && old MinimumLayoutSize == newMinimumLayoutSize5136 && oldSizes.minimumLayoutSize == newSizes.minimumLayoutSize 5085 5137 && oldMaximumUnobscuredSize == newMaximumUnobscuredSize 5086 5138 && oldOrientation == newOrientation … … 5102 5154 5103 5155 CGSize contentSizeInContentViewCoordinates = contentViewBounds.size; 5104 [_scrollView setMinimumZoomScale:std::min(new MinimumLayoutSize.width() / contentSizeInContentViewCoordinates.width, [_scrollView minimumZoomScale])];5105 [_scrollView setMaximumZoomScale:std::max(new MinimumLayoutSize.width() / contentSizeInContentViewCoordinates.width, [_scrollView maximumZoomScale])];5156 [_scrollView setMinimumZoomScale:std::min(newSizes.minimumLayoutSize.width() / contentSizeInContentViewCoordinates.width, [_scrollView minimumZoomScale])]; 5157 [_scrollView setMaximumZoomScale:std::max(newSizes.minimumLayoutSize.width() / contentSizeInContentViewCoordinates.width, [_scrollView maximumZoomScale])]; 5106 5158 5107 5159 // Compute the new scale to keep the current content width in the scrollview. 5108 5160 CGFloat oldWebViewWidthInContentViewCoordinates = oldUnobscuredContentRect.width(); 5109 5161 CGFloat visibleContentViewWidthInContentCoordinates = std::min(contentSizeInContentViewCoordinates.width, oldWebViewWidthInContentViewCoordinates); 5110 CGFloat targetScale = new MinimumLayoutSize.width() / visibleContentViewWidthInContentCoordinates;5162 CGFloat targetScale = newSizes.minimumLayoutSize.width() / visibleContentViewWidthInContentCoordinates; 5111 5163 CGFloat resizeAnimationViewAnimationScale = targetScale / contentZoomScale(self); 5112 5164 [_resizeAnimationView setTransform:CGAffineTransformMakeScale(resizeAnimationViewAnimationScale, resizeAnimationViewAnimationScale)]; … … 5148 5200 WebCore::FloatBoxExtent unobscuredSafeAreaInsetsExtent(unobscuredSafeAreaInsets.top, unobscuredSafeAreaInsets.right, unobscuredSafeAreaInsets.bottom, unobscuredSafeAreaInsets.left); 5149 5201 5150 _lastSentMinimumLayoutSize = new MinimumLayoutSize;5202 _lastSentMinimumLayoutSize = newSizes.minimumLayoutSize; 5151 5203 _lastSentMaximumUnobscuredSize = newMaximumUnobscuredSize; 5152 5204 _lastSentDeviceOrientation = newOrientation; 5153 5205 5154 _page->dynamicViewportSizeUpdate(new MinimumLayoutSize, newMaximumUnobscuredSize, visibleRectInContentCoordinates, unobscuredRectInContentCoordinates, futureUnobscuredRectInSelfCoordinates, unobscuredSafeAreaInsetsExtent, targetScale, newOrientation);5206 _page->dynamicViewportSizeUpdate(newSizes.minimumLayoutSize, newSizes.viewSize, newMaximumUnobscuredSize, visibleRectInContentCoordinates, unobscuredRectInContentCoordinates, futureUnobscuredRectInSelfCoordinates, unobscuredSafeAreaInsetsExtent, targetScale, newOrientation); 5155 5207 if (WebKit::DrawingAreaProxy* drawingArea = _page->drawingArea()) 5156 5208 drawingArea->setSize(WebCore::IntSize(newBounds.size)); … … 5217 5269 5218 5270 CGRect newBounds = self.bounds; 5219 WebCore::FloatSize newMinimumLayoutSize = activeMinimumLayoutSize(self, newBounds);5220 WebCore::FloatSizenewMaximumUnobscuredSize = activeMaximumUnobscuredSize(self, newBounds);5271 auto newSizes = [self activeMinimumLayoutSizes:newBounds]; 5272 auto newMaximumUnobscuredSize = activeMaximumUnobscuredSize(self, newBounds); 5221 5273 int32_t newOrientation = activeOrientation(self); 5222 5274 5223 if (!_lastSentMinimumLayoutSize || new MinimumLayoutSize != _lastSentMinimumLayoutSize.value())5224 [self _dispatchSetMinimumLayoutSize: WebCore::FloatSize(newMinimumLayoutSize)];5275 if (!_lastSentMinimumLayoutSize || newSizes.minimumLayoutSize != _lastSentMinimumLayoutSize.value()) 5276 [self _dispatchSetMinimumLayoutSize:newSizes.minimumLayoutSize viewSize:newSizes.viewSize]; 5225 5277 if (!_lastSentMaximumUnobscuredSize || newMaximumUnobscuredSize != _lastSentMaximumUnobscuredSize.value()) 5226 5278 [self _dispatchSetMaximumUnobscuredSize:WebCore::FloatSize(newMaximumUnobscuredSize)]; -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
r227765 r229063 205 205 206 206 @property (nonatomic, setter=_setAllowsViewportShrinkToFit:) BOOL _allowsViewportShrinkToFit; 207 @property (nonatomic, setter=_setForceHorizontalViewportShrinkToFit:) BOOL _forceHorizontalViewportShrinkToFit WK_API_AVAILABLE(ios(WK_IOS_TBA)); 208 @property (nonatomic, setter=_setMinimumAllowedLayoutWidth:) CGFloat _minimumAllowedLayoutWidth WK_API_AVAILABLE(ios(WK_IOS_TBA)); 207 209 208 210 // FIXME: Remove these three properties once we expose WKWebViewContentProvider as API. -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r228887 r229063 5854 5854 parameters.ignoresViewportScaleLimits = m_forceAlwaysUserScalable; 5855 5855 parameters.viewportConfigurationMinimumLayoutSize = m_viewportConfigurationMinimumLayoutSize; 5856 parameters.viewportConfigurationViewSize = m_viewportConfigurationViewSize; 5856 5857 parameters.maximumUnobscuredSize = m_maximumUnobscuredSize; 5857 5858 #endif -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r228857 r229063 533 533 void overflowScrollDidEndScroll(); 534 534 535 void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation);535 void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& viewSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation); 536 536 void synchronizeDynamicViewportUpdate(); 537 537 538 void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize& );538 void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&, const WebCore::FloatSize& viewSize); 539 539 void setMaximumUnobscuredSize(const WebCore::FloatSize&); 540 540 void setDeviceOrientation(int32_t); … … 2089 2089 bool m_forceAlwaysUserScalable { false }; 2090 2090 WebCore::FloatSize m_viewportConfigurationMinimumLayoutSize; 2091 WebCore::FloatSize m_viewportConfigurationViewSize; 2091 2092 WebCore::FloatSize m_maximumUnobscuredSize; 2092 2093 #endif -
trunk/Source/WebKit/UIProcess/ios/WKContentView.mm
r224313 r229063 426 426 isChangingObscuredInsetsInteractively, 427 427 _webView._allowsViewportShrinkToFit, 428 _webView._forceHorizontalViewportShrinkToFit, 428 429 enclosedInScrollableAncestorView, 429 430 timestamp, -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r228857 r229063 305 305 } 306 306 307 void WebPageProxy::dynamicViewportSizeUpdate(const FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation)307 void WebPageProxy::dynamicViewportSizeUpdate(const FloatSize& minimumLayoutSize, const FloatSize& viewSize, const WebCore::FloatSize& maximumUnobscuredSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation) 308 308 { 309 309 if (!isValid()) … … 314 314 m_dynamicViewportSizeUpdateWaitingForTarget = true; 315 315 m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit = true; 316 m_process->send(Messages::WebPage::DynamicViewportSizeUpdate(minimumLayoutSize, maximumUnobscuredSize, targetExposedContentRect, targetUnobscuredRect, targetUnobscuredRectInScrollViewCoordinates, unobscuredSafeAreaInsets, targetScale, deviceOrientation, ++m_currentDynamicViewportSizeUpdateID), m_pageID);316 m_process->send(Messages::WebPage::DynamicViewportSizeUpdate(minimumLayoutSize, viewSize, maximumUnobscuredSize, targetExposedContentRect, targetUnobscuredRect, targetUnobscuredRectInScrollViewCoordinates, unobscuredSafeAreaInsets, targetScale, deviceOrientation, ++m_currentDynamicViewportSizeUpdateID), m_pageID); 317 317 } 318 318 … … 354 354 } 355 355 356 void WebPageProxy::setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize& size )356 void WebPageProxy::setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize& size, const WebCore::FloatSize& viewSize) 357 357 { 358 358 m_viewportConfigurationMinimumLayoutSize = size; 359 m_viewportConfigurationViewSize = viewSize; 359 360 360 361 if (isValid()) 361 m_process->send(Messages::WebPage::SetViewportConfigurationMinimumLayoutSize(size ), m_pageID);362 m_process->send(Messages::WebPage::SetViewportConfigurationMinimumLayoutSize(size, viewSize), m_pageID); 362 363 } 363 364 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r229037 r229063 605 605 606 606 #if PLATFORM(IOS) 607 setViewportConfigurationMinimumLayoutSize(parameters.viewportConfigurationMinimumLayoutSize );607 setViewportConfigurationMinimumLayoutSize(parameters.viewportConfigurationMinimumLayoutSize, parameters.viewportConfigurationViewSize); 608 608 setMaximumUnobscuredSize(parameters.maximumUnobscuredSize); 609 609 #endif -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r228602 r229063 868 868 869 869 #if PLATFORM(IOS) 870 void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize& );870 void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&, const WebCore::FloatSize& viewSize); 871 871 void setMaximumUnobscuredSize(const WebCore::FloatSize&); 872 872 void setDeviceOrientation(int32_t); 873 void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID);873 void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& viewSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID); 874 874 void synchronizeDynamicViewportUpdate(double& newTargetScale, WebCore::FloatPoint& newScrollPosition, uint64_t& nextValidLayerTreeTransactionID); 875 875 std::optional<float> scaleFromUIProcess(const VisibleContentRectUpdateInfo&) const; -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r228602 r229063 42 42 MouseEvent(WebKit::WebMouseEvent event) 43 43 #if PLATFORM(IOS) 44 SetViewportConfigurationMinimumLayoutSize(WebCore::FloatSize size )44 SetViewportConfigurationMinimumLayoutSize(WebCore::FloatSize size, WebCore::FloatSize viewSize) 45 45 SetMaximumUnobscuredSize(WebCore::FloatSize size) 46 46 SetDeviceOrientation(int32_t deviceOrientation) 47 DynamicViewportSizeUpdate(WebCore::FloatSize minimumLayoutSize, WebCore::FloatSize maximumUnobscuredSize, WebCore::FloatRect targetExposedContentRect, WebCore::FloatRect targetUnobscuredRect, WebCore::FloatRect targetUnobscuredRectInScrollViewCoordinates, WebCore::RectEdges<float> targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID)47 DynamicViewportSizeUpdate(WebCore::FloatSize minimumLayoutSize, WebCore::FloatSize viewSize, WebCore::FloatSize maximumUnobscuredSize, WebCore::FloatRect targetExposedContentRect, WebCore::FloatRect targetUnobscuredRect, WebCore::FloatRect targetUnobscuredRectInScrollViewCoordinates, WebCore::RectEdges<float> targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID) 48 48 SynchronizeDynamicViewportUpdate() -> (double newTargetScale, WebCore::FloatPoint newScrollPosition, uint64_t nextValidLayerTreeTransactionID) 49 49 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r228933 r229063 2852 2852 } 2853 2853 2854 void WebPage::setViewportConfigurationMinimumLayoutSize(const FloatSize& size )2855 { 2856 LOG_WITH_STREAM(VisibleRects, stream << "WebPage " << m_pageID << " setViewportConfigurationMinimumLayoutSize " << size );2857 if (m_viewportConfiguration.setMinimumLayoutSize(size ))2854 void WebPage::setViewportConfigurationMinimumLayoutSize(const FloatSize& size, const FloatSize& viewSize) 2855 { 2856 LOG_WITH_STREAM(VisibleRects, stream << "WebPage " << m_pageID << " setViewportConfigurationMinimumLayoutSize " << size << " viewSize " << viewSize); 2857 if (m_viewportConfiguration.setMinimumLayoutSize(size, viewSize)) 2858 2858 viewportConfigurationChanged(); 2859 2859 } … … 2890 2890 } 2891 2891 2892 void WebPage::dynamicViewportSizeUpdate(const FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& targetUnobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID)2892 void WebPage::dynamicViewportSizeUpdate(const FloatSize& minimumLayoutSize, const FloatSize& viewSize, const WebCore::FloatSize& maximumUnobscuredSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& targetUnobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID) 2893 2893 { 2894 2894 SetForScope<bool> dynamicSizeUpdateGuard(m_inDynamicSizeUpdate, true); 2895 2895 // FIXME: this does not handle the cases where the content would change the content size or scroll position from JavaScript. 2896 2896 // To handle those cases, we would need to redo this computation on every change until the next visible content rect update. 2897 LOG_WITH_STREAM(VisibleRects, stream << "\nWebPage::dynamicViewportSizeUpdate - minimumLayoutSize " << minimumLayoutSize << " targetUnobscuredRect " << targetUnobscuredRect << " targetExposedContentRect " << targetExposedContentRect << " targetScale " << targetScale);2897 LOG_WITH_STREAM(VisibleRects, stream << "\nWebPage::dynamicViewportSizeUpdate - minimumLayoutSize " << minimumLayoutSize << " viewSize " << viewSize << " targetUnobscuredRect " << targetUnobscuredRect << " targetExposedContentRect " << targetExposedContentRect << " targetScale " << targetScale); 2898 2898 2899 2899 FrameView& frameView = *m_page->mainFrame().view(); … … 2928 2928 2929 2929 LOG_WITH_STREAM(VisibleRects, stream << "WebPage::dynamicViewportSizeUpdate setting minimum layout size to " << minimumLayoutSize); 2930 m_viewportConfiguration.setMinimumLayoutSize(minimumLayoutSize );2930 m_viewportConfiguration.setMinimumLayoutSize(minimumLayoutSize, viewSize); 2931 2931 IntSize newLayoutSize = m_viewportConfiguration.layoutSize(); 2932 2932 … … 3308 3308 m_dynamicSizeUpdateHistory.clear(); 3309 3309 3310 if (m_viewportConfiguration.setCanIgnoreScalingConstraints(m_ignoreViewportScalingConstraints && visibleContentRectUpdateInfo.allowShrinkToFit())) 3310 bool didUpdateForceHorizontalShrinkToFit = m_viewportConfiguration.setForceHorizontalShrinkToFit(visibleContentRectUpdateInfo.forceHorizontalShrinkToFit()); 3311 bool didUpdateCanIgnoreViewportScalingConstraints = m_viewportConfiguration.setCanIgnoreScalingConstraints(m_ignoreViewportScalingConstraints && visibleContentRectUpdateInfo.allowShrinkToFit()); 3312 if (didUpdateForceHorizontalShrinkToFit || didUpdateCanIgnoreViewportScalingConstraints) 3311 3313 viewportConfigurationChanged(); 3312 3314 -
trunk/Tools/ChangeLog
r229057 r229063 1 2018-02-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior 4 https://bugs.webkit.org/show_bug.cgi?id=183100 5 <rdar://problem/37840987> 6 7 Reviewed by Tim Horton. 8 9 Add API tests that exercise -_setMinimumAllowedLayoutWidth: and -_setForceHorizontalViewportShrinkToFit:. See 10 WebKit ChangeLog for more detail. 11 12 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 13 * TestWebKitAPI/Tests/ios/ViewportSizingTests.mm: Added. 14 (TestWebKitAPI::while): 15 (viewportTestPageMarkup): 16 (TestWebKitAPI::TEST): 17 1 18 2018-02-27 Yusuke Suzuki <utatane.tea@gmail.com> 2 19 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r228569 r229063 91 91 2E1B7B001D41ABA7007558B4 /* large-video-seek-after-ending.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 2E1B7AFF1D41A95F007558B4 /* large-video-seek-after-ending.html */; }; 92 92 2E1B7B021D41B1B9007558B4 /* large-video-hides-controls-after-seek-to-end.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 2E1B7B011D41B1B3007558B4 /* large-video-hides-controls-after-seek-to-end.html */; }; 93 2E1B881F2040EE5300FFF6A9 /* ViewportSizingTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E1B881E2040EE5300FFF6A9 /* ViewportSizingTests.mm */; }; 93 94 2E1DFDED1D42A51100714A00 /* large-videos-with-audio.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 2E1DFDEC1D42A41C00714A00 /* large-videos-with-audio.html */; }; 94 95 2E1DFDEF1D42A6F200714A00 /* large-videos-with-audio-autoplay.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 2E1DFDEE1D42A6EB00714A00 /* large-videos-with-audio-autoplay.html */; }; … … 1222 1223 2E1B7AFF1D41A95F007558B4 /* large-video-seek-after-ending.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "large-video-seek-after-ending.html"; sourceTree = "<group>"; }; 1223 1224 2E1B7B011D41B1B3007558B4 /* large-video-hides-controls-after-seek-to-end.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "large-video-hides-controls-after-seek-to-end.html"; sourceTree = "<group>"; }; 1225 2E1B881E2040EE5300FFF6A9 /* ViewportSizingTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewportSizingTests.mm; sourceTree = "<group>"; }; 1224 1226 2E1DFDEC1D42A41C00714A00 /* large-videos-with-audio.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "large-videos-with-audio.html"; sourceTree = "<group>"; }; 1225 1227 2E1DFDEE1D42A6EB00714A00 /* large-videos-with-audio-autoplay.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "large-videos-with-audio-autoplay.html"; sourceTree = "<group>"; }; … … 2304 2306 7560917719259C59009EF06E /* MemoryCacheAddImageToCacheIOS.mm */, 2305 2307 F46849BD1EEF58E400B937FE /* UIPasteboardTests.mm */, 2308 2E1B881E2040EE5300FFF6A9 /* ViewportSizingTests.mm */, 2306 2309 514958BD1F7427AC00E87BAD /* WKWebViewAutofillTests.mm */, 2307 2310 ); … … 3667 3670 7C83E0C61D0A654E00FEBCF3 /* VideoControlsManager.mm in Sources */, 3668 3671 115EB3431EE0BA03003C2C0A /* ViewportSizeForViewportUnits.mm in Sources */, 3672 2E1B881F2040EE5300FFF6A9 /* ViewportSizingTests.mm in Sources */, 3669 3673 6356FB221EC4E0BA0044BF18 /* VisibleContentRect.mm in Sources */, 3670 3674 83779C381F82FECE007CDA8A /* VisitedLinkStore.mm in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.