1. 27 Mar, 2013 1 commit
  2. 25 Mar, 2013 1 commit
    • vcarbune@chromium.org's avatar
      TextTrack Extension for WebVTT Regions · 04ace3f9
      vcarbune@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=109820
      
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      Implemented the TextTrackRegionList and extended TextTrack with
      methods required for proper interaction with TextTrackRegion objects.
      
      Test: media/track/regions-webvtt/text-track-region-list.html
      
      * WebCore.gypi: Added files for proper building of TextTrackRegionList.
      * html/track/TextTrack.cpp:
      (WebCore::TextTrack::TextTrack):
      (WebCore):
      (WebCore::TextTrack::ensureTextTrackRegionList): Method for creating a
      TextTrackRegionList associated with the current track, if it does exist
      already.
      (WebCore::TextTrack::regions): Getter for the regions object.
      (WebCore::TextTrack::addRegion): Method for adding a region.
      (WebCore::TextTrack::removeRegion): Method for removing a region.
      * html/track/TextTrack.h:
      (WebCore):
      (TextTrack):
      * html/track/TextTrack.idl: Added methods specific for region handling.
      * html/track/TextTrackRegion.cpp:
      (WebCore::TextTrackRegion::TextTrackRegion): Initialized the track member variable.
      (WebCore::TextTrackRegion::setTrack): Added internal setter for the track attribute.
      (WebCore):
      (WebCore::TextTrackRegion::updateParametersFromRegion): Method to copy the parameters
      from a different region object.
      * html/track/TextTrackRegion.h: Added track member variable and copy method.
      (WebCore::TextTrackRegion::track): Getter retrieves now the member variable.
      (TextTrackRegion):
      * html/track/TextTrackRegionList.cpp: Implemented methods required by the IDL.
      (WebCore):
      (WebCore::TextTrackRegionList::TextTrackRegionList):
      (WebCore::TextTrackRegionList::length):
      (WebCore::TextTrackRegionList::item):
      (WebCore::TextTrackRegionList::getRegionById):
      (WebCore::TextTrackRegionList::add):
      (WebCore::TextTrackRegionList::remove):
      (WebCore::TextTrackRegionList::clear):
      * html/track/TextTrackRegionList.h:
      (WebCore):
      (TextTrackRegionList):
      (WebCore::TextTrackRegionList::create):
      (WebCore::TextTrackRegionList::~TextTrackRegionList):
      * html/track/TextTrackRegionList.idl: IDL defined by the specification.
      
      LayoutTests:
      
      * media/track/regions-webvtt/text-track-region-list-expected.txt: Added.
      * media/track/regions-webvtt/text-track-region-list.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      04ace3f9
  3. 20 Mar, 2013 1 commit
    • eric.carlson@apple.com's avatar
      Allow ports specific text track menu · 62bb7dc9
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=112800
      
      Reviewed by Dean Jackson.
      
      Source/WebCore: 
      
      No new tests, existing tests updated for changes.
      
      * English.lproj/Localizable.strings: Add localizable strings for text track names.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::HTMLMediaElement): userPrefersCaptions -> shouldShowCaptions.
      (WebCore::HTMLMediaElement::setSelectedTextTrack): toggleTrackAtIndex -> setSelectedTextTrack.
      (WebCore::HTMLMediaElement::userPrefersCaptions): userPrefersCaptions -> shouldShowCaptions.
      (WebCore::HTMLMediaElement::userIsInterestedInThisTrackKind): Get preferences from CaptionUserPreferences
          instead of from Settings.
      (WebCore::HTMLMediaElement::setSelectedTextTrack): Renamed from toggleTrackAtIndex. Now takes
          a TextTrack* instead of an int.
      (WebCore::HTMLMediaElement::captionPreferencesChanged): Don't force a recalculation unless 
          captions are enabled/disabled to avoid unnecessary thrash.
      * html/HTMLMediaElement.h:
      
      * html/shadow/MediaControlElements.cpp:
      (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler): Use the menu to track
          map instead of just the track index.
      (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Build and configure the
          menu from the menu to track map.
      (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu): Start with a list
          of tracks already sorted according to platform specific rules. Build a menu to track map
          so tracks are retained while the menu is visible.
      * html/shadow/MediaControlElements.h:
      
      * html/shadow/MediaControls.cpp:
      (WebCore::MediaControls::textTrackPreferencesChanged): Call closedCaptionTracksChanged so the
          track menu will be rebuilt before it is shown again.
      
      * html/track/InbandTextTrack.cpp:
      (WebCore::InbandTextTrack::containsOnlyForcedSubtitles): New, passthrough to the private track.
      (WebCore::InbandTextTrack::isMainProgramContent): Ditto.
      (WebCore::InbandTextTrack::isEasyToRead): Ditto.
      * html/track/InbandTextTrack.h:
      * html/track/TextTrack.h:
      
      * html/track/TextTrackList.cpp:
      (WebCore::TextTrackList::contains): New.
      * html/track/TextTrackList.h:
      
      * page/CaptionUserPreferences.cpp:
      (WebCore::CaptionUserPreferences::CaptionUserPreferences): Pull in from .h ditto.
      (WebCore::CaptionUserPreferences::~CaptionUserPreferences): Ditto.
      (WebCore::CaptionUserPreferences::shouldShowCaptions): Renamed from userPrefersCaptions. 
      (WebCore::CaptionUserPreferences::setShouldShowCaptions): New.
      (WebCore::CaptionUserPreferences::userPrefersCaptions): Ditto.
      (WebCore::CaptionUserPreferences::setUserPrefersCaptions): Ditto.
      (WebCore::CaptionUserPreferences::userPrefersSubtitles): Ditto.
      (WebCore::CaptionUserPreferences::setUserPrefersSubtitles): Ditto.
      (WebCore::CaptionUserPreferences::userPrefersTextDescriptions): Ditto.
      (WebCore::CaptionUserPreferences::setUserPrefersTextDescriptions): Ditto.
      (WebCore::CaptionUserPreferences::displayNameForTrack): Ditto.
      (WebCore::CaptionUserPreferences::sortedTrackListForMenu): Ditto.
      * page/CaptionUserPreferences.h:
      
      * page/CaptionUserPreferencesMac.h:
      * page/CaptionUserPreferencesMac.mm:
      (WebCore::CaptionUserPreferencesMac::shouldShowCaptions): Renamed from userPrefersCaptions. 
      (WebCore::CaptionUserPreferencesMac::userPrefersCaptions): New.
      (WebCore::CaptionUserPreferences::userPrefersSubtitles): Ditto.
      (WebCore::trackDisplayName): Update logic used to build track title.
      (WebCore::CaptionUserPreferencesMac::displayNameForTrack): Call trackDisplayName.
      (WebCore::textTrackCompare): Text track title sort comparison function.
      (WebCore::CaptionUserPreferencesMac::sortedTrackListForMenu): New. Sort the list of tracks
          according to title, language, and user preferences.
      
      * platform/Language.cpp:
      (WebCore::displayNameForLanguageLocale): Don't leak the CFLocale.
              
      * platform/LocalizedStrings.cpp:
      (WebCore::textTrackCountryAndLanguageMenuItemText): New.
      (WebCore::textTrackLanguageMenuItemText): Ditto.
      (WebCore::closedCaptionTrackMenuItemText): Ditto.
      (WebCore::sdhTrackMenuItemText): Ditto.
      (WebCore::easyReaderTrackMenuItemText): Ditto.
      * platform/LocalizedStrings.h:
      
      * platform/graphics/InbandTextTrackPrivate.h:
      * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h:
      * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
      (WebCore::InbandTextTrackPrivateAVFObjC::containsOnlyForcedSubtitles): New, return AVFoundation property.
      (WebCore::InbandTextTrackPrivateAVFObjC::isMainProgramContent): Ditto.
      (WebCore::InbandTextTrackPrivateAVFObjC::isEasyToRead): Ditto.
      
      * testing/InternalSettings.cpp:
      (WebCore::InternalSettings::setShouldDisplayTrackKind): Set setting via CaptionUserPreferences
          instead of from Settings.
      (WebCore::InternalSettings::shouldDisplayTrackKind): Get setting from CaptionUserPreferences
          instead of from Settings.
      
      Source/WebKit: 
      
      * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Add new exports.
      * win/WebKit.vcproj/WebKitExports.def.in: Ditto.
      
      LayoutTests: 
      
      * media/track/track-user-preferences-expected.txt:
      * media/track/track-user-preferences.html:
      * media/video-controls-captions-trackmenu-localized.html:
      * media/video-controls-captions-trackmenu-sorted.html:
      * media/video-controls-captions-trackmenu.html:
      * platform/mac/media/video-controls-captions-trackmenu-expected.txt:
      * platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt:
      * platform/mac/media/video-controls-captions-trackmenu-sorted-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      62bb7dc9
  4. 18 Mar, 2013 1 commit
    • vcarbune@chromium.org's avatar
      Determine text direction for rendering a TextTrackCue · 770dc028
      vcarbune@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=79749
      
      Reviewed by Levi Weintraub.
      
      Source/WebCore:
      
      The rendering rules for WebVTT cues are slightly different
      depending on the directionality determined from the characters
      of the cue text. This patch implements the preliminary step
      to be able to take directionality into account.
      
      It iterates through the cue characters and setting the CSS
      directionality to the one of the first strong directional character.
      
      Test: media/track/track-cue-rendering-rtl.html
      
      * html/track/TextTrackCue.cpp:
      (WebCore::TextTrackCueBox::applyCSSProperties): Applies the determined
      direction.
      (WebCore::TextTrackCue::TextTrackCue): Sets the default value for the
      display direction.
      (WebCore::isCueParagraphSeparator): Tests for explicit unicode characters
      that are paragraph separators.
      (WebCore):
      (WebCore::TextTrackCue::determineTextDirection): Determined the direction
      by the first strong directional character found.
      (WebCore::TextTrackCue::calculateDisplayParameters): Updated.
      (WebCore::TextTrackCue::getCSSWritingDirection): Return the determined CSS
      writing direction.
      * html/track/TextTrackCue.h:
      (TextTrackCue):
      
      LayoutTests:
      
      * media/track/captions-webvtt/captions-rtl.vtt: Added.
      * media/track/track-cue-rendering-rtl-expected.txt: Added.
      * media/track/track-cue-rendering-rtl.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      770dc028
  5. 14 Mar, 2013 1 commit
    • commit-queue@webkit.org's avatar
      [GStreamer] Stopping playback of html5 media when receiving a higher priority... · 83d72db6
      commit-queue@webkit.org authored
      [GStreamer] Stopping playback of html5 media when receiving a higher priority audio event needs implementation
      https://bugs.webkit.org/show_bug.cgi?id=91611
      
      Source/WebCore:
      
      React to REQUEST_STATE GStreamer message to stop the pipeline when
      a higher priority stream is played. When this happens, states are
      updated accordingly.
      
      A method was added in the MediaPlayer class and internals to allow
      the the test runner to simulate an audio interruption.
      
      Patch by Xabier Rodriguez Calvar <calvaris@igalia.com> on 2013-03-14
      Reviewed by Philippe Normand.
      
      Test: media/media-higher-prio-audio-stream.html
      
      * platform/graphics/MediaPlayer.h:
      * platform/graphics/MediaPlayer.cpp:
      (WebCore):
      (MediaPlayer):
      (WebCore::MediaPlayer::simulateAudioInterruption): New method
      delegating an audio interruption to the private backend to
      simulate the use-case where an external application needs
      exclusive access to the audio device.
      * platform/graphics/MediaPlayerPrivate.h:
      (MediaPlayerPrivateInterface):
      (WebCore::MediaPlayerPrivateInterface::simulateAudioInterruption):
      Added default empty method in the common private header.
      * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
      (WebCore):
      (WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
      (WebCore::setAudioStreamPropertiesCallback): Hooked to child-added
      signal on the audio sink, delegates on setAudioStreamProperties.
      (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
      Sets the audio stream properties.
      (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
      Initializes the new attribute.
      (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
      Disconnects autoaudiosink signal.
      (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
      Changed logging.
      (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Reacting to
      the REQUEST_STATE message.
      (WebCore::MediaPlayerPrivateGStreamer::simulateAudioInterruption):
      Added. Injects the REQUEST_STATE message to the pipeline.
      (WebCore::MediaPlayerPrivateGStreamer::updateStates): Updating the
      playback state if REQUEST_STATE.
      * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
      (MediaPlayerPrivateGStreamer): Added new method and attribute.
      * testing/Internals.h:
      * testing/Internals.idl:
      * testing/Internals.cpp:
      (WebCore):
      (WebCore::Internals::simulateAudioInterruption): Added to call the
      method to stop the element because of a higher prio stream at the
      tests.
      
      LayoutTests:
      
      Created test, expected result and updated other ports
      expectations.
      
      Patch by Xabier Rodriguez Calvar <calvaris@igalia.com> on 2013-03-14
      Reviewed by Philippe Normand.
      
      * media/media-higher-prio-audio-stream-expected.txt: Added.
      * media/media-higher-prio-audio-stream.html: Added.
      * platform/chromium/TestExpectations: Skipped the new test.
      * platform/mac/TestExpectations: Skipped the new test.
      * platform/qt/TestExpectations: Skipped the new test for Mac and
      Win.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      83d72db6
  6. 13 Mar, 2013 1 commit
    • commit-queue@webkit.org's avatar
      Add the default video poster if it doesn't exist in video tag · 25fd37ef
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=110263
      
      Patch by Tao Bai <michaelbai@chromium.org> on 2013-03-13
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      Tests: media/video-default-poster.html
             media/video-no-default-poster.html
      
      The Android web view application could provide the default poster
      for a video that doesn't have the poster attribute.
      
      To provide the default poster, the application must set defaultVideoPosterURL
      setting and return the image in the response of that URL.
      
      The way to do this would be:
      
      A) Replace the Element::imageSourceAttributeName function with an
         Element::imageSourceURL function that returns the imageSourceURL as a
         const AtomicString&. The body will be the same as before, it will just also
         include a call to getAttribute. Also will need to revise the four classes
         that override that function.
      
      B) Add a new HTMLVideoElement::posterImageURL function that implements the
         default poster URL logic.
      
      C) Update the four functions that get the poster attribute to handle poster
         loading and display to call posterImageURL.
      
         1) HTMLVideoElement::imageSourceURL.
         2) HTMLVideoElement::setDisplayMode.
         3) HTMLVideoElement::updateDisplayState.
         4) HTMLMediaElement::getPluginProxyParams. Will need to cast to
            HTMLVideoElement after checking isVideo.
      
      * dom/Element.cpp:
      (WebCore::Element::imageSourceURL): Replace imageSourceAttributeName() with imageSourceURL()
      * dom/Element.h: Replace imageSourceAttributeName() with imageSourceURL()
      * html/HTMLEmbedElement.cpp:
      (WebCore::HTMLEmbedElement::imageSourceURL): Replace imageSourceAttributeName() with imageSourceURL()
      * html/HTMLEmbedElement.h: Replace imageSourceAttributeName() with imageSourceURL()
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::getPluginProxyParams): Change to use posterImageURL
      * html/HTMLObjectElement.cpp:
      (WebCore::HTMLObjectElement::imageSourceURL): Replace imageSourceAttributeName() with imageSourceURL()
      * html/HTMLObjectElement.h: Replace imageSourceAttributeName with imageSourceURL
      * html/HTMLVideoElement.cpp:
      (WebCore::HTMLVideoElement::HTMLVideoElement): set m_defaultPosterURL if there is such settings
      (WebCore::HTMLVideoElement::imageSourceURL): Replace imageSourceAttributeName() with imageSourceURL()
      (WebCore::HTMLVideoElement::setDisplayMode): Use imageSourceURL()
      (WebCore::HTMLVideoElement::updateDisplayState): Use imageSourceURL()
      (WebCore::HTMLVideoElement::posterImageURL): Return image source's KURL
      * html/HTMLVideoElement.h: Replace imageSourceAttributeName() with imageSourceURL() and add m_defaultPosterURL
      * loader/ImageLoader.cpp:
      (WebCore::ImageLoader::updateFromElement): Use imageSourceURL()
      * page/Settings.in: Add defaultVideoPosterURL setting.
      * platform/chromium/PasteboardChromium.cpp:
      (WebCore::Pasteboard::writeImage): use imageSourceURL()
      * platform/gtk/PasteboardGtk.cpp:
      (WebCore::getURLForImageNode): use imageSourceURL()
      * rendering/HitTestResult.cpp:
      (WebCore::HitTestResult::absoluteImageURL): use imageSourceURL()
      * svg/SVGImageElement.cpp:
      (WebCore::SVGImageElement::imageSourceURL): Replace imageSourceAttributeName() with imageSourceURL()
      * svg/SVGImageElement.h: Replace imageSourceAttributeName() with imageSourceURL()
      * testing/InternalSettings.cpp:
      (WebCore::InternalSettings::Backup::Backup): support backup defaultVideoPosterURL.
      (WebCore::InternalSettings::Backup::restoreTo): support restore defaultVideoPosterURL.
      (WebCore::InternalSettings::setDefaultVideoPosterURL): set defaultVideoPosterURL.
      * testing/InternalSettings.h:
      (Backup): support backup defaultVideoPosterURL.
      (InternalSettings): Add setDefaultVidoePosterURL method.
      * testing/InternalSettings.idl: Add setDefaultVideoPosterURL for test purpose.
      * testing/Internals.cpp:
      (WebCore::Internals::getImageSourceURL): Add getImageSourceURL method.
      * testing/Internals.h: Add getImageSourceURL method.
      * testing/Internals.idl: Add getImageSourceURL method.
      
      LayoutTests:
      
      The Android web view application could provide the default poster
      for a video that doesn't have the poster attribute.
      
      To provide the default poster, the application must set defaultVideoPosterURL
      setting and return the image in the response of that URL.
      
      The way to do this would be:
      
      A) Replace the Element::imageSourceAttributeName function with an
         Element::imageSourceURL function that returns the imageSourceURL as a
         const AtomicString&. The body will be the same as before, it will just also
         include a call to getAttribute. Also will need to revise the four classes
         that override that function.
      
      B) Add a new HTMLVideoElement::posterImageURL function that implements the
         default poster URL logic.
      
      C) Update the four functions that get the poster attribute to handle poster
         loading and display to call posterImageURL.
      
         1) HTMLVideoElement::imageSourceURL.
         2) HTMLVideoElement::setDisplayMode.
         3) HTMLVideoElement::updateDisplayState.
         4) HTMLMediaElement::getPluginProxyParams. Will need to cast to
            HTMLVideoElement after checking isVideo.
      
      * media/video-default-poster-expected.txt: Added.
      * media/video-default-poster.html: Added.
      * media/video-no-default-poster-expected.txt: Added.
      * media/video-no-default-poster.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      25fd37ef
  7. 11 Mar, 2013 2 commits
    • commit-queue@webkit.org's avatar
      Hit testing should use ancestorInThisScope to get the non-shadow ancestor · b692a869
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=112068
      
      Patch by Christian Biesinger <cbiesinger@chromium.org> on 2013-03-11
      Reviewed by Dimitri Glazkov.
      
      Source/WebCore:
      
      Tests: media/nodesFromRect-shadowContent.html
      
      * rendering/HitTestResult.cpp:
      (WebCore::HitTestResult::setToNonShadowAncestor):
      (WebCore::HitTestResult::addNodeToRectBasedTestResult):
      Use ancestorInThisScope which is not deprecated and which produces
      correct results for nested shadow trees (e.g. in case of <video>,
      which contains <input> elements for the controls, which themselves
      have shadow trees)
      
      LayoutTests:
      
      * media/nodesFromRect-shadowContent.html: Extend the hit testing rect
      to guarantee reaching a nested shadow tree.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b692a869
    • dgorbik@apple.com's avatar
      Not all properties apply to the '::cue' pseudo-element · ba1240dc
      dgorbik@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=110705
      
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      Background properties are not inherited and they were not applied to right elements.
      Now we apply all ::cue properties to WebVTT cue background box, which -webkit-media-text-track-all-nodes
      container was corresponding to. Now it has 'cue' pseudoId instead of '-webkit-media-text-track-all-nodes'.
      Property filtering is turned off for user agent rules so that we are still able to apply filtered rules
      to this container internally. m_cueContainer is removed because it is no longer needed.
      m_allDocumentNodes container was renamed to m_cueBackgroundBox.
      
      Existing tests modified to cover this case.
      
      * css/RuleSet.h:
      (WebCore::RuleData::propertyWhitelistType): disable filtering for UA rules.
      * css/StyleResolver.cpp:
      (WebCore::StyleResolver::sortAndTransferMatchedRules): pass the UA scope to propertyWhitelistType().
      * css/mediaControls.css: rename -webkit-media-text-track-all-nodes to 'cue'
      (video::cue):
      * html/shadow/MediaControlElements.cpp:
      (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
      * html/shadow/MediaControlElements.h:
      (MediaControlTextTrackContainerElement):
      * html/shadow/MediaControls.cpp:
      (WebCore::MediaControls::createTextTrackDisplay):
      * html/shadow/MediaControlsChromium.cpp:
      (WebCore::MediaControlsChromium::createTextTrackDisplay):
      * html/shadow/MediaControlsGtk.cpp:
      (WebCore::MediaControlsGtk::createTextTrackDisplay):
      * html/track/TextTrackCue.cpp:
      (WebCore::TextTrackCue::TextTrackCue):
      (WebCore::TextTrackCue::updateDisplayTree):
      (WebCore::TextTrackCue::getDisplayTree):
      * html/track/TextTrackCue.h:
      (WebCore::TextTrackCue::element):
      * page/CaptionUserPreferencesMac.mm:
      (WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride):
      
      LayoutTests:
      
      * media/media-controls.js:
      (textTrackDisplayElement):
      * media/track/track-css-all-cues-expected.txt:
      * media/track/track-css-all-cues.html:
      * media/track/track-css-cue-lifetime.html:
      * media/track/track-css-matching-default.html:
      * media/track/track-css-matching-lang.html:
      * media/track/track-css-matching-timestamps.html:
      * media/track/track-css-matching.html:
      * media/track/track-css-property-whitelist.html:
      * media/track/track-in-band-style.html:
      * platform/mac/media/track/track-cue-rendering-horizontal-expected.txt:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ba1240dc
  8. 07 Mar, 2013 1 commit
    • vcarbune@chromium.org's avatar
      TextTrackRegion Constructor · e8ebf24e
      vcarbune@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=110511
      
      Reviewed by Adam Barth.
      
      Source/WebCore:
      
      This is an initial patch for implementing the TextTrackRegion
      defined in the "WebVTT Extension: Regions for rendering cue groups":
      https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/region.html
      
      The feature components are hidden behind the WEBVTT_REGIONS flag
      and is currently disabled by default in all ports and tests skipped.
      
      Test: media/track/regions-webvtt/text-track-region-constructor.html
      
      * WebCore.gypi: Added files to be included for building Chromium with
      feature enabled (it is disabled by default).
      * html/track/TextTrackRegion.cpp: Added.
      (WebCore):
      (WebCore::TextTrackRegion::TextTrackRegion):
      (WebCore::TextTrackRegion::~TextTrackRegion):
      (WebCore::TextTrackRegion::setId): Setter.
      (WebCore::TextTrackRegion::setWidth): Setter.
      (WebCore::TextTrackRegion::setHeight): Setter.
      (WebCore::TextTrackRegion::setRegionAnchorX): Setter.
      (WebCore::TextTrackRegion::setRegionAnchorY): Setter.
      (WebCore::TextTrackRegion::setViewportAnchorX): Setter.
      (WebCore::TextTrackRegion::setViewportAnchorY): Setter.
      (WebCore::TextTrackRegion::scroll): Getter. Internally, the scroll
      value is stored as a boolean, but when returned is converted to either
      the empty string or "up".
      (WebCore::TextTrackRegion::setScroll): Setter.
      (WebCore::TextTrackRegion::setRegionSettings): Not used yet (see b/109818)
      * html/track/TextTrackRegion.h: Added.
      (WebCore):
      (TextTrackRegion):
      (WebCore::TextTrackRegion::create):
      (WebCore::TextTrackRegion::track): Getter.
      (WebCore::TextTrackRegion::id): Getter.
      (WebCore::TextTrackRegion::width): Getter.
      (WebCore::TextTrackRegion::height): Getter.
      (WebCore::TextTrackRegion::regionAnchorX): Getter.
      (WebCore::TextTrackRegion::regionAnchorY): Getter.
      (WebCore::TextTrackRegion::viewportAnchorX): Getter.
      (WebCore::TextTrackRegion::viewportAnchorY): Getter.
      (WebCore::TextTrackRegion::regionSettings): Getter, used only internally (see b/109818).
      * html/track/TextTrackRegion.idl: Added.
      * page/DOMWindow.idl: Constructor support.
      
      LayoutTests:
      
      * TestExpectations:
      * media/track/regions-webvtt/text-track-region-constructor-expected.txt: Added.
      * media/track/regions-webvtt/text-track-region-constructor.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145053 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e8ebf24e
  9. 05 Mar, 2013 1 commit
  10. 01 Mar, 2013 3 commits
    • vcarbune@chromium.org's avatar
      Support padding, margin and border for internal UA cue styling · 54fe3b83
      vcarbune@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=110703
      
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      For some particular user agent styling this allows the possibility
      of making the window around the cue text bigger to match some user
      styles (see CaptionUserPreferencesMac::captionsStyleSheetOverride).
      
      These properties *cannot* be set through by using the ::cue
      pseudo-element and, as specified, are used only internally.
      
      Note: This patch is identical to the previously commited one,
      as it was rolled back without related tests failing.
      
      Test: media/track/track-cue-rendering-with-padding.html
      
      * css/mediaControls.css:
      (video::-webkit-media-text-track-display): Set the CSS box model
      to include in the specified width or height the values of
      padding / margin / border by using -webkit-box-sizing and avoid
      overflow over 100% width because of having these properties set.
      * rendering/RenderTextTrackCue.cpp:
      (WebCore::RenderTextTrackCue::isOutside): To not interfere with
      the regular WebVTT positioning algorithm, the check is done for
      the absolute content box.
      (WebCore::RenderTextTrackCue::repositionCueSnapToLinesSet): Added
      an extra adjustment step to accomodate vertical padding (and not
      overflow the cue container)
      
      LayoutTests:
      
      * media/track/track-cue-rendering-with-padding-expected.txt: Added.
      * media/track/track-cue-rendering-with-padding.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144508 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      54fe3b83
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r144443. · d095818e
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/144443
      https://bugs.webkit.org/show_bug.cgi?id=111169
      
      Caused 2 tests to crash by segv on Chromium Mac10.6 (Requested
      by toyoshim on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-03-01
      
      Source/WebCore:
      
      * css/mediaControls.css:
      (video::-webkit-media-text-track-display):
      * rendering/RenderTextTrackCue.cpp:
      (WebCore::RenderTextTrackCue::isOutside):
      (WebCore::RenderTextTrackCue::repositionCueSnapToLinesSet):
      
      LayoutTests:
      
      * media/track/track-cue-rendering-with-padding-expected.txt: Removed.
      * media/track/track-cue-rendering-with-padding.html: Removed.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d095818e
    • vcarbune@chromium.org's avatar
      Support padding, margin and border for internal UA cue styling · 70abc140
      vcarbune@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=110703
      
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      For some particular user agent styling this allows the possibility
      of making the window around the cue text bigger to match some user
      styles (see CaptionUserPreferencesMac::captionsStyleSheetOverride).
      
      These properties *cannot* be set through by using the ::cue
      pseudo-element and, as specified, are used only internally.
      
      Test: media/track/track-cue-rendering-with-padding.html
      
      * css/mediaControls.css:
      (video::-webkit-media-text-track-display): Set the CSS box model
      to include in the specified width or height the values of
      padding / margin / border by using -webkit-box-sizing and avoid
      overflow over 100% width because of having these properties set.
      * rendering/RenderTextTrackCue.cpp:
      (WebCore::RenderTextTrackCue::isOutside): To not interfere with
      the regular WebVTT positioning algorithm, the check is done for
      the absolute content box.
      (WebCore::RenderTextTrackCue::repositionCueSnapToLinesSet): Added
      an extra adjustment step to accomodate vertical padding (and not
      overflow the cue container)
      
      LayoutTests:
      
      * media/track/track-cue-rendering-with-padding-expected.txt: Added.
      * media/track/track-cue-rendering-with-padding.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      70abc140
  11. 14 Feb, 2013 3 commits
    • commit-queue@webkit.org's avatar
      Convert media controls from DeprecatedFlexibleBox to FlexibleBox · 3f379e81
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=109775
      
      Patch by Christian Biesinger <cbiesinger@chromium.org> on 2013-02-14
      Reviewed by Ojan Vafai.
      
      Source/WebCore:
      
      Covered by existing tests in media/.
      
      * css/mediaControls.css:
      * css/mediaControlsBlackBerry.css:
      * css/mediaControlsChromium.css:
      * css/mediaControlsChromiumAndroid.css:
      * css/mediaControlsEfl.css:
      * css/mediaControlsGtk.css:
      * css/mediaControlsQt.css:
      * css/mediaControlsQuickTime.css:
      Automated search and replace of old flexbox CSS rules to new ones.
      Minor tuning of the chromium rules.
      
      * rendering/RenderMediaControlElements.cpp:
      (WebCore::RenderMediaControlTimeDisplay::RenderMediaControlTimeDisplay):
      (WebCore::RenderMediaControlTimeDisplay::layout):
      * rendering/RenderMediaControlElements.h:
      Make media controls inherit from RenderFlexibleBox
      
      LayoutTests:
      
      Rebaselined lots of tests. There were two kinds of changes:
      - Replaced the RenderDeprecatedFlexibleBox class name with
      RenderFlexibleBox, and minor printing differences
      - Slight positioning/size changes due to a different algorithm for
      shrinking elements (old flexbox shrinks elements evenly, new flexbox
      shrinks in proportion to the size of the flex item)
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142947 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3f379e81
    • dino@apple.com's avatar
      Clicking outside captions menu should dismiss it · f1286ca3
      dino@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=109648
      
      Unreviewed. Adding the files I forgot to commit in r142774.
      
      * media/video-controls-captions-trackmenu-hide-on-click.html: Added.
      * platform/mac/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f1286ca3
    • jer.noble@apple.com's avatar
      EME: replace MediaKeySession.addKey() -> update() · cdfdba8b
      jer.noble@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=109461
      
      Source/WebCore:
      
      Reviewed by Eric Carlson.
      
      No new tests; updated media/encrypted-media/encrypted-media-v2-syntax.html test.
      
      In the latest draft of the Encrypted Media Spec, the addKeys() method has been replaced
      with update().
      
      * Modules/encryptedmedia/CDM.h:
      * Modules/encryptedmedia/MediaKeySession.cpp:
      (WebCore::MediaKeySession::update):
      (WebCore::MediaKeySession::addKeyTimerFired):
      * Modules/encryptedmedia/MediaKeySession.h:
      * Modules/encryptedmedia/MediaKeySession.idl:
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::webkitAddKey):
      * testing/MockCDM.cpp:
      (WebCore::MockCDMSession::update):
      
      LayoutTests:
      
      Rebaseline after API change.
      
      Reviewed by Eric Carlson.
      
      * media/encrypted-media/encrypted-media-v2-syntax-expected.txt:
      * media/encrypted-media/encrypted-media-v2-syntax.html:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142918 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cdfdba8b
  12. 13 Feb, 2013 1 commit
    • eric.carlson@apple.com's avatar
      [Mac] Caption menu should have only one item selected · 70109507
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=109730
      
      Reviewed by Dean Jackson.
      
      Source/WebCore: 
      
      No new tests, media/track/track-user-preferences.html was modified to test the changes.
      
      * CMakeLists.txt: Add CaptionUserPreferences.cpp.
      * GNUmakefile.list.am: Ditto.
      * Target.pri: Ditto.
      * WebCore.gypi: Ditto.
      * WebCore.vcproj/WebCore.vcproj: Ditto.
      * WebCore.vcxproj/WebCore.vcxproj: Ditto.
      * WebCore.xcodeproj/project.pbxproj: Ditto.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_processingPreferenceChange.
      (WebCore::HTMLMediaElement::configureTextTrackGroup): Only end up with one selected track when
          called because of a preferences change.
      (WebCore::HTMLMediaElement::captionPreferencesChanged): Call setClosedCaptionsVisible instead
          of calling markCaptionAndSubtitleTracksAsUnconfigured directly.
      (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): Process all tracks, 
          not just track elements.
      * html/HTMLMediaElement.h:
      
      * page/CaptionUserPreferences.cpp: Added so the functionality can be tested in DRT.
      (WebCore::CaptionUserPreferences::registerForPreferencesChangedCallbacks):
      (WebCore::CaptionUserPreferences::unregisterForPreferencesChangedCallbacks):
      (WebCore::CaptionUserPreferences::setUserPrefersCaptions):
      (WebCore::CaptionUserPreferences::captionPreferencesChanged):
      (WebCore::CaptionUserPreferences::preferredLanguages):
      (WebCore::CaptionUserPreferences::setPreferredLanguage):
      (WebCore::CaptionUserPreferences::displayNameForTrack):
      * page/CaptionUserPreferences.h:
      
      * page/CaptionUserPreferencesMac.h:
      * page/CaptionUserPreferencesMac.mm:
      (WebCore::CaptionUserPreferencesMac::registerForPreferencesChangedCallbacks): Moved some logic
          to base class.
      (WebCore::CaptionUserPreferencesMac::captionPreferencesChanged): Ditto.
      
      LayoutTests: 
      
      * media/track/track-user-preferences-expected.txt:
      * media/track/track-user-preferences.html: Update test to check for reactions to preferences.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142809 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      70109507
  13. 11 Feb, 2013 1 commit
    • eric.carlson@apple.com's avatar
      [Mac] Track language selection should be sticky · b54d1c88
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=109466
      
      Reviewed by Dean Jackson.
      
      .: 
      
      * Source/autotools/symbols.filter: Export PageGroup::captionPreferences and Page::initGroup.
      
      Source/WebCore: 
      
      Choosing a text track from the caption menu should make that track's language the
      preferred caption language. Turning captions off from the menu should disable captions
      in videos loaded subsequently.
      
      OS X has system support for these settings, so changes made by DRT should not change the
      settings on the user's system. Add support for all other ports in DRT only.
      
      Test: media/track/track-user-preferences.html
      
      * WebCore.exp.in: Export PageGroup::captionPreferences().
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::HTMLMediaElement): Use page()->group().captionPreferences().
      (WebCore::HTMLMediaElement::attach): Ditto.
      (WebCore::HTMLMediaElement::detach): Ditto.
      (WebCore::HTMLMediaElement::userPrefersCaptions): Ditto.
      (WebCore::HTMLMediaElement::configureTextTrackGroup): Ditto. Update for 
          preferredLanguageFromList change.
      (WebCore::HTMLMediaElement::toggleTrackAtIndex): Set user prefs for captions visible and
          caption language as appropriate.
      
      * html/shadow/MediaControlElements.cpp:
      (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler): Remove unneeded comment.
      (WebCore::MediaControlTextTrackContainerElement::updateSizes):  Use page()->group().captionPreferences().
      
      * html/shadow/MediaControlsApple.cpp:
      (WebCore::MediaControlsApple::closedCaptionTracksChanged): Update caption menu button visibility.
      
      * page/CaptionUserPreferences.h:
      (WebCore::CaptionUserPreferences::userPrefersCaptions): Support "testing" mode.
      (WebCore::CaptionUserPreferences::setUserPrefersCaptions): Ditto.
      (WebCore::CaptionUserPreferences::registerForPreferencesChangedCallbacks): Ditto.
      (WebCore::CaptionUserPreferences::unregisterForPreferencesChangedCallbacks): Ditto.
      (WebCore::CaptionUserPreferences::setPreferredLanguage): Ditto.
      (WebCore::CaptionUserPreferences::preferredLanguages): Ditto.
      (WebCore::CaptionUserPreferences::testingMode): Ditto.
      (WebCore::CaptionUserPreferences::setTestingMode): Ditto.
      (WebCore::CaptionUserPreferences::CaptionUserPreferences): Ditto.
      
      * page/CaptionUserPreferencesMac.h:
      * page/CaptionUserPreferencesMac.mm:
      (WebCore::CaptionUserPreferencesMac::userPrefersCaptions): Support "testing" mode.
      (WebCore::CaptionUserPreferencesMac::setUserPrefersCaptions): Ditto.
      (WebCore::CaptionUserPreferencesMac::userHasCaptionPreferences): Ditto.
      (WebCore::CaptionUserPreferencesMac::registerForPreferencesChangedCallbacks): Change name from
          registerForCaptionPreferencesChangedCallbacks. Support "testing" mode.
      (WebCore::CaptionUserPreferencesMac::unregisterForPreferencesChangedCallbacks):  Change name from
          unregisterForCaptionPreferencesChangedCallbacks. Support "testing" mode.
      (WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride): Support "testing" mode.
      (WebCore::CaptionUserPreferencesMac::captionFontSizeScale): Ditto.
      (WebCore::CaptionUserPreferencesMac::setPreferredLanguage): Ditto.
      (WebCore::CaptionUserPreferencesMac::preferredLanguages): Ditto. Return the platform override when set.
      
      * page/PageGroup.cpp:
      (WebCore::PageGroup::registerForCaptionPreferencesChangedCallbacks): Remove because it is already
          available from the caption preference object.
      (WebCore::PageGroup::unregisterForCaptionPreferencesChangedCallbacks): Ditto.
      (WebCore::PageGroup::userPrefersCaptions): Ditto.
      (WebCore::PageGroup::userHasCaptionPreferences): Ditto.
      (WebCore::PageGroup::captionFontSizeScale): Ditto.
      * page/PageGroup.h:
      
      * platform/Language.cpp:
      (WebCore::preferredLanguageFromList): Take the list of preferred languages instead of assuming
          the system list.
      * platform/Language.h:
      
      * testing/Internals.cpp:
      (WebCore::Internals::resetToConsistentState): Disable caption testing mode.
      (WebCore::Internals::Internals): Enable caption testing mode so the user's system
          preferences are not modified.
      
      LayoutTests: 
      
      * media/track/track-user-preferences-expected.txt: Added.
      * media/track/track-user-preferences.html: Added.
      
      * platform/chromium/TestExpectations: Skip new test, it depends on the track menu.
      * platform/efl/TestExpectations: Ditto.
      * platform/gtk/TestExpectations: Ditto.
      * platform/qt/TestExpectations: Ditto.
      * platform/win/TestExpectations: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b54d1c88
  14. 08 Feb, 2013 2 commits
    • eric.carlson@apple.com's avatar
      [Mac] respect in-band caption color · 2cd48f46
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=109203
      
      Reviewed by Dean Jackson.
      
      Source/WebCore: 
      
      Test: media/track/track-in-band-style.html
      
      * WebCore.xcodeproj/project.pbxproj: Add HTMLDivElement.h to private headers because it is 
          included by HTMLTextElement, which is included by HTMLMediaElement.h, which is included 
          by files in WebKit/WebKit2.
      * html/track/InbandTextTrack.cpp:
      (WebCore::InbandTextTrack::addGenericCue): Set cue colors if necessary.
      
      * html/track/TextTrackCue.h:
      (WebCore::TextTrackCue::element): New, accessor for the cue element so it can be styled.
      
      * html/track/TextTrackCueGeneric.cpp:
      (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): Set container and cue background 
          color if necessary.
      (WebCore::TextTrackCueGeneric::operator==): Compare cue colors.
      * html/track/TextTrackCueGeneric.h:
      (WebCore::TextTrackCueGeneric::foregroundColor): Add color accessors.
      (WebCore::TextTrackCueGeneric::setForegroundColor):
      (WebCore::TextTrackCueGeneric::backgroundColor):
      (WebCore::TextTrackCueGeneric::setBackgroundColor):
      
      * page/CaptionUserPreferencesMac.mm:
      (WebCore::CaptionUserPreferencesMac::registerForCaptionPreferencesChangedCallbacks): Always
          regenerate override CSS when an element registers for callbacks.
      (WebCore::CaptionUserPreferencesMac::captionsWindowCSS): Drive by fix of "window color" padding.
      (WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride): Log the stylesheet generated
          for easier debugging.
      
      * platform/graphics/InbandTextTrackPrivateClient.h:
      (WebCore::GenericCueData::foregroundColor): Add color getters/setters.
      (WebCore::GenericCueData::setForegroundColor):
      (WebCore::GenericCueData::backgroundColor):
      (WebCore::GenericCueData::setBackgroundColor):
      
      * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
      (WebCore::makeRGBA32FromARGBCFArray): Initialize a RGBA32 from a CFArray of color values.
      (WebCore::InbandTextTrackPrivateAVF::processCueAttributes): Process cue colors.
      
      LayoutTests: 
      
      * media/track/track-in-band-style-expected.txt: Added.
      * media/track/track-in-band-style.html: Added.
      
      * platform/chromium/TestExpectations: Skip new test.
      * platform/efl/TestExpectations: Ditto.
      * platform/gtk/TestExpectations: Ditto.
      * platform/mac/TestExpectations: Ditto.
      * platform/qt/TestExpectations: Ditto.
      * platform/win/TestExpectations: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2cd48f46
    • jer.noble@apple.com's avatar
      Bring WebKit up to speed with latest Encrypted Media spec. · 09c10fbf
      jer.noble@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=97037
      
      Reviewed by Eric Carlson.
      
      Source/JavaScriptCore:
      
      Define the ENABLE_ENCRYPTED_MEDIA_V2 setting.
      
      * Configurations/FeatureDefines.xcconfig:
      
      Source/WebCore:
      
      The most recent version of the Encrypted Media Extensions spec breaks functionality out of the
      HTMLMediaElement and into new MediaKeys and MediaKeySession classes. Since the CDM functionality
      has been pulled out of the media element, we create a proxy CDM class and factory system for
      creating specific CDM key system implementations. The spec also breaks out MediaKeyEvent
      into distinct event classes, MediaKeyNeededEvent and MediaKeyMessageEvent, for needkey and
      keymessage events, respectively.
      
      Tests: media/encrypted-media/encrypted-media-v2-events.html
             media/encrypted-media/encrypted-media-v2-syntax.html
      
      CDM is a proxy class (a la MediaPlayer) for a specific CDMPrivateInterface implementation. A CDM
      implementation is registered with the CDMFactory and will be created if that implementation supports
      the key system passed into the MediaKeys constructor. CDMSession is a pure-virtual interface exposed
      by concrete CDMPrivate subclasses.  Its lifetime is owned by MediaKeySession.
      * Modules/encryptedmedia/CDM.cpp: Added.
      (WebCore::installedCDMFactories): Initialize all the known CDM subtypes. Ports will add CDM implementations here.
      (WebCore::CDM::registerCDMFactory): Registers a new CDMFactory using the passed in function pointers.
      (WebCore::CDMFactoryForKeySystem): Return the first CDM factory which supports the requested key system.
      (WebCore::CDM::supportsKeySystem): Walk the installed CDMs and ask if the given key system is supported.
      (WebCore::CDM::supportsKeySystemMIMETypeAndCodec): Ditto, with an additional MIME type and codec string.
      (WebCore::CDM::create): Simple constructor wrapper.
      (WebCore::CDM::CDM): Simple constructor; calls bestCDMForKeySystem() to create it's private implementation.
      (WebCore::CDM::~CDM): Simple destructor.
      (WebCore::CDM::createSession): Creates a new CDMSession.
      * Modules/encryptedmedia/CDM.h: Added.
      (WebCore::CDM::keySystem): Simple accessor for m_keySystem.
      (WebCore::CDMSession::CDMSession): Simple constructor.
      (WebCore::CDMSession::~CDMSession): Simple destructor.
      * Modules/encryptedmedia/CDMPrivate.h: Added.
      (WebCore::CDMPrivateInterface::CDMPrivateInterface): Simple constructor.
      (WebCore::CDMPrivateInterface::~CDMPrivateInterface): Simple destructor.
      
      The new classes, MediaKeyMessageEvent and MediaKeyNeededEvent, take distinct subsets of the initializers of
      the original MediaKeyMessageEvent.
      * Modules/encryptedmedia/MediaKeyMessageEvent.cpp: Copied from Source/WebCore/html/MediaKeyEvent.cpp.
      (WebCore::MediaKeyMessageEventInit::MediaKeyMessageEventInit): Initializer now only takes message and destinationURL
          parameters.
      (WebCore::MediaKeyMessageEvent::MediaKeyMessageEvent): Simple constructor.
      (WebCore::MediaKeyMessageEvent::~MediaKeyMessageEvent): Simple destructor.
      (WebCore::MediaKeyMessageEvent::interfaceName): Standard interfaceName.
      * Modules/encryptedmedia/MediaKeyMessageEvent.h: Copied from Source/WebCore/html/MediaKeyEvent.h.
      (WebCore::MediaKeyMessageEvent::create): Simple construction wrapper.
      (WebCore::MediaKeyMessageEvent::message): Simple accessor for m_message.
      (WebCore::MediaKeyMessageEvent::destinationURL): Simple accessor for m_destinationURL.
      * Modules/encryptedmedia/MediaKeyMessageEvent.idl: Copied from Source/WebCore/html/MediaKeyEvent.idl.
      * Modules/encryptedmedia/MediaKeyNeededEvent.cpp: Copied from Source/WebCore/html/MediaKeyEvent.h.
      (WebCore::MediaKeyNeededEventInit::MediaKeyNeededEventInit): Initializer now only takes initData parameter.
      (WebCore::MediaKeyNeededEvent::MediaKeyNeededEvent): Simple constructor.
      (WebCore::MediaKeyNeededEvent::~MediaKeyNeededEvent): Simple destructor.
      (WebCore::MediaKeyNeededEvent::interfaceName): Standard interfaceName.
      * Modules/encryptedmedia/MediaKeyNeededEvent.h: Copied from Source/WebCore/html/MediaKeyEvent.h.
      (WebCore::MediaKeyNeededEvent::create): Simple construction wrapper.
      (WebCore::MediaKeyNeededEvent::initData): Simple accessor for m_initData.
      * Modules/encryptedmedia/MediaKeyNeededEvent.idl: Copied from Source/WebCore/html/MediaKeyEvent.idl.
      
      MediaKeySession is a new class that maps keys and key requests to a given session ID:
      * Modules/encryptedmedia/MediaKeySession.cpp: Added.
      (WebCore::MediaKeySession::create): Simple construction wrapper.
      (WebCore::MediaKeySession::MediaKeySession): Simple constructor.
      (WebCore::MediaKeySession::~MediaKeySession): Simple destructor; calls close().
      (WebCore::MediaKeySession::setError): Simple setter for m_error;
      (WebCore::MediaKeySession::close): Tell the CDM to clear any saved session keys.
      (WebCore::MediaKeySession::generateKeyRequest): Start a one-shot timer, handled in keyRequestTimerFired.
      (WebCore::MediaKeySession::keyRequestTimerFired): Follow the steps in the spec; ask the CDM to generate a key request.
      (WebCore::MediaKeySession::addKey): Start a one-shot timer, handled in addKeyTimerFired.
      (WebCore::MediaKeySession::addKeyTimerFired): Follow the steps in the spec; provide the key data to the CDM.
      * Modules/encryptedmedia/MediaKeySession.h: Added.
      (WebCore::MediaKeySession::keySystem): Simple accessor for m_keySystem.
      (WebCore::MediaKeySession::sessionId): Simple accessor for m_sessionId.
      (WebCore::MediaKeySession::error): Simple accessor for m_error;
      * Modules/encryptedmedia/MediaKeySession.idl:
      
      MediaKeySession inherits from EventTarget, and must override the pure virtual functions in that class:
      * Modules/encryptedmedia/MediaKeySession.cpp: Added.
      (WebCore::MediaKeySession::interfaceName):
      * Modules/encryptedmedia/MediaKeySession.h: Added.
      (WebCore::MediaKeySession::refEventTarget):
      (WebCore::MediaKeySession::derefEventTarget):
      (WebCore::MediaKeySession::eventTargetData):
      (WebCore::MediaKeySession::ensureEventTargetData):
      (WebCore::MediaKeySession::scriptExecutionContext):
      
      MediaKeys is a new class that encapsulates a CDM and a number of key sessions:
      * Modules/encryptedmedia/MediaKeys.cpp: Added.
      (WebCore::MediaKeys::create): Throw an exception if the key system parameter is unsupported; create a CDM object
          and a new MediaKeys session.
      (WebCore::MediaKeys::MediaKeys): Simple constructor.
      (WebCore::MediaKeys::~MediaKeys): Simple destructor.
      (WebCore::MediaKeys::createSession): Follow the spec and create a new key session.
      * Modules/encryptedmedia/MediaKeys.h: Added.
      * Modules/encryptedmedia/MediaKeys.idl: Copied from Source/WebCore/html/MediaError.idl.
      
      Provide a new interface to HTMLMediaElement for MediaPlayer which does not require a sessionId or a key system:
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::MediaPlayer::keyNeeded):
      
      MediaKeyError now has a systemCode parameter and member variable.
      * html/MediaKeyError.h:
      (WebCore::MediaKeyError::create): Take a systemCode parameter with a default (0) value.
      (WebCore::MediaKeyError::MediaKeyError): Ditto.
      (WebCore::MediaKeyError::systemCode): Simple accessor for m_systemCode.
      * html/MediaKeyError.idl:
      
      Add new methods to HTMLMediaElement to support MediaKeys. Support different initializer
      for the MediaKeyNeededEvent.
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::setMediaKeys): Simple setter for m_mediaKeys.
      (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded): This version takes fewer parameters
          than the deprecated version.
      * html/HTMLMediaElement.h:
      (WebCore::HTMLMediaElement::mediaKeys): Simple accessor for m_mediaKeys.
      * html/HTMLMediaElement.idl: Add the mediaKeys attribute.
      
      Add an ENABLE(ENCRYPTED_MEDIA_V2) check to the existing ENABLE(ENCRYPTED_MEDIA) one:
      * html/MediaError.h:
      * html/MediaError.idl:
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::bestMediaEngineForTypeAndCodecs):
      (WebCore::MediaPlayer::supportsType):
      * platform/graphics/MediaPlayer.h:
      (WebCore::MediaPlayer::keyNeeded): This version takes fewer parameters than the
          deprecated version.
      
      Support the new version of canPlayType which takes an extra parameter:
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
      (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine):
      (WebCore::MediaPlayerPrivateAVFoundationObjC::extendedSupportsType):
      * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
      * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
      (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine):
      (WebCore::MediaPlayerPrivateQTKit::extendedSupportsType):
      
      Add a mock CDM for use within DRT and WKTR to test the MediaKeys and MediaKeySession
      APIs and events:
      * testing/Internals.cpp:
      (WebCore::Internals::initializeMockCDM): Add the MockCDM class to the CDM factories.
      * testing/Internals.h:
      * testing/Internals.idl: Add the initializeMockCDM() method.
      * testing/MockCDM.cpp: Added.
      (WebCore::MockCDM::supportsKeySystem): Only supports the 'com.webcore.mock' key system.
      (WebCore::MockCDM::supportsMIMEType): Only supports the 'video/mock' mime type.
      (WebCore::initDataPrefix): Static method which returns a Uint8Array containing 'mock'.
      (WebCore::keyPrefix): Static method which returns a Uint8Array containing 'key'.
      (WebCore::keyRequest): Static method which returns a Uint8Array containing 'request'.
      (WebCore::generateSessionId): Return a monotonically increasing number.
      (WebCore::MockCDMSession::MockCDMSession): Simple constructor.
      (WebCore::MockCDMSession::generateKeyRequest): Ignores the parameters and returns a keyRequest() array.
      (WebCore::MockCDMSession::releaseKeys): No-op.
      (WebCore::MockCDMSession::addKey): Checks that the key starts with the keyPrefix() array.
      * testing/MockCDM.h: Added.
      (WebCore::MockCDM::create):
      (WebCore::MockCDM::~MockCDM): Simple destructor.
      (WebCore::MockCDM::MockCDM): Simple constructor.
      
      Add the new classes to the built system:
      * Configurations/FeatureDefines.xcconfig:
      * DerivedSources.make:
      * WebCore.exp.in:
      * WebCore.xcodeproj/project.pbxproj:
      
      Miscelaneous changes:
      * dom/EventNames.in: Add the two new event types, MediaKeyMessageEvent and MediaKeyNeededEvent.
      * dom/EventTargetFactory.in: Add the new EventTarget, MediaKeySession.
      * page/DOMWindow.idl: Add constructors for the new classes to the window object.
      
      Source/WTF:
      
      Define the ENABLE_ENCRYPTED_MEDIA_V2 setting.
      
      * wtf/Platform.h:
      
      LayoutTests:
      
      Added new tests for the updated Encrypted Media Extensions spec.
      
      * media/encrypted-media/encrypted-media-v2-events-expected.txt: Added.
      * media/encrypted-media/encrypted-media-v2-events.html: Added.
      * media/encrypted-media/encrypted-media-v2-syntax-expected.txt: Added.
      * media/encrypted-media/encrypted-media-v2-syntax.html: Added.
      * platform/Chromium/TestExpectations: Skip the new media/encrypted-media/ v2 tests.
      * platform/mac/media/encrypted-media/encrypted-media-can-play-type-expected.txt: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      09c10fbf
  15. 06 Feb, 2013 2 commits
    • commit-queue@webkit.org's avatar
      Store the language internally instead of using lang attribute for WebVTT nodes · 2fc09ea6
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=108858
      
      Patch by Dima Gorbik <dgorbik@apple.com> on 2013-02-06
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      Only language webvtt elements should have a lang attribute so we have to store
      the language internally in the element. Refactored the code to make
      computeInheritedLanguage virtual.
      
      Existing tests were modified to cover this case.
      
      * css/SelectorChecker.cpp:
      (WebCore::SelectorChecker::checkOne):
      * html/track/WebVTTElement.cpp:
      (WebCore::WebVTTElement::WebVTTElement):
      (WebCore::WebVTTElement::cloneElementWithoutAttributesAndChildren):
      (WebCore::WebVTTElement::createEquivalentHTMLElement): clone the internal language property.
      * html/track/WebVTTElement.h:
      (WebCore::WebVTTElement::language):
      (WebCore::WebVTTElement::setLanguage):
      * html/track/WebVTTParser.cpp: only set the lang attribute for language objects.
      (WebCore::WebVTTParser::constructTreeFromToken):
      
      LayoutTests:
      
      * media/track/captions-webvtt/styling-lang.vtt:
      * media/track/track-css-matching-lang-expected.txt:
      * media/track/track-css-matching-lang.html:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2fc09ea6
    • dino@apple.com's avatar
      Minor updates to captions menu UI · a020e6b6
      dino@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=109005
      
      Reviewed by Eric Carlson.
      
      Now that we only have a single section in the captions menu, remove the
      unnecessary wrapper element. Also update the UI for Mac so that the menu
      grows in size dynamically, and change the text we display for a caption
      that has neither label or language identifiers.
      
      Covered by existing tests.
      
      * English.lproj/Localizable.strings: New string for an unknown caption label.
      * css/fullscreenQuickTime.css: New rules for the captions menu.
      (video:-webkit-full-screen::-webkit-media-controls-closed-captions-container):
      (video:-webkit-full-screen::-webkit-media-controls-closed-captions-track-list):
      * css/mediaControlsQuickTime.css: Ditto.
      (video::-webkit-media-controls-closed-captions-container):
      (video::-webkit-media-controls-closed-captions-track-list):
      * html/shadow/MediaControlElements.cpp:
      (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
          Remove the <section> element container.
      * platform/LocalizedStrings.cpp:
      (WebCore::textTrackNoLabelText): New string for an unknown caption label.
      
      LayoutTests:
      
      A caption track without a label or language is now given the menu
      title 'Unknown'. Note also that the test includes some intentional
      failure text.
      
      * media/video-controls-captions-trackmenu-localized.html:
      * platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a020e6b6
  16. 05 Feb, 2013 2 commits
    • eric.carlson@apple.com's avatar
      [Mac] Complete plumbing so captions menu can indicate track type · eb3dd61d
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=108994
      
      Reviewed by Dean Jackson.
      
      Source/WebCore: 
      
      Plumb "isClosedCaptions" through to the Mac media engine.
      
      Updated media/video-controls-captions-trackmenu-localized.html and results.
      
      * html/track/InbandTextTrack.cpp:
      (WebCore::InbandTextTrack::isClosedCaptions): New, pass the call through to the private track.
      * html/track/InbandTextTrack.h:
      (InbandTextTrack):
      * html/track/TextTrack.cpp:
      (WebCore::TextTrack::TextTrack): Lose the member variable, this won't be accessed often enough
          to make it worth caching the value.
      * html/track/TextTrack.h:
      (WebCore::TextTrack::isClosedCaptions): Make virtual so derived classes can oveerride.
      * platform/graphics/InbandTextTrackPrivate.h:
      (WebCore::InbandTextTrackPrivate::isClosedCaptions): New.
      * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h:
      * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
      (WebCore::InbandTextTrackPrivateAVFObjC::isClosedCaptions): New.
      
      LayoutTests: 
      
      Update test results now that the Mac media engine identifies CC tracks.
      
      * media/video-controls-captions-trackmenu-localized.html:
      * platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      eb3dd61d
    • dino@apple.com's avatar
      [Mac] Captions menu should indicate language and type of track · 53a29d41
      dino@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=108882
      
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      On Mac, we want a specific format for menu items in a caption list. Since
      other ports might want different formats, move the generation of the label
      into CaptionsUserPreferences where it can be overridden.
      
      This required CaptionsUserPreferences to become public on the PageGroup, so
      it could be used when creating the menu. Also, since CaptionsUserPreferences
      was hidden on Mountain Lion and below, be a little more specific about
      which pieces can be seen on which builds.
      
      Covered by existing media/video-controls-captions-trackmenu tests.
      
      * English.lproj/Localizable.strings: Remove textTrackClosedCaptionsText.
      * html/shadow/MediaControlElements.cpp:
      (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu): Build only
          one section and get the track's display name from the user preferences.
      * page/CaptionUserPreferences.h:
      (WebCore::CaptionUserPreferences::displayNameForTrack): Default implementation of
          virtual function that provides a label for a captions menu item.
      * page/CaptionUserPreferencesMac.h: Add the new virtual function, and expose just
          a bit of this class outside 10.9 builds.
      * page/CaptionUserPreferencesMac.mm:
      (WebCore::CaptionUserPreferencesMac::CaptionUserPreferencesMac): Guard features for system version.
      (WebCore::CaptionUserPreferencesMac::~CaptionUserPreferencesMac): Ditto.
      (WebCore::CaptionUserPreferencesMac::displayNameForTrack): New OS X-specific method that
          returns a string for the menu label.
      * page/PageGroup.cpp:
      (WebCore::PageGroup::captionPreferences): Unguard for system version.
      * page/PageGroup.h: Make captionPreferences public.
      * platform/LocalizedStrings.cpp: Remove textTrackClosedCaptionsText - not needed any more.
      * platform/LocalizedStrings.h: Remove textTrackClosedCaptionsText.
      
      LayoutTests:
      
      Now that the captions menu can be labelled in a platform-specific way, move
      the results into the platform directory. At the moment, they are skipped
      everywhere but Mac. Also update the tests to the new menu structure, which
      only has a single list of entries.
      
      * media/video-controls-captions-trackmenu-localized.html: Updated for new menu structure.
      * media/video-controls-captions-trackmenu-expected.txt: Removed.
      * media/video-controls-captions-trackmenu-localized-expected.txt: Removed.
      * media/video-controls-captions-trackmenu-sorted-expected.txt: Removed.
      * media/video-controls-captions-trackmenu-sorted.html: Updated for new menu structure.
      * media/video-controls-captions-trackmenu.html: Updated for new menu structure.
      * platform/mac/media/video-controls-captions-trackmenu-expected.txt: New platform specific results.
      * platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt: Ditto.
      * platform/mac/media/video-controls-captions-trackmenu-sorted-expected.txt: Ditto.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      53a29d41
  17. 04 Feb, 2013 3 commits
  18. 31 Jan, 2013 1 commit
    • vcarbune@chromium.org's avatar
      [Track] Closed Caption button shouldn't be visible if all the track resources have failed loading · 9fb916c7
      vcarbune@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=106285
      
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      Updated existing test cases.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::textTracksAreReady): Checked whether there are tracks not loaded
      when the algorithm began.
      (WebCore::HTMLMediaElement::textTrackReadyStateChanged): If the ready state changed to
      FailedToLoad the media controls should check whether there are other caption tracks
      and hide the button if not.
      (WebCore::HTMLMediaElement::didAddTrack): Added trigger to closedCaptionsTrackChanged.
      (WebCore::HTMLMediaElement::hasClosedCaptions): Updated check to skip tracks that
      failed to load.
      * html/shadow/MediaControls.cpp:
      (WebCore::MediaControls::reset): Used the newly added method.
      (WebCore::MediaControls::refreshClosedCaptionsButtonVisibility): Added container method for
      default behaviour for refreshing the visibility of the caption button.
      (WebCore::MediaControls::closedCaptionTracksChanged): Used the newly added method.
      (WebCore):
      * html/shadow/MediaControls.h:
      (MediaControls):
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::textTracksAreReady):
      (WebCore::HTMLMediaElement::textTrackReadyStateChanged):
      (WebCore::HTMLMediaElement::setReadyState):
      (WebCore::HTMLMediaElement::didAddTrack):
      (WebCore::HTMLMediaElement::hasClosedCaptions):
      * html/shadow/MediaControls.cpp:
      (WebCore::MediaControls::reset):
      (WebCore::MediaControls::refreshClosedCaptionsButtonVisibility):
      (WebCore::MediaControls::closedCaptionTracksChanged):
      (WebCore):
      * html/shadow/MediaControls.h:
      (MediaControls):
      
      LayoutTests:
      
      Updated tests to include improved behavior.
      
      * media/video-controls-captions-expected.txt: Updated.
      * media/video-controls-captions.html: Updated.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141531 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9fb916c7
  19. 29 Jan, 2013 1 commit
  20. 25 Jan, 2013 3 commits
    • commit-queue@webkit.org's avatar
      Support language WebVTT Nodes · 6be29c8f
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107907
      
      Patch by Dima Gorbik <dgorbik@apple.com> on 2013-01-25
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      Language stack and WebVTT language nodes are added as
      required by specs.
      
      Test: media/track/track-css-matching-lang.html
      
      * html/track/TextTrackCue.cpp:
      (WebCore::TextTrackCue::copyWebVTTNodeToDOMTree): WebVTT language nodes should be
      spans in DOM and the lang attribute should be set for all nodes if applicable.
      * html/track/TextTrackCue.h:
      (WebCore::TextTrackCue::langElementTagName):
      (TextTrackCue):
      (WebCore::TextTrackCue::langAttributeName):
      * html/track/WebVTTParser.cpp:
      (WebCore::WebVTTParser::createDocumentFragmentFromCueText): clear the language stack in case
      we use the same parser object for multiple cues that have incorrect syntax.
      (WebCore::isLangToken):
      (WebCore):
      (WebCore::WebVTTParser::constructTreeFromToken): parse lang WebVTT objects.
      * html/track/WebVTTParser.h:
      (WebVTTParser):
      
      LayoutTests:
      
      * media/track/captions-webvtt/styling-lang.vtt: Added.
      * media/track/track-css-matching-lang-expected.txt: Added.
      * media/track/track-css-matching-lang.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6be29c8f
    • eric.carlson@apple.com's avatar
      Adding a text track should not make controls visible · 6ddcabed
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=107956
      
      Source/WebCore: 
      
      Reviewed by Dean Jackson.
      
      Test: media/media-captions-no-controls.html
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Call updateTextTrackDisplay.
      (WebCore::HTMLMediaElement::updateTextTrackDisplay): New, call mediaControls->updateTextTrackDisplay()
          if we have controls.
      (WebCore::HTMLMediaElement::setClosedCaptionsVisible):  Call updateTextTrackDisplay.
      (WebCore::HTMLMediaElement::createMediaControls): Hide controls if they should not be 
          visible. Minor drive by cleanup.
      (WebCore::HTMLMediaElement::configureTextTrackDisplay): Drive by cleanup, pull the three lines
          from updateClosedCaptionsControls inline and delete it because this was the only caller.
      * html/HTMLMediaElement.h:
      
      LayoutTests: 
      
      Reviewed by  Dean Jackson.
      
      * media/media-captions-no-controls-expected.txt: Added.
      * media/media-captions-no-controls.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140862 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6ddcabed
    • vcarbune@chromium.org's avatar
      Heap-use-after-free in WebCore::TextTrackCue::isActive · c8333e83
      vcarbune@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=104594
      
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      Test: media/track/track-remove-active-cue-crash.html
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
      (WebCore::HTMLMediaElement::textTrackAddCue):
      (WebCore::HTMLMediaElement::textTrackRemoveCue): Remove the cue
      from the active cue set as well.
      * html/HTMLMediaElement.h:
      (WebCore):
      
      LayoutTests:
      
      * media/track/track-remove-active-cue-crash-expected.txt: Added.
      * media/track/track-remove-active-cue-crash.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c8333e83
  21. 24 Jan, 2013 1 commit
    • commit-queue@webkit.org's avatar
      Implement :past pseudo class for the WebVTT ::cue pseudo element · f972cbb4
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=105482
      
      Patch by Dima Gorbik <dgorbik@apple.com> on 2013-01-24
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      It is good to have a designated pseudo class for this, though same could
      be achieved by using a combination of ::cue and ::cue(:future).
      Tests also check that nested timestamps work properly.
      
      Test: media/track/track-css-matching-timestamps.html
      
      * css/CSSSelector.cpp:
      (WebCore::CSSSelector::pseudoId):
      (WebCore::nameToPseudoTypeMap):
      (WebCore::CSSSelector::extractPseudoType):
      * css/CSSSelector.h:
      * css/SelectorChecker.cpp:
      (WebCore::SelectorChecker::checkOne):
      
      LayoutTests:
      
      * media/track/captions-webvtt/styling-timestamps.vtt: Added.
      * media/track/track-css-matching-timestamps-expected.txt: Added.
      * media/track/track-css-matching-timestamps.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140707 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f972cbb4
  22. 23 Jan, 2013 1 commit
    • philn@webkit.org's avatar
      [GStreamer] Add Opus MIME type to the list of supported ones · 84f6e716
      philn@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=98759
      
      Patch by Adrian Perez de Castro <aperez@igalia.com> on 2013-01-23
      Reviewed by Philippe Normand.
      
      Source/WebCore:
      
      GStreamer has support for the Opus codec (http://opus-codec.org) by
      using a plugin present in the "gst-plugins-bad" repository. Opus
      streams may be embedded in a Ogg container, or standalone. The case
      of the Ogg container is already covered by the "*/ogg" MIME types
      declared as supported by the GStreamer media playing code, but for
      standalone streams to work, "audio/opus" has to be added.
      
      With this, and the needed GStreamer plugin installed, the GTK+
      launcher is able to correctly play the example streams from
      http://opus-codec.org/examples
      
      * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
      
      LayoutTests:
      
      Opus (http://opus-codec.org) streams are typically embedded into
      Ogg containers, so add a check for it in the test case.
      
      * media/media-can-play-ogg-expected.txt:
      * media/media-can-play-ogg.html:
      * platform/chromium-android/media/media-can-play-ogg-expected.txt:
      * platform/chromium/media/media-can-play-ogg-expected.txt: Copied from LayoutTests/media/media-can-play-ogg-expected.txt.
      * platform/efl/media/media-can-play-ogg-expected.txt: Copied from LayoutTests/media/media-can-play-ogg-expected.txt.
      * platform/gtk/media/media-can-play-ogg-expected.txt: Copied from LayoutTests/media/media-can-play-ogg-expected.txt.
      * platform/qt-linux/media/media-can-play-ogg-expected.txt: Copied from LayoutTests/media/media-can-play-ogg-expected.txt.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140532 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      84f6e716
  23. 22 Jan, 2013 1 commit
  24. 18 Jan, 2013 1 commit
    • commit-queue@webkit.org's avatar
      Implement ::cue() pseudo element property whitelist · 085528c9
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=105477
      
      Patch by Dima Gorbik <dgorbik@apple.com> on 2013-01-18
      Reviewed by Antti Koivisto.
      
      Source/WebCore:
      
      Only allowed by specs properties are applied to WebVTT nodes. We used whitelists before for the region
      style rule so this refactors the code a little bit to pass bitfields that contain the information on which
      whitelists should be used.
      
      Test: media/track/track-css-property-whitelist.html
      
      * css/RuleSet.cpp:
      (WebCore::RuleData::RuleData): set a region bit when creating a RuleData.
      (WebCore::RuleSet::addRule): set a cue bit when PseudoCue type is set for a selector.
      * css/RuleSet.h: add the new bitfield as an ivar and setters/getters to access it.
      (WebCore::RuleData::isInRegionRule):
      (WebCore::RuleData::whitelistType):
      (WebCore::RuleData::isInCueRule):
      (WebCore::RuleData::setIsInCueRule):
      * css/StyleResolver.cpp: refactor the code to pass a bitfield instead of single bits.
      (WebCore::StyleResolver::addMatchedProperties):
      (WebCore::StyleResolver::sortAndTransferMatchedRules):
      (WebCore::StyleResolver::applyProperties):
      (WebCore::StyleResolver::applyMatchedProperties):
      (WebCore::StyleResolver::isValidCueStyleProperty):
      * css/StyleResolver.h:
      
      LayoutTests:
      
      * media/track/captions-webvtt/whitelist.vtt: Added.
      * media/track/track-css-property-whitelist-expected.txt: Added.
      * media/track/track-css-property-whitelist.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140173 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      085528c9
  25. 16 Jan, 2013 1 commit
    • commit-queue@webkit.org's avatar
      Cues not rendered when they should be · d8e28e78
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=106943
      
      Patch by Victor Carbune <vcarbune@chromium.org> on 2013-01-16
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      Forced rendering update, even if the active set of cues didn't change.
      
      Test: media/track/track-cue-rendering-mode-changed.html
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::updateActiveTextTrackCues): If exiting early,
      update the cues rendered by the text track container.
      (WebCore::HTMLMediaElement::textTrackModeChanged): Trigger update of the
      re-checking the active cues and render the ones not yet on screen.
      
      LayoutTests:
      
      * media/track/track-cue-rendering-mode-changed-expected.txt: Added.
      * media/track/track-cue-rendering-mode-changed.html: Added.
      * media/video-controls-captions-expected.txt: Updated.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139932 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d8e28e78
  26. 15 Jan, 2013 2 commits
  27. 14 Jan, 2013 1 commit