No, I can't see anything like that in UseCounter.h. Here's how I think
such a counter would have to work:
For any media resource that successfully reaches readyState
HAVE_METADATA, compare the supplied type [1] to the sniffed type.[2]
(If mimesniff is already implemented, this becomes easier.) If they
are represent different container types, assume decoding would have
failed using the supplied type and tell UseCounter about it. Under the
(unverified) assumption that the current sniffing mostly matches
mimesniff, that should tell us how much would break by changing the
behavior. (Given that the actual network bits for <video> are in
Chromium, one may have to add a callback on WebMediaPlayerClient to do
the counting in Blink.)
At this point, since both IE and Firefox do strict checking it's
rather likely to be Web compatible. However, sniffing surely must be
as well! No browser has any real incentive to change here...
Assuming that Chromium/Blink *could* adopt strict Content-Type
checking, do people think that we actually *should*? Do we want new
features on the Web platform to rely on sniffing or on Content-Type?
If there is a consensus on that question, then this old feature can
probably be made to fall in line.
On Mon, Jan 20, 2014 at 11:28 PM, Philip Jägenstedt <phi...@opera.com> wrote:
No, I can't see anything like that in UseCounter.h. Here's how I think
such a counter would have to work:
For any media resource that successfully reaches readyState
HAVE_METADATA, compare the supplied type [1] to the sniffed type.[2]
(If mimesniff is already implemented, this becomes easier.) If they
are represent different container types, assume decoding would have
failed using the supplied type and tell UseCounter about it. Under the
(unverified) assumption that the current sniffing mostly matches
mimesniff, that should tell us how much would break by changing the
behavior. (Given that the actual network bits for <video> are in
Chromium, one may have to add a callback on WebMediaPlayerClient to do
the counting in Blink.)
At this point, since both IE and Firefox do strict checking it's
rather likely to be Web compatible. However, sniffing surely must be
as well! No browser has any real incentive to change here...<video> is more popular on mobile-optimized web sites because such web sites cannot use Flash. IE and Firefox are less often used to render mobile-optimized content, which makes it harder to draw these sorts of conclusions in this case.
Assuming that Chromium/Blink *could* adopt strict Content-Type
checking, do people think that we actually *should*? Do we want new
features on the Web platform to rely on sniffing or on Content-Type?
If there is a consensus on that question, then this old feature can
probably be made to fall in line.Historically, the strongest opponent of strict Content-Type checking for <video> has been Apple. My understanding is that they have some technical limitations in this area, but I don't fully understand them.As a general rule, I'd prefer less sniffing to more sniffing, but I doubt we're going to get all browsers to converge on not sniffing. So, the question really boils down to whether you prefer theoretical purity (not sniffing) over eventually interoperability (sniffing). In my book, interoperability trumps theoretical purity, but other people might have a different view on that topic or might believe that if we joined IE and Firefox we could eventually convince Safari to join the non-sniffing camp.
On Mon, Jan 20, 2014 at 11:28 PM, Philip Jägenstedt <phi...@opera.com> wrote:
No, I can't see anything like that in UseCounter.h. Here's how I think
such a counter would have to work:
For any media resource that successfully reaches readyState
HAVE_METADATA, compare the supplied type [1] to the sniffed type.[2]
(If mimesniff is already implemented, this becomes easier.) If they
are represent different container types, assume decoding would have
failed using the supplied type and tell UseCounter about it. Under the
(unverified) assumption that the current sniffing mostly matches
mimesniff, that should tell us how much would break by changing the
behavior. (Given that the actual network bits for <video> are in
Chromium, one may have to add a callback on WebMediaPlayerClient to do
the counting in Blink.)
At this point, since both IE and Firefox do strict checking it's
rather likely to be Web compatible. However, sniffing surely must be
as well! No browser has any real incentive to change here...<video> is more popular on mobile-optimized web sites because such web sites cannot use Flash. IE and Firefox are less often used to render mobile-optimized content, which makes it harder to draw these sorts of conclusions in this case.Assuming that Chromium/Blink *could* adopt strict Content-Type
checking, do people think that we actually *should*? Do we want new
features on the Web platform to rely on sniffing or on Content-Type?
If there is a consensus on that question, then this old feature can
probably be made to fall in line.Historically, the strongest opponent of strict Content-Type checking for <video> has been Apple. My understanding is that they have some technical limitations in this area, but I don't fully understand them.
As a general rule, I'd prefer less sniffing to more sniffing, but I doubt we're going to get all browsers to converge on not sniffing. So, the question really boils down to whether you prefer theoretical purity (not sniffing) over eventually interoperability (sniffing). In my book, interoperability trumps theoretical purity, but other people might have a different view on that topic or might believe that if we joined IE and Firefox we could eventually convince Safari to join the non-sniffing camp.I suspect that the data will show that not sniffing will impact compatibility, which would make the above moot anyway.