Commit 7c77445c authored by mifenton@rim.com's avatar mifenton@rim.com
Browse files

[BlackBerry] DOMSupport isPositionInNode should have early returns for null nodes

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

Reviewed by Rob Buis.

Add early returns in isPositionInNode when either
node or the position node is null.

* WebKitSupport/DOMSupport.cpp:
(BlackBerry::WebKit::DOMSupport::isPositionInNode):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@111726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6a0f02ab
2012-03-22 Mike Fenton <mifenton@rim.com>
[BlackBerry] DOMSupport isPositionInNode should have early returns for null nodes
https://bugs.webkit.org/show_bug.cgi?id=81929
Reviewed by Rob Buis.
Add early returns in isPositionInNode when either
node or the position node is null.
* WebKitSupport/DOMSupport.cpp:
(BlackBerry::WebKit::DOMSupport::isPositionInNode):
2012-03-21 Jonathan Dong <jonathan.dong@torchmobile.com.cn>
[BlackBerry] Credential save and autofill implemetation
......
......@@ -293,8 +293,14 @@ Node* DOMContainerNodeForPosition(const Position& position)
bool isPositionInNode(Node* node, const Position& position)
{
if (!node)
return false;
int offset = 0;
Node* domNodeAtPos = DOMContainerNodeForPosition(position);
if (!domNodeAtPos)
return false;
if (domNodeAtPos == position.containerNode())
offset = position.computeOffsetInContainerNode();
......
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