Bug 124785 - Add TextTrackList::getTrackById().
Summary: Add TextTrackList::getTrackById().
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brendan Long
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-22 11:36 PST by Brendan Long
Modified: 2013-11-22 13:41 PST (History)
8 users (show)

See Also:


Attachments
Patch (6.69 KB, patch)
2013-11-22 12:37 PST, Brendan Long
no flags Details | Formatted Diff | Diff
Fix nits (6.69 KB, patch)
2013-11-22 13:04 PST, Brendan Long
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brendan Long 2013-11-22 11:36:53 PST
> The getTrackById(id) method must return the first TextTrack in the TextTrackList object whose id IDL attribute would return a value equal to the value of the id argument. When no tracks match the given argument, the method must return null.

http://www.w3.org/TR/html5/embedded-content-0.html#dom-texttracklist-gettrackbyid

> The AudioTrackList.getTrackById(id) and VideoTrackList.getTrackById(id) methods must return the first AudioTrack or VideoTrack object (respectively) in the AudioTrackList or VideoTrackList object (respectively) whose identifier is equal to the value of the id argument (in the natural order of the list, as defined above). When no tracks match the given argument, the methods must return null.

The getTrackById(id) method must return the first TextTrack in the TextTrackList object whose id IDL attribute would return a value equal to the value of the id argument. When no tracks match the given argument, the method must return null.
Comment 1 Brendan Long 2013-11-22 11:38:52 PST
It looks like AudioTrackList and VideoTrackList already have it. I think this was added to the spec after those interfaces were created.
Comment 2 Brendan Long 2013-11-22 12:37:38 PST
Created attachment 217708 [details]
Patch
Comment 3 Eric Carlson 2013-11-22 12:50:56 PST
Comment on attachment 217708 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=217708&action=review

> Source/WebCore/html/track/TextTrackList.cpp:143
> +    return 0;

Nit: nullptr

> Source/WebCore/html/track/TextTrackList.h:51
> +    TextTrack* getTrackById(const AtomicString& id);

Nit: "id" is unnecessary.
Comment 4 Brendan Long 2013-11-22 13:04:26 PST
Created attachment 217711 [details]
Fix nits
Comment 5 WebKit Commit Bot 2013-11-22 13:41:55 PST
Comment on attachment 217711 [details]
Fix nits

Clearing flags on attachment: 217711

Committed r159711: <http://trac.webkit.org/changeset/159711>
Comment 6 WebKit Commit Bot 2013-11-22 13:41:57 PST
All reviewed patches have been landed.  Closing bug.