[whatwg] [editing] queryCommand(Indeterm|State|Value) for commands where they make no sense

I have a fear for start throwing exceptions at places where we didn't used
to because that'll end up stopping the script.  I guess we can start logging
some console message first but given the market share of IE and WebKit and
how they're both used in native frameworks (.net / WebKit), I'm not
convinced this is the best option from compatibility perspective.

Regardless, it appears to me that we need more usage data we before we make
a call.

- Ryosuke

On Thu, Sep 15, 2011 at 3:02 PM, Ehsan Akhgari <ehsan at mozilla.com> wrote:

> On 11-09-15 4:39 PM, Aryeh Gregor wrote:
>
>> I think the exception-throwing behavior is preferable in principle,
>> but for compat, I suspect the right behavior is to always return
>> boolean false for state and indeterm, and "" for value.  This
>> basically matches everyone but Gecko for commands where none of them
>> make sense, and matches Gecko/Opera for the value of commands where
>> only state makes sense.  Throwing doesn't match anyone except Gecko,
>> and then only in some cases.  If others agree, I'll change the spec
>> and tests accordingly.
>>
>
> With my Gecko hat off (honesly, without having investigated, I think the
> reason that Gecko throws in some of these cases are just bugs!), I hate APIs
> which return dummy values and hide the authors mistake in that way.  I think
> now's our chance to improve things here.
>
> But I do agree that web-compat is something which we need to address here.
>  However, I think that's going to be a general risk with the new spec.
>  There are things which don't have a clear-cut answer, where existing
> implementations do things differently, and nobody knows why. For those
> cases, the web-compat concern is really tricky to address. But there are
> cases where implementations are doing something which doesn't make sense at
> all in response to the author doing something which doesn't make sense at
> all.  No matter what the implementation does, the content script is doing
> something wrong.  I find the position of refusing such invalid requests very
> defendable, and I would be quite willing to change Gecko's behavior like
> that in the near future.
>
> Speaking pragmatically, I've never seen a bug report in Mozilla where
> somebody asks why does Gecko do this when I do this thing which doesn't make
> sense in the first place.  So my educated guess is that this is not going to
> break a lot of existing websites anyway.
>
> Cheers,
> Ehsan
>

Received on Friday, 16 September 2011 13:15:08 UTC