Let Selection.collapse remember a raw Position instead of a canonicalized one.

This patch fixes a long-standing editing bug that a Range object returned by
Selection.getRangeAt() may not be equivalent to the Range used to set selection
with Selection.collapse().

FrameSelection.setSelectedRange sets a Range without canonicalization:
https://src.chromium.org/viewvc/blink?revision=169100&view=revision
Hence this patch adopts it.

Following is the implementation detail.
DOMSelection.cpp:
- When selection.collapse(node, offset) is called, we create a caret Range corresponding to node and offset and pass it to FrameSelection.setSelectedRange.

FrameSelection.cpp:
- If new Selection is collapsed, use old isDirectional. This is following the current behavior.

LayoutTests:
editing/selection/no-range-canonicalization.html
- The main test added to current setRange test.

fast/css/counters/counter-before-content-not-incremented.html
- Some tests expect the collapse method to canonicalize Selection so we need to set a exact DOM position.

editing/editing.js
- Some tests expect the collapse method to canonicalize Selection at start so I canonicalize that as the old Blink collapse implementation.

editing/selection/DOMSelection-DocumentType.html
- The current HTML spec says that if Range is set DocumentType node, we should throw type exception. 

editing/selection/selection-invalid-offset.html
- We should throw exception when the method is called with a offset larger than length of a node.
- Remove a redundant case.


BUG=346613

Review URL: https://codereview.chromium.org/225303002

git-svn-id: svn://svn.chromium.org/blink/trunk@175779 bbb929c8-8fbe-4397-9dbb-9b2b20218538