Reviewed by Justin Garcia.

        Clean up DOMSelection to use some helper functions
        making the code smaller, and less error-prone.
        https://bugs.webkit.org/show_bug.cgi?id=19221

        I tried moving DOMSelection off of rangeCompliantEquivalent
        but failed.  VisibleSelection holds positions like (table, 1) to mean
        "after the table".

        * page/DOMSelection.cpp:
        (WebCore::DOMSelection::visibleSelection):
        (WebCore::anchorPosition):
        (WebCore::focusPosition):
        (WebCore::basePosition):
        (WebCore::extentPosition):
        (WebCore::DOMSelection::anchorNode):
        (WebCore::DOMSelection::anchorOffset):
        (WebCore::DOMSelection::focusNode):
        (WebCore::DOMSelection::focusOffset):
        (WebCore::DOMSelection::baseNode):
        (WebCore::DOMSelection::baseOffset):
        (WebCore::DOMSelection::extentNode):
        (WebCore::DOMSelection::extentOffset):
        * page/DOMSelection.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@41657 268f45cc-cd09-0410-ab3c-d52691b4dbfc
5 files changed