Title: [148624] trunk/Source/WebKit/blackberry
Revision
148624
Author
[email protected]
Date
2013-04-17 12:14:30 -0700 (Wed, 17 Apr 2013)

Log Message

[BlackBerry] Check image node with usemap attribute isLink failed
https://bugs.webkit.org/show_bug.cgi?id=114751

Patch by Tiancheng Jiang <[email protected]> on 2013-04-17
Reviewed by Rob Buis.

PR 326780
Internally Reviewed by Liam Quinn.

An image node with usemap will crash when call isLink.
If the node is linkNode, bring up the CCM(eg. linked image).
Also use toElement method as agomes suggested in pr 113957.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::webContext):
* WebKitSupport/FatFingers.cpp:
(BlackBerry::WebKit::FatFingers::findBestPoint):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (148623 => 148624)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2013-04-17 18:58:20 UTC (rev 148623)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2013-04-17 19:14:30 UTC (rev 148624)
@@ -2161,7 +2161,8 @@
 
     bool nodeAllowSelectionOverride = false;
     Node* linkNode = node->enclosingLinkEventParentOrSelf();
-    if (node->isLink() || (node->isTextNode() && linkNode)) {
+    // Set link url only when the node is linked image, or text inside anchor. Prevent CCM popup when long press non-link element(eg. button) inside an anchor.
+    if ((node == linkNode) || (node->isTextNode() && linkNode)) {
         KURL href;
         if (linkNode->isLink() && linkNode->hasAttributes()) {
             if (const Attribute* attribute = toElement(linkNode)->getAttributeItem(HTMLNames::hrefAttr))

Modified: trunk/Source/WebKit/blackberry/ChangeLog (148623 => 148624)


--- trunk/Source/WebKit/blackberry/ChangeLog	2013-04-17 18:58:20 UTC (rev 148623)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2013-04-17 19:14:30 UTC (rev 148624)
@@ -1,3 +1,22 @@
+2013-04-17  Tiancheng Jiang  <[email protected]>
+
+        [BlackBerry] Check image node with usemap attribute isLink failed
+        https://bugs.webkit.org/show_bug.cgi?id=114751
+
+        Reviewed by Rob Buis.
+
+        PR 326780
+        Internally Reviewed by Liam Quinn.
+
+        An image node with usemap will crash when call isLink.
+        If the node is linkNode, bring up the CCM(eg. linked image).
+        Also use toElement method as agomes suggested in pr 113957.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::webContext):
+        * WebKitSupport/FatFingers.cpp:
+        (BlackBerry::WebKit::FatFingers::findBestPoint):
+
 2013-04-16  Nima Ghanavatian  <[email protected]>
 
         Redo spellchecking of a field if the layout has changed

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/FatFingers.cpp (148623 => 148624)


--- trunk/Source/WebKit/blackberry/WebKitSupport/FatFingers.cpp	2013-04-17 18:58:20 UTC (rev 148623)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/FatFingers.cpp	2013-04-17 19:14:30 UTC (rev 148624)
@@ -170,7 +170,7 @@
     while (node && !node->isElementNode())
         node = node->parentNode();
 
-    Element* elementUnderPoint = static_cast<Element*>(node);
+    Element* elementUnderPoint = toElement(node);
 
     if (elementUnderPoint) {
         result.m_nodeUnderFatFinger = elementUnderPoint;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to