Changeset 195607 in webkit
- Timestamp:
- Jan 26, 2016 12:09:27 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r195599 r195607 1 2016-01-26 Dean Jackson <dino@apple.com> 2 3 [iOS] Documents without an explicit width should not get fast tapping 4 https://bugs.webkit.org/show_bug.cgi?id=153465 5 6 Reviewed by Simon Fraser (and Wenson Hseih). 7 8 * fast/events/ios/thin-gradient.jpg: Added. 9 * fast/events/ios/viewport-no-width-value-allows-double-tap-expected.txt: Added. 10 * fast/events/ios/viewport-no-width-value-allows-double-tap.html: Added. 11 * platform/ios-simulator/TestExpectations: 12 1 13 2016-01-26 Ryan Haddad <ryanhaddad@apple.com> 2 14 -
trunk/LayoutTests/platform/ios-simulator/TestExpectations
r195599 r195607 2840 2840 webkit.org/b/152134 fast/events/ios/unscalable-viewport-clicks-on-doubletap.html [ Pass Timeout ] 2841 2841 webkit.org/b/152134 fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html [ Pass Timeout ] 2842 webkit.org/b/152134 fast/events/ios/viewport-no-width-value-allows-double-tap.html [ Pass Timeout ] 2842 2843 2843 2844 # Failing tests related to picture element -
trunk/Source/WebCore/ChangeLog
r195606 r195607 1 2016-01-26 Dean Jackson <dino@apple.com> 2 3 [iOS] Documents without an explicit width should not get fast tapping 4 https://bugs.webkit.org/show_bug.cgi?id=153465 5 <rdar://problem/23962529> 6 7 Reviewed by Simon Fraser (and Wenson Hseih). 8 9 As the title says, documents that do not set a viewport should 10 not get the fast click behaviour. There were complaints that we broke 11 double-tap to scroll in ImageDocuments where the image was narrow and long. 12 13 The fix is to just keep a flag that tells the UI process if the 14 width was explicit. However, it turns out that those ImageDocuments 15 are given an explicit device-width, which is fine for scaling but 16 really should behave as auto for fast tapping. So we also need 17 to tell the UIProcess if the viewport arguments came from an 18 ImageDocument. 19 20 Test: fast/events/ios/viewport-no-width-value-allows-double-tap.html 21 22 * dom/ViewportArguments.cpp: 23 (WebCore::findSizeValue): Add a parameter that toggles a flag 24 if the size was explicitly set. 25 (WebCore::setViewportFeature): Remember if the width was 26 explicit. 27 * dom/ViewportArguments.h: Add a widthWasExplicit flag. 28 (WebCore::ViewportArguments::operator==): 29 1 30 2016-01-25 Dave Hyatt <hyatt@apple.com> 2 31 -
trunk/Source/WebCore/dom/ViewportArguments.cpp
r195452 r195607 308 308 } 309 309 310 static float findSizeValue(const String& keyString, const String& valueString, Document* document )310 static float findSizeValue(const String& keyString, const String& valueString, Document* document, bool* valueWasExplicit = nullptr) 311 311 { 312 312 // 1) Non-negative number values are translated to px lengths. … … 315 315 // 4) Other keywords and unknown values translate to 0.0. 316 316 317 if (valueWasExplicit) 318 *valueWasExplicit = true; 319 317 320 if (equalLettersIgnoringASCIICase(valueString, "device-width")) 318 321 return ViewportArguments::ValueDeviceWidth; 322 319 323 if (equalLettersIgnoringASCIICase(valueString, "device-height")) 320 324 return ViewportArguments::ValueDeviceHeight; 321 325 322 float value = numericPrefix(keyString, valueString, document); 323 324 if (value < 0) 326 float sizeValue = numericPrefix(keyString, valueString, document); 327 328 if (sizeValue < 0) { 329 if (valueWasExplicit) 330 *valueWasExplicit = false; 325 331 return ViewportArguments::ValueAuto; 326 327 return value; 332 } 333 334 return sizeValue; 328 335 } 329 336 … … 384 391 385 392 if (keyString == "width") 386 arguments->width = findSizeValue(keyString, valueString, document );393 arguments->width = findSizeValue(keyString, valueString, document, &arguments->widthWasExplicit); 387 394 else if (keyString == "height") 388 395 arguments->height = findSizeValue(keyString, valueString, document); -
trunk/Source/WebCore/dom/ViewportArguments.h
r191243 r195607 96 96 float orientation { ValueAuto }; 97 97 float shrinkToFit { ValueAuto }; 98 bool widthWasExplicit { false }; 98 99 99 100 bool operator==(const ViewportArguments& other) const … … 112 113 && userZoom == other.userZoom 113 114 && orientation == other.orientation 114 && shrinkToFit == other.shrinkToFit; 115 && shrinkToFit == other.shrinkToFit 116 && widthWasExplicit == other.widthWasExplicit; 115 117 } 116 118 -
trunk/Source/WebKit2/ChangeLog
r195602 r195607 1 2016-01-26 Dean Jackson <dino@apple.com> 2 3 [iOS] Documents without an explicit width should not get fast tapping 4 https://bugs.webkit.org/show_bug.cgi?id=153465 5 <rdar://problem/23962529> 6 7 Reviewed by Simon Fraser (and Wenson Hseih). 8 9 As the title says, documents that do not set a viewport should 10 not get the fast click behaviour. There were complaints that we broke 11 double-tap to scroll in ImageDocuments where the image was narrow and long. 12 13 The fix is to just keep a flag that tells the UI process if the 14 width was explicit. However, it turns out that those ImageDocuments 15 are given an explicit device-width, which is fine for scaling but 16 really should behave as auto for fast tapping. So we also need 17 to tell the UIProcess if the viewport arguments came from an 18 ImageDocument. 19 20 * Shared/mac/RemoteLayerTreeTransaction.h: Add two new flags into 21 the transaction. 22 (WebKit::RemoteLayerTreeTransaction::viewportMetaTagWidthWasExplicit): 23 (WebKit::RemoteLayerTreeTransaction::setViewportMetaTagWidthWasExplicit): 24 (WebKit::RemoteLayerTreeTransaction::viewportMetaTagCameFromImageDocument): 25 (WebKit::RemoteLayerTreeTransaction::setViewportMetaTagCameFromImageDocument): 26 * Shared/mac/RemoteLayerTreeTransaction.mm: 27 (WebKit::RemoteLayerTreeTransaction::encode): 28 (WebKit::RemoteLayerTreeTransaction::decode): 29 (WebKit::RemoteLayerTreeTransaction::description): 30 31 * UIProcess/API/Cocoa/WKWebView.mm: 32 (-[WKWebView _didCommitLayerTree:]): Notice whether or not the viewport 33 width was explicit. 34 (-[WKWebView _allowsDoubleTapGestures]): Return yes if the width 35 was not explicit, or if the viewport came from an ImageDocument. 36 * WebProcess/WebPage/WebPage.cpp: 37 (WebKit::WebPage::willCommitLayerTree): 38 1 39 2016-01-26 Tim Horton <timothy_horton@apple.com> 2 40 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h
r194496 r195607 231 231 void setViewportMetaTagWidth(double width) { m_viewportMetaTagWidth = width; } 232 232 233 bool viewportMetaTagWidthWasExplicit() const { return m_viewportMetaTagWidthWasExplicit; } 234 void setViewportMetaTagWidthWasExplicit(bool widthWasExplicit) { m_viewportMetaTagWidthWasExplicit = widthWasExplicit; } 235 236 bool viewportMetaTagCameFromImageDocument() const { return m_viewportMetaTagCameFromImageDocument; } 237 void setViewportMetaTagCameFromImageDocument(bool cameFromImageDocument) { m_viewportMetaTagCameFromImageDocument = cameFromImageDocument; } 238 233 239 bool allowsUserScaling() const { return m_allowsUserScaling; } 234 240 void setAllowsUserScaling(bool allowsUserScaling) { m_allowsUserScaling = allowsUserScaling; } … … 272 278 bool m_scaleWasSetByUIProcess { false }; 273 279 bool m_allowsUserScaling { false }; 280 bool m_viewportMetaTagWidthWasExplicit { false }; 281 bool m_viewportMetaTagCameFromImageDocument { false }; 274 282 }; 275 283 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
r194496 r195607 529 529 encoder << m_allowsUserScaling; 530 530 531 encoder << m_viewportMetaTagWidthWasExplicit; 532 encoder << m_viewportMetaTagCameFromImageDocument; 533 531 534 encoder << m_callbackIDs; 532 535 } … … 619 622 620 623 if (!decoder.decode(result.m_allowsUserScaling)) 624 return false; 625 626 if (!decoder.decode(result.m_viewportMetaTagWidthWasExplicit)) 627 return false; 628 629 if (!decoder.decode(result.m_viewportMetaTagCameFromImageDocument)) 621 630 return false; 622 631 … … 820 829 ts.dumpProperty("initialScaleFactor", m_initialScaleFactor); 821 830 ts.dumpProperty("viewportMetaTagWidth", m_viewportMetaTagWidth); 831 ts.dumpProperty("viewportMetaTagWidthWasExplicit", m_viewportMetaTagWidthWasExplicit); 832 ts.dumpProperty("viewportMetaTagCameFromImageDocument", m_viewportMetaTagCameFromImageDocument); 822 833 ts.dumpProperty("renderTreeSize", m_renderTreeSize); 823 834 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r195494 r195607 202 202 CGRect _inputViewBounds; 203 203 CGFloat _viewportMetaTagWidth; 204 BOOL _viewportMetaTagWidthWasExplicit; 205 BOOL _viewportMetaTagCameFromImageDocument; 204 206 CGFloat _initialScaleFactor; 205 207 BOOL _fastClickingIsDisabled; … … 1119 1121 1120 1122 _viewportMetaTagWidth = layerTreeTransaction.viewportMetaTagWidth(); 1123 _viewportMetaTagWidthWasExplicit = layerTreeTransaction.viewportMetaTagWidthWasExplicit(); 1124 _viewportMetaTagCameFromImageDocument = layerTreeTransaction.viewportMetaTagCameFromImageDocument(); 1121 1125 _initialScaleFactor = layerTreeTransaction.initialScaleFactor(); 1122 1126 if (![_contentView _mayDisableDoubleTapGesturesDuringSingleTap]) … … 1595 1599 if (![_scrollView isZoomEnabled] || [_scrollView minimumZoomScale] >= [_scrollView maximumZoomScale]) 1596 1600 return NO; 1601 1602 // If the viewport width was not explicit, we allow double tap gestures. 1603 if (!_viewportMetaTagWidthWasExplicit || _viewportMetaTagCameFromImageDocument) 1604 return YES; 1597 1605 1598 1606 // For scalable viewports, only disable double tap gestures if the viewport width is device width. -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r195317 r195607 2983 2983 layerTransaction.setInitialScaleFactor(m_viewportConfiguration.initialScale()); 2984 2984 layerTransaction.setViewportMetaTagWidth(m_viewportConfiguration.viewportArguments().width); 2985 layerTransaction.setViewportMetaTagWidthWasExplicit(m_viewportConfiguration.viewportArguments().widthWasExplicit); 2986 layerTransaction.setViewportMetaTagCameFromImageDocument(m_viewportConfiguration.viewportArguments().type == ViewportArguments::ImageDocument); 2985 2987 layerTransaction.setAllowsUserScaling(allowsUserScaling()); 2986 2988 #endif
Note: See TracChangeset
for help on using the changeset viewer.