Implement Range-based selection expansion.
This patch simplifies Selection.addRange()'s implementation by expanding the selection based on DOM Ranges instead of VisiblePositions. There is a slight behavior change caused by this shift of data structures we use: ranges which are discrete in the DOM tree but visually adjacent will be rejected after this patch is landed. However, I don't think this will be a huge problem, since (1) API behavior relying on visual positions can be tricky to users because they are Blink-internal only information; and (2) users wishing to connect the regions can (and probably should) specify a range which overlaps with the current selection. BUG=346613 Review URL: https://codereview.chromium.org/205903003 git-svn-id: svn://svn.chromium.org/blink/trunk@170640 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
This diff is collapsed.
Please register or sign in to comment