[webvtt] HTMLTrackElement kind enum list should be case-insensitive

RESOLVED WORKSFORME

Status

()

Core
Audio/Video
RESOLVED WORKSFORME
4 years ago
4 years ago

People

(Reporter: msaad, Assigned: reyre)

Tracking

Trunk
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
The enumerated list that represents the possible values for kind should always return case case-insensitive values.
(Reporter)

Comment 1

4 years ago
Created attachment 748472 [details]
Test Case - HTMLTrackElement kind enum list
(Reporter)

Updated

4 years ago
Blocks: 833385
This should simply not be an enum.
(Assignee)

Updated

4 years ago
Blocks: 833386
No longer blocks: 833385
(Assignee)

Updated

4 years ago
Assignee: nobody → rick.eyre
(Assignee)

Comment 3

4 years ago
This test case actually works perfectly fine for me. We're also using the case insensitive version of nsAttrValue::ParseEnumValue. So we're handling this behaviour correctly as of now.

It would be useful to include this in the current suite of DOM tests so I'll make sure to do that when updating bug 833386.
There is a still a bug, though.

track.kind = "foo";
is(track.getAttribute("kind"), "foo");

should pass.
according to the draft, all of the track attributes are read only, except for "mode". this should not pass
(Assignee)

Comment 6

4 years ago
I've been wondering about that too. If you try to set though HTMLTrackElement.[prop] it won't work, which is the behaviour we want. However, using the setAttribute() like in this test case works.
interface HTMLTrackElement : HTMLElement {
           attribute TextTrackKind kind;
           attribute DOMString src;
           attribute DOMString srclang;
           attribute DOMString label;
           attribute boolean default;

  const unsigned short NONE = 0;
  const unsigned short LOADING = 1;
  const unsigned short LOADED = 2;
  const unsigned short ERROR = 3;
  readonly attribute unsigned short readyState;

  readonly attribute TextTrack track;
};
yes,i was referring to TextTrack, different interface.
(Assignee)

Comment 9

4 years ago
Marking this as resolved as it is currently properly working with case-insensitive values.

Will open a new bug for possibly changing HTMLTrackElement.kind from an enum to DOMString as per Ms2ger's requests.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.