w3c / selection-api

Selection API
http://w3c.github.io/selection-api/
Other
47 stars 30 forks source link

setBaseAndExtent should clear selection when baseNode or extentNode is null #72

Open rniwa opened 8 years ago

rniwa commented 8 years ago

When setBaseAndExtent is called with baseNode or extentNode set to null, we should clear selection instead of throwing. This behavior matches that of WebKit and Blink.

yoichio commented 8 years ago

I found setBaseAndExtent(a,1, null, 0) behaves as collapse(a,1) in Blink. However Edge clear selection at that case.

Which is better?

rniwa commented 8 years ago

Given setBaseAndExtent came from WebKit API, we should probably spec whatever WebKit/Blink does/did.

yosinch commented 6 years ago

According to chrome usage tracking[1], setBaseAndExtent() with null-node is very low usage (0.00013% of page views).

[1] https://www.chromestatus.com/metrics/feature/timeline/popularity/1084