We should fix various parts of editing code not to instantiate a Position with m_isLegacyEditingPosition set true. This will allow us to clean up other Position-related code in editing.
Under this meta bug, we need to do:
- Stop instantiating legacy editing positions
- Remove calls to deprecatedEditingOffset()
- Remove improper calls to node()
The first two accomplishes the goal of this bug to eliminate the dependency on legacy editing positions.
The third comes from the fact, obtaining the anchor node of Position doesn't make much sense for new positions. When some editing code calls node() on some position, and checks if it's a text node or not. But what if the position was before or after a text node. The anchor node still be a text node but it's not inside. In fact, they're explicitly outside of the text node.
For this reason, we need to examine every and each call to node() and replace it by containerNode(), computeNodeBeforePosition(), computeNodeAfterPosition(), and anchorNode().