Closed Bug 503468 Opened 15 years ago Closed 15 years ago

canPlayType should return "", not "no"

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta1-fixed
blocking1.9.1 --- .2+
status1.9.1 --- .2-fixed

People

(Reporter: roc, Assigned: roc)

Details

(Keywords: dev-doc-complete, verified1.9.1)

Attachments

(1 file)

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.
Flags: blocking1.9.2+
Flags: blocking1.9.1.1?
Attached patch fixSplinter Review
Attachment #387822 - Flags: review?(chris.double)
Yeah, let's block on this... needs review soon though.
Flags: blocking1.9.1.1? → blocking1.9.1.1+
Whiteboard: [needs r=cdouble]
Attachment #387822 - Flags: review?(chris.double) → review+
http://hg.mozilla.org/mozilla-central/rev/831a02b18da0
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment on attachment 387822 [details] [diff] [review]
fix

Has to wait for 1.9.1.12
Attachment #387822 - Flags: approval1.9.1.2?
blocking1.9.1: --- → .2+
Flags: blocking1.9.1.1+ → blocking1.9.1.1-
Comment on attachment 387822 [details] [diff] [review]
fix

a=beltzner, please land on mozilla-1.9.1
Attachment #387822 - Flags: approval1.9.1.2? → approval1.9.1.2+
Whiteboard: [needs r=cdouble]
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
Keywords: verified1.9.1
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)
Keywords: fixed1.9.2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: