[BlackBerry] Browser crashed when selecting in textarea

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

The function FatFingers::checkForText() uses host node's whole text
to checkFingerIntersection(). We should not give the text of shadow
nodes to it.

Patch by Sean Wang <Xuewen.Wang@torchmobile.com.cn> on 2012-05-30
Reviewed by Antonio Gomes.

* WebKitSupport/FatFingers.cpp:
(BlackBerry::WebKit::FatFingers::getNodesFromRect): Avoid returning
shadow nodes when the context is Text node.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 083e7945
2012-05-30 Sean Wang <Xuewen.Wang@torchmobile.com.cn>
[BlackBerry] Browser crashed when selecting in textarea
https://bugs.webkit.org/show_bug.cgi?id=87484
The function FatFingers::checkForText() uses host node's whole text
to checkFingerIntersection(). We should not give the text of shadow
nodes to it.
Reviewed by Antonio Gomes.
* WebKitSupport/FatFingers.cpp:
(BlackBerry::WebKit::FatFingers::getNodesFromRect): Avoid returning
shadow nodes when the context is Text node.
2012-05-30 Zoltan Horvath <zoltan@webkit.org>
[Qt] Set WebCore imagedecoders as default and add fallback to QImageDecoder
......
......@@ -492,7 +492,10 @@ void FatFingers::getNodesFromRect(Document* document, const IntPoint& contentPos
getPaddings(topPadding, rightPadding, bottomPadding, leftPadding);
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping);
HitTestResult result(contentPos, topPadding, rightPadding, bottomPadding, leftPadding, HitTestShadowDOM);
// The user functions checkForText() and findIntersectingRegions() uses the Node.wholeText() to checkFingerIntersection()
// not the text in its shadow tree.
ShadowContentFilterPolicy allowShadow = m_targetType == Text ? DoNotAllowShadowContent : AllowShadowContent;
HitTestResult result(contentPos, topPadding, rightPadding, bottomPadding, leftPadding, allowShadow);
document->renderView()->layer()->hitTest(request, result);
intersectedNodes = result.rectBasedTestResult();
......
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