Changeset 168479 in webkit


Ignore:
Timestamp:
May 8, 2014 12:03:38 PM (10 years ago)
Author:
Brent Fulgham
Message:

Cue display events may not be registered during page load.
https://bugs.webkit.org/show_bug.cgi?id=132696
<rdar://problem/16652874>

Reviewed by Eric Carlson.

  • Modules/mediacontrols/mediaControlsApple.js:

(Controller.prototype.handleTextTrackAdd): Don't register
for 'cuechange' events anymore.
(Controller.prototype.handleTextTrackRemove): Ditto.
(Controller.prototype.updateCaptionContainer): Reduce CSS
churn by not adding/removing 'Hidden' class every time a
new cue is processed. Only do this when transitioning
track display state.
(Controller.prototype.handleTextTrackCueChange): Deleted.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::updateTextTrackDisplay): Call
'updateTextTrackContainer' directory when processing cues,
rather than trampolining through the JS layer.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r168478 r168479  
     12014-05-08  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Cue display events may not be registered during page load.
     4        https://bugs.webkit.org/show_bug.cgi?id=132696
     5        <rdar://problem/16652874>
     6
     7        Reviewed by Eric Carlson.
     8
     9        * Modules/mediacontrols/mediaControlsApple.js:
     10        (Controller.prototype.handleTextTrackAdd): Don't register
     11        for 'cuechange' events anymore.
     12        (Controller.prototype.handleTextTrackRemove): Ditto.
     13        (Controller.prototype.updateCaptionContainer): Reduce CSS
     14        churn by not adding/removing 'Hidden' class every time a
     15        new cue is processed. Only do this when transitioning
     16        track display state.
     17        (Controller.prototype.handleTextTrackCueChange): Deleted.
     18        * html/HTMLMediaElement.cpp:
     19        (WebCore::HTMLMediaElement::updateTextTrackDisplay): Call
     20        'updateTextTrackContainer' directory when processing cues,
     21        rather than trampolining through the JS layer.
     22
    1232014-05-08  Alexey Proskuryakov  <ap@apple.com>
    224
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js

    r168215 r168479  
    572572    {
    573573        var track = event.track;
    574         this.listenFor(track, 'cuechange', this.handleTextTrackCueChange);
    575574
    576575        if (this.trackHasThumbnails(track) && track.mode === 'disabled')
     
    584583    handleTextTrackRemove: function(event)
    585584    {
    586         var track = event.track;
    587         this.stopListeningFor(track, 'cuechange', this.handleTextTrackCueChange);
    588585        this.updateThumbnail();
    589586        this.updateCaptionButton();
    590         this.updateCaptionContainer();
    591     },
    592 
    593     handleTextTrackCueChange: function(event)
    594     {
    595587        this.updateCaptionContainer();
    596588    },
     
    10501042            return;
    10511043
    1052         if (this.video.webkitHasClosedCaptions)
     1044        var hasClosedCaptions = this.video.webkitHasClosedCaptions;
     1045        var hasHiddenClass = this.host.textTrackContainer.classList.contains(this.ClassNames.hidden);
     1046
     1047        if (hasClosedCaptions && hasHiddenClass)
    10531048            this.host.textTrackContainer.classList.remove(this.ClassNames.hidden);
    1054         else
     1049        else if (!hasClosedCaptions && !hasHiddenClass)
    10551050            this.host.textTrackContainer.classList.add(this.ClassNames.hidden);
    10561051
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r168245 r168479  
    49404940#if ENABLE(MEDIA_CONTROLS_SCRIPT)
    49414941    ensureUserAgentShadowRoot();
     4942    ASSERT(m_mediaControlsHost);
     4943    m_mediaControlsHost->updateTextTrackContainer();
    49424944    return;
    49434945#endif
Note: See TracChangeset for help on using the changeset viewer.