Re: [whatwg/dom] Range#expand() (#431)

I would like to oppose standardize `Range#expand()`. I prefer to get rid of Range#expand() from browsers.
Reason of my objection of standardize Range#expand() are:

1. DOM base `Range#expand()` isn't useful since I'm not sure about use case and DOM base can't handle collapsed whitespaces,, or it can be done by `Intl.Segmenter`+`Range.toString()`
2. Visible character base `Range#expand()`, Blink and WebKit do so, is hard to spec'd, e.g. `Element#innerText`. I think *visible character* in DOM spec is layering violation.
3. Implementation of `Range#expand()` and `Selection#modify()` should be different == it is hard to share code, e.g. `Range#expand()` may not support `line` and `page` unit. Result of `word` unit on `Selection#modify()` are different among platforms, e.g. Windows includes trailing whitespace but others don't.

I think it is better to provide "visible character iterator" as API, in editing spec, and using `Intl.Segmenter` is better than providing high-level API `Range#expand()`.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/431#issuecomment-292088638

Received on Thursday, 6 April 2017 07:12:03 UTC