Bug 29247 - document.caretRangeFromPoint() should check whether the point is within frameview's boundary before taking scroll offset into consideration
Summary: document.caretRangeFromPoint() should check whether the point is within frame...
Status: RESOLVED DUPLICATE of bug 29245
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-14 11:08 PDT by Xiaomei Ji
Modified: 2009-09-14 14:53 PDT (History)
4 users (show)

See Also:


Attachments
caretRangeFromPointWithScroll.html (1.50 KB, text/html)
2009-09-14 11:08 PDT, Xiaomei Ji
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xiaomei Ji 2009-09-14 11:08:08 PDT
Created attachment 39555 [details]
caretRangeFromPointWithScroll.html

document.caretRangeFromPoint() might return a null range which should not. 
Please see attached file caretRangeFromPointWithScroll.html for detailed
explanation.

The problem probably is at:
    IntPoint point = roundedIntPoint(FloatPoint(x * zoomFactor, y * zoomFactor)) + view()->scrollOffset();

    if (!frameView->boundsRect().contains(point))
        return 0;

Which should be:

    IntPoint point = roundedIntPoint(FloatPoint(x * zoomFactor, y * zoomFactor));

    if (!frameView->boundsRect().contains(point))
        return 0;

    point += view()->scrollOffset();
    // Then, hit test.
Comment 1 Sam Weinig 2009-09-14 14:28:06 PDT
Is this a dup of bug 29245?
Comment 2 Xiaomei Ji 2009-09-14 14:53:54 PDT

*** This bug has been marked as a duplicate of bug 29245 ***