Bug 56437 - startOfDocument(Node*) and endOfDocument(Node*) return a null VisiblePosition if the document is non-editable and contains only an editable pocket
Summary: startOfDocument(Node*) and endOfDocument(Node*) return a null VisiblePosition...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-03-15 18:14 PDT by Justin Garcia
Modified: 2014-09-04 15:40 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Garcia 2011-03-15 18:14:35 PDT
startOfDocument(Node*) and endOfDocument(Node*) return a null VisiblePosition if the document is non-editable and contains only an editable pocket. I don't think I can construct a test case for this.

VisiblePosition endOfDocument(const Node* node)
{
    if (!node || !node->document() || !node->document()->documentElement())
        return VisiblePosition();
    
    Element* doc = node->document()->documentElement();
    return VisiblePosition(lastPositionInNode(doc), DOWNSTREAM);
}

<rdar://problem/9139718>
Comment 1 Enrica Casucci 2014-09-04 15:40:13 PDT
This has been fixed as part of revision 173287.