REGRESSION (WebKit2): -webkit-touch-callout: none has no effect.
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Sep 2014 23:16:55 +0000 (23:16 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Sep 2014 23:16:55 +0000 (23:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136685
rdar://problem/17629840

Reviewed by Benjamin Poulain.

We need to check if the touch callout is enabled for the element before starting
the long press gesture.
The information about the touch callout is returned together with the rest of data
returned by the InteractionInformationAtPosition.

* Shared/InteractionInformationAtPosition.cpp:
(WebKit::InteractionInformationAtPosition::encode):
(WebKit::InteractionInformationAtPosition::decode):
* Shared/InteractionInformationAtPosition.h:
(WebKit::InteractionInformationAtPosition::InteractionInformationAtPosition):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _actionForLongPress]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173450 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/InteractionInformationAtPosition.cpp
Source/WebKit2/Shared/InteractionInformationAtPosition.h
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

index 4d90631..6cb4fe3 100644 (file)
@@ -1,3 +1,26 @@
+2014-09-09  Enrica Casucci  <enrica@apple.com>
+
+        REGRESSION (WebKit2): -webkit-touch-callout: none has no effect.
+        https://bugs.webkit.org/show_bug.cgi?id=136685
+        rdar://problem/17629840
+
+        Reviewed by Benjamin Poulain.
+
+        We need to check if the touch callout is enabled for the element before starting
+        the long press gesture.
+        The information about the touch callout is returned together with the rest of data
+        returned by the InteractionInformationAtPosition.
+
+        * Shared/InteractionInformationAtPosition.cpp:
+        (WebKit::InteractionInformationAtPosition::encode):
+        (WebKit::InteractionInformationAtPosition::decode):
+        * Shared/InteractionInformationAtPosition.h:
+        (WebKit::InteractionInformationAtPosition::InteractionInformationAtPosition):
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _actionForLongPress]):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getPositionInformation):
+
 2014-09-09  Benjamin Poulain  <bpoulain@apple.com>
 
         Disable the "unreachable-code" warning
index 997a45b..301091f 100644 (file)
@@ -38,6 +38,7 @@ void InteractionInformationAtPosition::encode(IPC::ArgumentEncoder& encoder) con
     encoder << nodeAtPositionIsAssistedNode;
     encoder << isSelectable;
     encoder << isNearMarkedText;
+    encoder << touchCalloutEnabled;
     encoder << clickableElementName;
     encoder << url;
     encoder << title;
@@ -63,6 +64,9 @@ bool InteractionInformationAtPosition::decode(IPC::ArgumentDecoder& decoder, Int
     if (!decoder.decode(result.isNearMarkedText))
         return false;
 
+    if (!decoder.decode(result.touchCalloutEnabled))
+        return false;
+    
     if (!decoder.decode(result.clickableElementName))
         return false;
 
index 8b804c4..8901135 100644 (file)
@@ -43,6 +43,7 @@ struct InteractionInformationAtPosition {
         : nodeAtPositionIsAssistedNode(false)
         , isSelectable(false)
         , isNearMarkedText(false)
+        , touchCalloutEnabled(true)
     {
     }
 
@@ -50,6 +51,7 @@ struct InteractionInformationAtPosition {
     bool nodeAtPositionIsAssistedNode;
     bool isSelectable;
     bool isNearMarkedText;
+    bool touchCalloutEnabled;
     String clickableElementName;
     String url;
     String title;
index e569510..6b0f3dd 100644 (file)
@@ -782,6 +782,9 @@ static inline bool isSamePair(UIGestureRecognizer *a, UIGestureRecognizer *b, UI
 
 - (SEL)_actionForLongPress
 {
+    if (!_positionInformation.touchCalloutEnabled)
+        return nil;
+
     if (_positionInformation.clickableElementName == "IMG")
         return @selector(_showImageSheet);
     else if (_positionInformation.clickableElementName == "A") {
index 163821d..f363c01 100644 (file)
@@ -1905,8 +1905,10 @@ void WebPage::getPositionInformation(const IntPoint& point, InteractionInformati
             info.title = element->fastGetAttribute(HTMLNames::titleAttr).string();
             if (linkElement && info.title.isEmpty())
                 info.title = element->innerText();
-            if (element->renderer())
+            if (element->renderer()) {
                 info.bounds = element->renderer()->absoluteBoundingBoxRect(true);
+                info.touchCalloutEnabled = element->renderer()->style().touchCalloutEnabled();
+            }
         }
     }