Last Comment Bug 503468 - canPlayType should return "", not "no"
: canPlayType should return "", not "no"
Status: RESOLVED FIXED
: dev-doc-complete, verified1.9.1
Product: Core
Classification: Components
Component: Audio/Video (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Robert O'Callahan (:roc) (Exited; email my personal email if necessary)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-09 21:48 PDT by Robert O'Callahan (:roc) (Exited; email my personal email if necessary)
Modified: 2009-09-02 10:48 PDT (History)
6 users (show)
roc: blocking1.9.2+
mbeltzner: blocking1.9.1.1-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
beta1-fixed
.2+
.2-fixed


Attachments
fix (8.24 KB, patch)
2009-07-09 22:05 PDT, Robert O'Callahan (:roc) (Exited; email my personal email if necessary)
cajbir.bugzilla: review+
mbeltzner: approval1.9.1.2+
Details | Diff | Review

Description Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2009-07-09 21:48:32 PDT
Hixie just made this change. We should make it ASAP and ram it into 1.9.1, since sites will have to be adjusted for it.

The reason for this change is that it's completely natural to write "if (v.canPlayType(...))" or "if (!v.canPlayType(...))". And thanks to JS string->bool conversion, this happily always passes (or always fails) for all possible return values. This issue was brought up on the whatwg list ages ago, but Hixie forgot to change the spec.

By returning "" instead of "no", simple uses of canPlayType will treat "no" as false and basically do what the author expects.
Comment 1 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2009-07-09 22:05:19 PDT
Created attachment 387822 [details] [diff] [review]
fix
Comment 2 Samuel Sidler (old account; do not CC) 2009-07-13 15:58:01 PDT
Yeah, let's block on this... needs review soon though.
Comment 3 Peter Van der Beken [:peterv] 2009-07-14 11:11:53 PDT
http://hg.mozilla.org/mozilla-central/rev/831a02b18da0
Comment 4 Mike Beltzner [:beltzner, not reading bugmail] 2009-07-14 12:28:35 PDT
Comment on attachment 387822 [details] [diff] [review]
fix

Has to wait for 1.9.1.12
Comment 5 Mike Beltzner [:beltzner, not reading bugmail] 2009-07-21 17:57:04 PDT
Comment on attachment 387822 [details] [diff] [review]
fix

a=beltzner, please land on mozilla-1.9.1
Comment 6 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2009-07-21 18:17:59 PDT
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/6180a70604f1
Comment 7 Tony Chung [:tchung] 2009-07-30 18:06:31 PDT
Verified on Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2.  Patch has testcases
Comment 8 Mike Beltzner [:beltzner, not reading bugmail] 2009-08-25 10:39:33 PDT
Mass change: adding fixed1.9.2 keyword

(This bug was identified as a mozilla1.9.2 blocker which was fixed before the mozilla-1.9.2 repository was branched (August 13th, 2009) as per this query: http://is.gd/2ydcb - if this bug is not actually fixed on mozilla1.9.2, please remove the keyword. Apologies for the bugspam)

Note You need to log in before you can comment on or make changes to this bug.