[BlackBerry] Check image node with usemap attribute isLink failed

https://bugs.webkit.org/show_bug.cgi?id=114751

Patch by Tiancheng Jiang <tijiang@rim.com> 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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5683c9f9
......@@ -2161,7 +2161,8 @@ Platform::WebContext WebPagePrivate::webContext(TargetDetectionStrategy strategy
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))
......
2013-04-17 Tiancheng Jiang <tijiang@rim.com>
[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 <nghanavatian@blackberry.com>
Redo spellchecking of a field if the layout has changed
......
......@@ -170,7 +170,7 @@ const FatFingersResult FatFingers::findBestPoint()
while (node && !node->isElementNode())
node = node->parentNode();
Element* elementUnderPoint = static_cast<Element*>(node);
Element* elementUnderPoint = toElement(node);
if (elementUnderPoint) {
result.m_nodeUnderFatFinger = elementUnderPoint;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment