Bug 1082486 Part 3 - Refactor UpdatePosition(). r=roc

GetTouchCaretPosition() is needed in a later patch.
Bug 1082486 Part 4 - Check touch caret position is in or near scroll frame. r=roc

This patch check whether touch caret is in or is near scroll frame. If
yes, its position will be clamp to scroll frame as before. Otherwise, we
hide it since the nsCaret will not be seen in this case.