-
Notifications
You must be signed in to change notification settings - Fork 28
Description
https://w3c.github.io/selection-api/#dom-selection-modify says:
undefined modify(optional DOMString alter, optional DOMString direction, optional DOMString granularity);
However it also says:
If alter is not ASCII case-insensitive match with "extend" or "move", abort these steps.
If direction is not ASCII case-insensitive match with "forward", "backward", "left", or "right", abort these steps.
If granularity is not ASCII case-insensitive match with "character", "word", "sentence", "line", "paragraph", "lineboundary", "sentenceboundary", "paragraphboundary", "documentboundary", abort these steps.
So, basically, it early returns without errors if any of the arguments don't match. That doesn't make a lot of sense to me.
That seems to match WebKit and Blink's implementation. Gecko however throws a reasonable error and makes the strings mandatory.
I think the Gecko behavior is preferable, but if we're going with the "silent error" behavior of WebKit / Blink, maybe we should clarify it as a compatibility quirk (since it's really odd).