W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2012

Re: [whatwg] Bandwidth media queries

From: James Graham <jgraham@opera.com>
Date: Mon, 21 May 2012 16:42:22 +0200
Message-ID: <4FBA544E.5060501@opera.com>
To: whatwg@lists.whatwg.org
On 05/21/2012 04:34 PM, Boris Zbarsky wrote:
> On 5/21/12 10:09 AM, Mounir Lamouri wrote:
>> On 05/20/2012 03:04 PM, Boris Zbarsky wrote:
>>> On 5/20/12 5:45 AM, Paul Irish wrote:
>>>> Since no one mentioned it, I just wanted to make sure this thread is
>>>> aware
>>>> of the Network Information API [1], which provides
>>>> navigator.connection.bandwidth
>>>>
>>>> It's been recently implemented (to some degree) in both Mozilla [2] and
>>>> Webkit [3].
>>>
>>> As far as I can tell, the Mozilla implementation always returns Infinity
>>> for .bandwidth.
>>
>> This is not true. There is an implementation for Firefox Android which
>> is based on the connection type.
>
> Ah, indeed. I had missed that codepath.
>
> If I'm reading the right code now, that looks like it returns a constant
> value for each connection type (e.g. if you're connected via Ethernet or
> Wifi it returns 20; if you're connected via EDGE it returns 0.2, etc).

This suggests that the API is extremely silly; although one could 
presumably claim that "an estimate" allows one to return anything, I 
don't see how returning "20" if the server is feeding you 1 byte/second 
can be helpful to anyone. If no one plans to implement this as a loose 
proxy for "type of connection" the spec shouldn't pretend to do more 
than that.

Can you point me to the discussion of usecases that led to this design?
Received on Monday, 21 May 2012 14:43:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:08 GMT