Changeset 148244 in webkit


Ignore:
Timestamp:
Apr 11, 2013 4:25:50 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

TextTrackList's .onremovetrack is missing from IDL
https://bugs.webkit.org/show_bug.cgi?id=103421

Patch by Brendan Long <b.long@cablelabs.com> on 2013-04-11
Reviewed by Eric Carlson.

Source/WebCore:

Fixed test media/track/opera/interfaces/TextTrackList/onremovetrack.html

  • html/track/TextTrackList.cpp:

(TextTrackList::remove):
(TextTrackList::scheduleRemoveTrackEvent):

  • html/track/TextTrackList.h:

(TextTrackList):

  • html/track/TextTrackList.idl:

LayoutTests:

  • media/track/opera/interfaces/TextTrackList/onremovetrack-expected.txt: Added.
Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r148236 r148244  
     12013-04-11  Brendan Long  <b.long@cablelabs.com>
     2
     3        TextTrackList's .onremovetrack is missing from IDL
     4        https://bugs.webkit.org/show_bug.cgi?id=103421
     5
     6        Reviewed by Eric Carlson.
     7
     8        * media/track/opera/interfaces/TextTrackList/onremovetrack-expected.txt: Added.
     9
    1102013-04-11  Sukolsak Sakshuwong  <sukolsak@gmail.com>
    211
  • trunk/Source/WebCore/ChangeLog

    r148242 r148244  
     12013-04-11  Brendan Long  <b.long@cablelabs.com>
     2
     3        TextTrackList's .onremovetrack is missing from IDL
     4        https://bugs.webkit.org/show_bug.cgi?id=103421
     5
     6        Reviewed by Eric Carlson.
     7
     8        Fixed test media/track/opera/interfaces/TextTrackList/onremovetrack.html
     9
     10        * html/track/TextTrackList.cpp:
     11        (TextTrackList::remove):
     12        (TextTrackList::scheduleRemoveTrackEvent):
     13        * html/track/TextTrackList.h:
     14        (TextTrackList):
     15        * html/track/TextTrackList.idl:
     16
    1172013-04-11  Alberto Garcia  <agarcia@igalia.com>
    218
  • trunk/Source/WebCore/html/track/TextTrackList.cpp

    r148050 r148244  
    209209    track->setMediaElement(0);
    210210
     211    RefPtr<TextTrack> trackRef = (*tracks)[index];
    211212    tracks->remove(index);
     213    scheduleRemoveTrackEvent(trackRef.release());
    212214}
    213215
     
    253255}
    254256
     257void TextTrackList::scheduleRemoveTrackEvent(PassRefPtr<TextTrack> track)
     258{
     259    // 4.8.10.12.3 Sourcing out-of-band text tracks
     260    // When a track element's parent element changes and the old parent was a
     261    // media element, then the user agent must remove the track element's
     262    // corresponding text track from the media element's list of text tracks,
     263    // and then queue a task to fire a trusted event with the name removetrack,
     264    // that does not bubble and is not cancelable, and that uses the TrackEvent
     265    // interface, with the track attribute initialized to the text track's
     266    // TextTrack object, at the media element's textTracks attribute's
     267    // TextTrackList object.
     268
     269    RefPtr<TrackBase> trackRef = track;
     270    TrackEventInit initializer;
     271    initializer.track = trackRef;
     272    initializer.bubbles = false;
     273    initializer.cancelable = false;
     274
     275    m_pendingEvents.append(TrackEvent::create(eventNames().removetrackEvent, initializer));
     276    if (!m_pendingEventTimer.isActive())
     277        m_pendingEventTimer.startOneShot(0);
     278}
     279
    255280void TextTrackList::asyncEventTimerFired(Timer<TextTrackList>*)
    256281{
  • trunk/Source/WebCore/html/track/TextTrackList.h

    r146380 r148244  
    6767
    6868    DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack);
     69    DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack);
    6970
    7071    void clearOwner() { m_owner = 0; }
     
    8384
    8485    void scheduleAddTrackEvent(PassRefPtr<TextTrack>);
     86    void scheduleRemoveTrackEvent(PassRefPtr<TextTrack>);
    8587    void asyncEventTimerFired(Timer<TextTrackList>*);
    8688
  • trunk/Source/WebCore/html/track/TextTrackList.idl

    r131172 r148244  
    3737
    3838    attribute EventListener onaddtrack;
     39    attribute EventListener onremovetrack;
    3940
    4041    void addEventListener(in DOMString type,
Note: See TracChangeset for help on using the changeset viewer.