Title: [173450] trunk/Source/WebKit2
Revision
173450
Author
[email protected]
Date
2014-09-09 16:16:55 -0700 (Tue, 09 Sep 2014)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (173449 => 173450)


--- trunk/Source/WebKit2/ChangeLog	2014-09-09 23:12:05 UTC (rev 173449)
+++ trunk/Source/WebKit2/ChangeLog	2014-09-09 23:16:55 UTC (rev 173450)
@@ -1,3 +1,26 @@
+2014-09-09  Enrica Casucci  <[email protected]>
+
+        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  <[email protected]>
 
         Disable the "unreachable-code" warning

Modified: trunk/Source/WebKit2/Shared/InteractionInformationAtPosition.cpp (173449 => 173450)


--- trunk/Source/WebKit2/Shared/InteractionInformationAtPosition.cpp	2014-09-09 23:12:05 UTC (rev 173449)
+++ trunk/Source/WebKit2/Shared/InteractionInformationAtPosition.cpp	2014-09-09 23:16:55 UTC (rev 173450)
@@ -38,6 +38,7 @@
     encoder << nodeAtPositionIsAssistedNode;
     encoder << isSelectable;
     encoder << isNearMarkedText;
+    encoder << touchCalloutEnabled;
     encoder << clickableElementName;
     encoder << url;
     encoder << title;
@@ -63,6 +64,9 @@
     if (!decoder.decode(result.isNearMarkedText))
         return false;
 
+    if (!decoder.decode(result.touchCalloutEnabled))
+        return false;
+    
     if (!decoder.decode(result.clickableElementName))
         return false;
 

Modified: trunk/Source/WebKit2/Shared/InteractionInformationAtPosition.h (173449 => 173450)


--- trunk/Source/WebKit2/Shared/InteractionInformationAtPosition.h	2014-09-09 23:12:05 UTC (rev 173449)
+++ trunk/Source/WebKit2/Shared/InteractionInformationAtPosition.h	2014-09-09 23:16:55 UTC (rev 173450)
@@ -43,6 +43,7 @@
         : nodeAtPositionIsAssistedNode(false)
         , isSelectable(false)
         , isNearMarkedText(false)
+        , touchCalloutEnabled(true)
     {
     }
 
@@ -50,6 +51,7 @@
     bool nodeAtPositionIsAssistedNode;
     bool isSelectable;
     bool isNearMarkedText;
+    bool touchCalloutEnabled;
     String clickableElementName;
     String url;
     String title;

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (173449 => 173450)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2014-09-09 23:12:05 UTC (rev 173449)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2014-09-09 23:16:55 UTC (rev 173450)
@@ -782,6 +782,9 @@
 
 - (SEL)_actionForLongPress
 {
+    if (!_positionInformation.touchCalloutEnabled)
+        return nil;
+
     if (_positionInformation.clickableElementName == "IMG")
         return @selector(_showImageSheet);
     else if (_positionInformation.clickableElementName == "A") {

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (173449 => 173450)


--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-09-09 23:12:05 UTC (rev 173449)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-09-09 23:16:55 UTC (rev 173450)
@@ -1905,8 +1905,10 @@
             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();
+            }
         }
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to