W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2014

Re: [selection] extend() behavior when there is no range needs to be clarified

From: Ryosuke Niwa <rniwa@apple.com>
Date: Fri, 06 Jun 2014 13:22:12 -0700
Cc: "public-webapps@w3.org" <public-webapps@w3.org>, Yoshifumi Inoue <yosin@chromium.org>
Message-id: <5517D005-EBAF-48BF-9E51-BACEE73DDD46@apple.com>
To: Ben Peters <Ben.Peters@microsoft.com>
It's probably a bug in WebKit/Blink. Since we're already throwing other exceptions in some cases (e.g. INDEX_SIZE_ERR), we can probably change our engine behavior.

yoshin: any opinions for blink?

On Jun 6, 2014, at 11:31 AM, Ben Peters <Ben.Peters@microsoft.com> wrote:

> I just filed this bug. Do we know of reasons why Chrome (Webkit?) doesn't throw an exception for this scenario? It seems confusing to web devs.
> 
> Ben
> 
>> -----Original Message-----
>> From: bugzilla@jessica.w3.org [mailto:bugzilla@jessica.w3.org]
>> 
>> https://www.w3.org/Bugs/Public/show_bug.cgi?id=26005
>> 
>>            Bug ID: 26005
>>           Summary: Selection.extend behavior when there is no range needs
>>                    to be clarified
>>           Product: WebAppsWG
>>           Version: unspecified
>>          Hardware: PC
>>                OS: Windows NT
>>            Status: NEW
>>          Severity: normal
>>          Priority: P2
>>         Component: Selection API
>>          Assignee: rniwa@webkit.org
>>          Reporter: benjamp@microsoft.com
>>        QA Contact: public-webapps-bugzilla@w3.org
>>                CC: benjamp@microsoft.com, public-webapps@w3.org
>> 
>> Today, the Selection API spec seems to say that if selection.rangeCount is 0,
>> then selection.extend should throw an error and abort. This is true in Firefox,
>> but not Chrome. In Chrome, it appears that a new collapsed range is created
>> at the position specified in selection.extend. Without an error, it's possible a
>> site might end up creating a selection when they think they're extending it.
>> But errors in JS should be used sparingly. Not sure which of these makes
>> more sense.
>> 
>> --
>> You are receiving this mail because:
>> You are on the CC list for the bug.
> 
Received on Friday, 6 June 2014 20:22:45 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:25 UTC