1. 27 Mar, 2013 1 commit
    • eric.carlson@apple.com's avatar
      [Mac] webkitClosedCaptionsVisible doesn't work · 92907e15
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=113417
      
      Reviewed by Jer Noble.
      
      Source/WebCore: 
      
      Test: media/track/track-in-band-legacy-api.html
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::HTMLMediaElement): Delete m_disableCaptions, it is no longer used.
      (WebCore::HTMLMediaElement::configureTextTrackGroup): Pass this to textTrackSelectionScore.
      (WebCore::HTMLMediaElement::setClosedCaptionsVisible):  Delete m_disableCaptions, it is no longer used.
      * html/HTMLMediaElement.h: Ditto.
      
      * page/CaptionUserPreferences.cpp:
      (WebCore::CaptionUserPreferences::textTrackSelectionScore): Add an HTMLMediaElement parameter.
      * page/CaptionUserPreferences.h:
      
      * page/CaptionUserPreferencesMac.h:
      * page/CaptionUserPreferencesMac.mm:
      (WebCore::CaptionUserPreferencesMac::textTrackSelectionScore): Return a score if the media element
          is showing captions, even if the preference says captions are disabled.
      
      LayoutTests: 
      
      * media/track/track-in-band-legacy-api-expected.txt: Added.
      * media/track/track-in-band-legacy-api.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@147001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      92907e15
  2. 22 Mar, 2013 1 commit
    • eric.carlson@apple.com's avatar
      Cleanup text track selection logic · d4e6f18f
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=113062
      
      Reviewed by Jer Noble.
      
      No new tests, covered by existing tests.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::userIsInterestedInThisTrackKind): Remove.
      (WebCore::HTMLMediaElement::configureTextTrackGroup): Don't look at track attributes directly,
          use captionPreferences->textTrackSelectionScore to calculate track rank.
      (WebCore::HTMLMediaElement::setClosedCaptionsVisible): Set m_processingPreferenceChange here
          instead of in captionPreferencesChanged.
      (WebCore::HTMLMediaElement::captionPreferencesChanged): Don't suppress calls to setClosedCaptionsVisible,
          existing code already makes sure we don't do unnecessary work.
      * html/HTMLMediaElement.h:
      
      * html/shadow/MediaControlElements.cpp:
      (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Drive by cleanup, don't
          process inactive cues.
      
      * html/shadow/MediaControlsApple.cpp:
      (WebCore::MediaControlsApple::changedClosedCaptionsVisibility): Call resetTrackListMenu instead
          of updateDisplay so we only mark the menu as needing a recalculation and do the work when
          it is displayed.
      
      * page/CaptionUserPreferences.cpp:
      (WebCore::CaptionUserPreferences::shouldShowCaptions): When in testing mode, return true if
          the caption or subtitle preference has been set.
      (WebCore::CaptionUserPreferences::setShouldShowCaptions): In testing mode, clear the caption
          and subtitle preference when passed false.
      (WebCore::CaptionUserPreferences::textTrackSelectionScore): Calculate the track score based on
          track type preference and preferred language.
      (WebCore::CaptionUserPreferences::textTrackLanguageSelectionScore): Score a track according to
          the language presence and position in the preferred languages list.
      * page/CaptionUserPreferences.h:
      
      * page/CaptionUserPreferencesMac.h:
      * page/CaptionUserPreferencesMac.mm:
      (WebCore::CaptionUserPreferencesMac::textTrackSelectionScore): Calculate track language score 
          according to user preferences.
      
      * platform/Language.cpp:
      (WebCore::indexOfBestMatchingLanguageInList): Repurposed the static bestMatchingLanguage
          function to return the location of a language in a Vector.
      (WebCore::preferredLanguageFromList): Removed.
      * platform/Language.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d4e6f18f
  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. 14 Mar, 2013 1 commit
    • jer.noble@apple.com's avatar
      Crash in DumpRenderTree at com.apple.WebCore:... · c3419e02
      jer.noble@apple.com authored
      Crash in DumpRenderTree at com.apple.WebCore: WebCore::CaptionUserPreferences::captionPreferencesChanged + 185
      https://bugs.webkit.org/show_bug.cgi?id=112051
      
      Reviewed by Eric Carlson.
      
      No new tests; fixes a crash during media/video-controls-captions-trackmenu.html.
      
      Instead of relying on a registration system which can fail when an element's document does not have a page,
      Elements will register for captionPreferencesChanged() notifications directly with their owning Document.
      CaptionUserPreferences, in turn, will notify all Documents in its PageGroup, rather than only directly
      registered listeners.
      
      * dom/Document.cpp:
      (WebCore::Document::registerForCaptionPreferencesChangedCallbacks): Added. Notify the CaptionUserPreferences that someone
          is interested in captionPreferencesChanged notfications.
      (WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks): Added.
      (WebCore::Document::captionPreferencesChanged): Added. Pass to all registered elements.
      * dom/Document.h:
      * dom/Element.h:
      (WebCore::Element::captionPreferencesChanged): Added. Empty; intended
          to be overridden by subclasses.
      * history/CachedPage.cpp:
      (WebCore::CachedPage::CachedPage): Initialize m_needsCaptionPreferenceChanged member.
      (WebCore::CachedPage::restore): Call captionPreferencesChanged() if necessary.
      * history/CachedPage.h:
      (WebCore::CachedPage::markForCaptionPreferencesChanged): Set the m_needsCaptionPreferenceChanged member.
      * history/PageCache.cpp:
      (WebCore::PageCache::markPagesForCaptionPreferencesChanged): Pass to every CachedPage.
      * history/PageCache.h:
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::HTMLMediaElement): Register with the Document.
      (WebCore::HTMLMediaElement::~HTMLMediaElement): Unregister with same.
      (WebCore::HTMLMediaElement::attach): Remove previous registration call.
      * html/HTMLMediaElement.h:
      * page/CaptionUserPreferences.cpp:
      (WebCore::CaptionUserPreferences::captionPreferencesChanged): Pass to the
          PageGroup.
      * page/CaptionUserPreferences.h:
      (WebCore::CaptionUserPreferences::setInterestedInCaptionPreferenceChanges):
          Empty; intended to be overridden by subclasses.
      * page/CaptionUserPreferencesMac.h:
      * page/CaptionUserPreferencesMac.mm:
      (WebCore::CaptionUserPreferencesMac::setInterestedInCaptionPreferenceChanges):
          Renamed from registerForPreferencesChangedCallbacks().
      (WebCore::CaptionUserPreferencesMac::captionPreferencesChanged):
          Replace call to havePreferenceChangeListeners() with m_listeningForPreferenceChanges.
      * page/Page.cpp:
      (WebCore::Page::captionPreferencesChanged):
          Pass to every contained Document.
      * page/Page.h:
      * page/CaptionUserPreferences.cpp:
      (WebCore::CaptionUserPreferences::captionPreferencesChanged): Pass to the PageGroup.
      * page/CaptionUserPreferences.h:
      * page/PageGroup.cpp:
      (WebCore::PageGroup::captionPreferencesChanged): Pass to every page, as well as pages in the PageCache.
      * page/PageGroup.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c3419e02
  5. 11 Mar, 2013 1 commit
    • inferno@chromium.org's avatar
      Add ASSERT_WITH_SECURITY_IMPLICATION to catch bad casts. · 0328372a
      inferno@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=112060
      
      Reviewed by Eric Seidel.
      
      Source/WebCore:
      
      * Modules/geolocation/Geolocation.cpp:
      (WebCore::Geolocation::document):
      * accessibility/AccessibilityMenuList.h:
      (WebCore::toAccessibilityMenuList):
      * accessibility/AccessibilityNodeObject.h:
      (WebCore::toAccessibilityNodeObject):
      * accessibility/AccessibilityRenderObject.h:
      (WebCore::toAccessibilityRenderObject):
      * accessibility/AccessibilitySVGRoot.h:
      (WebCore::toAccessibilitySVGRoot):
      * accessibility/AccessibilitySpinButton.h:
      (WebCore::toAccessibilitySpinButton):
      (WebCore::toAccessibilitySpinButtonPart):
      * accessibility/AccessibilityTable.h:
      (WebCore::toAccessibilityTable):
      * css/StyleRule.h:
      (WebCore::toStyleRuleMedia):
      (WebCore::toStyleRuleSupports):
      (WebCore::toStyleRuleRegion):
      * dom/EventContext.h:
      (WebCore::toTouchEventContext):
      * fileapi/File.h:
      (WebCore::toFile):
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::insertAdjacentElement):
      (WebCore::contextElementForInsertion):
      * html/HTMLMediaElement.h:
      (WebCore::toMediaElement):
      * html/HTMLMeterElement.h:
      (WebCore::toHTMLMeterElement):
      * html/HTMLOptionElement.cpp:
      (WebCore::toHTMLOptionElement):
      * html/HTMLProgressElement.cpp:
      (WebCore::HTMLProgressElement::renderProgress):
      * html/HTMLProgressElement.h:
      (WebCore::toHTMLProgressElement):
      * html/HTMLSelectElement.h:
      (WebCore::toHTMLSelectElement):
      * html/HTMLTableCellElement.cpp:
      (WebCore::toHTMLTableCellElement):
      * html/HTMLTextFormControlElement.h:
      (WebCore::toHTMLTextFormControlElement):
      * html/PluginDocument.h:
      (WebCore::toPluginDocument):
      * html/shadow/DetailsMarkerControl.cpp:
      (WebCore::DetailsMarkerControl::summaryElement):
      * html/shadow/HTMLContentElement.h:
      (WebCore::toHTMLContentElement):
      * html/shadow/HTMLShadowElement.h:
      (WebCore::toHTMLShadowElement):
      * html/shadow/TextFieldDecorationElement.cpp:
      (WebCore::TextFieldDecorationElement::hostInput):
      * page/DOMWindow.cpp:
      (WebCore::DOMWindow::document):
      * rendering/InlineTextBox.h:
      (WebCore::toInlineTextBox):
      * rendering/RenderHTMLCanvas.h:
      (WebCore::toRenderHTMLCanvas):
      * rendering/RenderScrollbar.h:
      (WebCore::toRenderScrollbar):
      * rendering/RenderTextFragment.h:
      (WebCore::toRenderTextFragment):
      * rendering/mathml/RenderMathMLOperator.h:
      (WebCore::toRenderMathMLOperator):
      * rendering/svg/RenderSVGTextPath.h:
      (WebCore::toRenderSVGTextPath):
      * rendering/svg/RenderSVGViewportContainer.h:
      (WebCore::toRenderSVGViewportContainer):
      * svg/graphics/SVGImageChromeClient.h:
      (WebCore::toSVGImageChromeClient):
      
      Source/WebKit/chromium:
      
      * src/FrameLoaderClientImpl.cpp:
      (WebKit::FrameLoaderClientImpl::redirectDataToPlugin):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0328372a
  6. 09 Mar, 2013 1 commit
    • eric.carlson@apple.com's avatar
      Enable platform code to implement text track menu · db6565c6
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=111924
      
      Reviewed by Dean Jackson.
      
      No new tests, the new code isn't enabled in any ports yet.
      
      * WebCore.xcodeproj/project.pbxproj: Add PlatformTextTrack.h and PlatformTextTrackMenu.h.
      
      * html/HTMLAudioElement.cpp:
      (WebCore::HTMLAudioElement::createForJSConstructor): scheduleLoad -> scheduleDelayedAction.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::HTMLMediaElement): Deal with scheduleLoad to scheduleDelayedAction rename.
      (WebCore::HTMLMediaElement::parseAttribute): Ditto.
      (WebCore::HTMLMediaElement::finishParsingChildren): Ditto.
      (WebCore::HTMLMediaElement::insertedInto): Ditto.
      (WebCore::HTMLMediaElement::scheduleDelayedAction): Ditto.
      (WebCore::HTMLMediaElement::scheduleNextSourceChild): Ditto.
      (WebCore::HTMLMediaElement::loadTimerFired): Ditto.
      (WebCore::HTMLMediaElement::textTrackModeChanged): Notify platform menu of track change.
      (WebCore::HTMLMediaElement::playInternal): Deal with scheduleLoad to scheduleDelayedAction rename.
      (WebCore::HTMLMediaElement::pauseInternal): Ditto.
      (WebCore::HTMLMediaElement::mediaPlayerDidAddTrack): Ditto. Call addTrack() instead of appending
          the track directly.
      (WebCore::HTMLMediaElement::setSelectedTextTrack): Deal with platform menu changing the
          selected track.
      (WebCore::HTMLMediaElement::platformTextTracks): Return an array of PlatformTracks representing
          the current text tracks.
      (WebCore::HTMLMediaElement::notifyMediaPlayerOfTextTrackChanges): Notify the platform menu
          that the list of text tracks has changed.
      (WebCore::HTMLMediaElement::platformTextTrackMenu): Return the platform track menu, if any.
      (WebCore::HTMLMediaElement::closeCaptionTracksChanged):
      (WebCore::HTMLMediaElement::addTrack): Call addTrack() instead of appending the track directly.
      (WebCore::HTMLMediaElement::removeTrack): Call closeCaptionTracksChanged.
      (WebCore::HTMLMediaElement::addTextTrack): Call addTrack() instead of appending the track directly.
      (WebCore::HTMLMediaElement::didAddTrack): Ditto.
      (WebCore::HTMLMediaElement::didRemoveTrack): Deal with scheduleLoad to scheduleDelayedAction rename.
      (WebCore::HTMLMediaElement::sourceWasAdded): Ditto.
      (WebCore::HTMLMediaElement::clearMediaPlayer): Forget the platform track menu.
      (WebCore::HTMLMediaElement::resume): Deal with scheduleLoad to scheduleDelayedAction rename.
      * html/HTMLMediaElement.h:
      
      * html/track/InbandTextTrack.h: scheduleLoad -> scheduleDelayedAction.
      
      * html/track/TextTrack.cpp:
      (WebCore::TextTrack::platformTextTrack): Create a PlatformTextTrack.
      * html/track/TextTrack.h:
      
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::MediaPlayer::implementsTextTrackControls): New, player private passthrough.
      (WebCore::MediaPlayer::textTrackMenu): Ditto.
      * platform/graphics/MediaPlayer.h:
      * platform/graphics/MediaPlayerPrivate.h:
      
      * platform/graphics/PlatformTextTrack.h: Added.
      
      * platform/graphics/PlatformTextTrackMenu.h: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145322 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      db6565c6
  7. 25 Feb, 2013 1 commit
    • jer.noble@apple.com's avatar
      AVFoundation.framework and QTKit.framework are lazy-loaded on every WebProcess launch · 5d8930ca
      jer.noble@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=110725
      
      Reviewed by Eric Carlson.
      
      When settings are changed, do not re-query the media engines (which causes their respective
      frameworks to load). Instead, merely clear any previously loaded media engines so that
      the media engine list will be re-queried the next time installedMediaEngines() is called.
      
      (WebCore::MediaPlayer::resetMediaEngines): Renamed from requeryMediaEngines.
      * platform/graphics/MediaPlayer.h:
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::resetMediaEngines): Ditto.
      * html/HTMLMediaElement.h:
      * page/Settings.cpp:
      (WebCore::Settings::setAVFoundationEnabled): Call renamed method.
      (WebCore::Settings::setQTKitEnabled):  Ditto.
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::installedMediaEngines): Only clear out previously queried engines.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5d8930ca
  8. 22 Feb, 2013 1 commit
    • acolwell@chromium.org's avatar
      Factor MediaSource methods out of MediaPlayer & MediaPlayerPrivate and into a... · 0589fff9
      acolwell@chromium.org authored
      Factor MediaSource methods out of MediaPlayer & MediaPlayerPrivate and into a new MediaSourcePrivate interface.
      https://bugs.webkit.org/show_bug.cgi?id=109857
      
      Reviewed by Adam Barth.
      
      Source/WebCore:
      
      This is a simple refactor that moves MediaSource related methods out of MediaPlayer & MediaPlayerPrivate
      so that the MediaSource implementation can be updated without further polluting these interfaces.
      MediaSourcePrivate is the new WebCore interface that ports must implement to support the MediaSource API.
      
      No new tests. No user visible behavior has changed.
      
      * Modules/mediasource/MediaSource.cpp:
      (WebCore::MediaSource::MediaSource):
      (WebCore::MediaSource::duration):
      (WebCore::MediaSource::setDuration):
      (WebCore::MediaSource::addSourceBuffer):
      (WebCore::MediaSource::removeSourceBuffer):
      (WebCore::MediaSource::setReadyState):
      (WebCore::MediaSource::endOfStream):
      (WebCore::MediaSource::buffered):
      (WebCore::MediaSource::append):
      (WebCore::MediaSource::abort):
      (WebCore::MediaSource::setTimestampOffset):
      (WebCore::MediaSource::setPrivateAndOpen):
      (WebCore):
      (WebCore::MediaSource::hasPendingActivity):
      (WebCore::MediaSource::stop):
      * Modules/mediasource/MediaSource.h:
      (MediaSource):
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::HTMLMediaElement):
      (WebCore::HTMLMediaElement::loadResource):
      (WebCore::HTMLMediaElement::createMediaPlayer):
      (WebCore::HTMLMediaElement::reportMemoryUsage):
      * html/HTMLMediaElement.h:
      (HTMLMediaElement):
      * platform/graphics/MediaPlayer.cpp:
      (NullMediaPlayerPrivate):
      (WebCore::NullMediaPlayerPrivate::load):
      (WebCore::MediaPlayer::load):
      (WebCore):
      (WebCore::MediaPlayer::loadWithNextMediaEngine):
      * platform/graphics/MediaPlayer.h:
      (WebCore):
      (MediaPlayerClient):
      (MediaPlayer):
      * platform/graphics/MediaPlayerPrivate.h:
      (MediaPlayerPrivateInterface):
      * platform/graphics/MediaSourcePrivate.h: Added.
      (WebCore):
      (MediaSourcePrivate): Contains the MediaSource methods extracted from MediaPlayer.
      (WebCore::MediaSourcePrivate::MediaSourcePrivate):
      (WebCore::MediaSourcePrivate::~MediaSourcePrivate):
      
      Source/WebKit/chromium:
      
      WebMediaSource and WebMediaSource client were created to replace the MediaSource methods in WebMediaPlayer and
      WebMediaPlayerClient. This allows the MediaSource implementation to be updated without further polluting the
      media player interfaces.
      
      * WebKit.gyp:
      * public/WebMediaPlayer.h:
      (WebMediaPlayer):
      (WebKit::WebMediaPlayer::load):
      * public/WebMediaPlayerClient.h:
      (WebKit):
      * public/WebMediaSource.h: Added.
      (WebKit):
      (WebMediaSource):
      (WebKit::WebMediaSource::~WebMediaSource):
      * public/WebMediaSourceClient.h: Added.
      (WebKit):
      (WebMediaSourceClient):
      (WebKit::WebMediaSourceClient::~WebMediaSourceClient):
      * src/AssertMatchingEnums.cpp:
      * src/WebMediaPlayerClientImpl.cpp:
      (WebKit):
      (WebMediaSourceClientImpl): Temporary WebMediaSourceClient implementation to keep things working until Chromium
                                  changes land.
      (WebKit::WebMediaSourceClientImpl::WebMediaSourceClientImpl):
      (WebKit::WebMediaSourceClientImpl::~WebMediaSourceClientImpl):
      (WebKit::WebMediaSourceClientImpl::addId):
      (WebKit::WebMediaSourceClientImpl::removeId):
      (WebKit::WebMediaSourceClientImpl::buffered):
      (WebKit::WebMediaSourceClientImpl::append):
      (WebKit::WebMediaSourceClientImpl::abort):
      (WebKit::WebMediaSourceClientImpl::duration):
      (WebKit::WebMediaSourceClientImpl::setDuration):
      (WebKit::WebMediaSourceClientImpl::endOfStream):
      (WebKit::WebMediaSourceClientImpl::setTimestampOffset):
      (WebKit::WebMediaPlayerClientImpl::sourceOpened):
      (WebKit::WebMediaPlayerClientImpl::sourceURL):
      (WebKit::WebMediaPlayerClientImpl::load):
      (WebKit::WebMediaPlayerClientImpl::loadRequested):
      (WebKit::WebMediaPlayerClientImpl::loadInternal):
      * src/WebMediaPlayerClientImpl.h:
      (WebMediaPlayerClientImpl):
      * src/WebMediaSourceImpl.cpp: Added.
      (WebKit):
      (MediaSourcePrivateImpl):
      (WebKit::MediaSourcePrivateImpl::~MediaSourcePrivateImpl):
      (WebKit::MediaSourcePrivateImpl::MediaSourcePrivateImpl):
      (WebKit::MediaSourcePrivateImpl::addId):
      (WebKit::MediaSourcePrivateImpl::removeId):
      (WebKit::MediaSourcePrivateImpl::buffered):
      (WebKit::MediaSourcePrivateImpl::append):
      (WebKit::MediaSourcePrivateImpl::abort):
      (WebKit::MediaSourcePrivateImpl::duration):
      (WebKit::MediaSourcePrivateImpl::setDuration):
      (WebKit::MediaSourcePrivateImpl::endOfStream):
      (WebKit::MediaSourcePrivateImpl::setTimestampOffset):
      (WebKit::WebMediaSourceImpl::WebMediaSourceImpl):
      (WebKit::WebMediaSourceImpl::~WebMediaSourceImpl):
      (WebKit::WebMediaSourceImpl::open):
      * src/WebMediaSourceImpl.h: Added.
      (WebKit):
      (WebMediaSourceImpl):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0589fff9
  9. 13 Feb, 2013 2 commits
    • jer.noble@apple.com's avatar
      EME: MediaPlayer::keyNeede() should return a bool indicating whether an event... · ebe4abe5
      jer.noble@apple.com authored
      EME: MediaPlayer::keyNeede() should return a bool indicating whether an event listener was triggered.
      https://bugs.webkit.org/show_bug.cgi?id=109701
      
      Reviewed by Eric Carlson.
      
      Clients of MediaPlayer may need to do cleanup if calling keyNeeded()
      results in no event listener being triggered. Return a bool (like the
      v1 equivalent keyNeeded method) to indicate this.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
      * html/HTMLMediaElement.h:
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::MediaPlayer::keyNeeded):
      * platform/graphics/MediaPlayer.h:
      (WebCore::MediaPlayerClient::mediaPlayerKeyNeeded):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ebe4abe5
    • 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
  10. 08 Feb, 2013 2 commits
    • 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
    • tkent@chromium.org's avatar
      Adjust usage of ENABLE flags to enable whole content · c271a5fc
      tkent@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=109270
      
      Reviewed by Eric Seidel.
      
      Our common usage of ENABLE flags to enable whole content of files is:
      
      For .cpp files:
        #include "config.h"
        #if ENABLE(FOOBAR)
        #include "FooBar.h"
      
      For .h files:
        #ifndef FooBar_h
        #define FooBar_h
        #if ENABLE(FOOBAR)
      
      Fix files which have uncommon usage, and fix CodeGeneratorV8.pm so that
      it generates the common pattern. Note that CodeGeneratorJS.pm already
      generates code in this order.
      
      * bindings/scripts/CodeGeneratorV8.pm:
      (GenerateHeaderContentHeader):
      (GenerateImplementationContentHeader):
      * bindings/scripts/test/V8/V8TestCallback.cpp:
      * bindings/scripts/test/V8/V8TestCallback.h:
      * bindings/scripts/test/V8/V8TestInterface.cpp:
      * bindings/scripts/test/V8/V8TestInterface.h:
      * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
      * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h:
      * html/BaseMultipleFieldsDateAndTimeInputType.h:
      * html/ColorInputType.cpp:
      * html/ColorInputType.h:
      * html/DateInputType.cpp:
      * html/DateTimeInputType.cpp:
      * html/DateTimeInputType.h:
      * html/DateTimeLocalInputType.cpp:
      * html/HTMLAudioElement.cpp:
      * html/HTMLAudioElement.h:
      * html/HTMLDataListElement.cpp:
      * html/HTMLDialogElement.cpp:
      * html/HTMLDialogElement.h:
      * html/HTMLMediaElement.cpp:
      * html/HTMLMediaElement.h:
      * html/HTMLMeterElement.cpp:
      * html/HTMLProgressElement.cpp:
      * html/HTMLSourceElement.cpp:
      * html/HTMLSourceElement.h:
      * html/HTMLTrackElement.cpp:
      * html/HTMLTrackElement.h:
      * html/HTMLVideoElement.cpp:
      * html/HTMLVideoElement.h:
      * html/MonthInputType.cpp:
      * html/TimeInputType.cpp:
      * html/WeekInputType.cpp:
      * html/shadow/DateTimeFieldElement.h:
      * html/shadow/DetailsMarkerControl.cpp:
      * html/shadow/MeterShadowElement.cpp:
      * html/shadow/ProgressShadowElement.cpp:
      * rendering/RenderDetailsMarker.cpp:
      * rendering/RenderInputSpeech.cpp:
      * rendering/RenderMeter.cpp:
      * rendering/RenderProgress.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c271a5fc
  11. 30 Jan, 2013 2 commits
    • esprehn@chromium.org's avatar
      Remove willAddAuthorShadowRoot and replace with alwaysCreateUserAgentShadowRoot · 1326ee13
      esprehn@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=108248
      
      Reviewed by Dimitri Glazkov.
      
      The only reason willAddAuthorShadowRoot exists is so that a handful of
      other elements can create the user agent shadow root right before the
      author shadow root is created. Instead of providing this generic hook
      just expose a virtual method on Element that requests this behavior.
      
      No new tests, just refactoring.
      
      * dom/Element.cpp:
      (WebCore::Element::createShadowRoot):
      * dom/Element.h:
      (Element):
      (WebCore::Element::alwaysCreateUserAgentShadowRoot): Added.
      * dom/ElementShadow.cpp:
      (WebCore::ElementShadow::addShadowRoot): Remove willAddAuthorShadowRoot notification.
      * html/HTMLButtonElement.cpp:
      * html/HTMLButtonElement.h:
      * html/HTMLFormControlElement.cpp:
      * html/HTMLFormControlElement.h:
      * html/HTMLMediaElement.cpp:
      * html/HTMLMediaElement.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1326ee13
    • esprehn@chromium.org's avatar
      Element::areAuthorShadowsAllowed should be private · 161655ff
      esprehn@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=108298
      
      Reviewed by Darin Adler.
      
      There's no reason for areAuthorShadowsAllowed to be exposed publically
      on Element since it just controls the behavior of createShadowRoot. Make
      it private and fix all places where it wasn't in subclasses.
      
      No new tests, just refactoring.
      
      * dom/Element.h:
      (WebCore::Element::areAuthorShadowsAllowed): Made private.
      * html/HTMLFrameElementBase.h:
      (HTMLFrameElementBase):
      * html/HTMLInputElement.h:
      (HTMLInputElement):
      * html/HTMLMediaElement.h:
      (HTMLMediaElement):
      * html/HTMLPlugInElement.h:
      (HTMLPlugInElement):
      * svg/SVGElement.h:
      (SVGElement):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      161655ff
  12. 29 Jan, 2013 1 commit
    • esprehn@chromium.org's avatar
      Handle createShadowSubtree inside of ensureUserAgentShadowRoot · 933723d8
      esprehn@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=108116
      
      Reviewed by Dimitri Glazkov.
      
      Instead of making everyone create the UserAgentShadowRoot manually all
      over, centralize it in ensureUserAgentShadowRoot() and add a notification
      Element::didAddUserAgentShadowRoot that lets elements fill in the subtree.
      This lets us get rid of lots of code duplication.
      
      No new tests, just refactoring.
      
      * dom/Element.cpp:
      (WebCore::Element::ensureUserAgentShadowRoot):
      * dom/Element.h:
      (WebCore::Element::didAddUserAgentShadowRoot):
      (Element):
      * html/HTMLDetailsElement.cpp:
      (WebCore::DetailsSummaryElement::create):
      (WebCore::HTMLDetailsElement::create):
      (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):
      * html/HTMLDetailsElement.h:
      (HTMLDetailsElement):
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::create):
      (WebCore::HTMLInputElement::didAddUserAgentShadowRoot):
      * html/HTMLInputElement.h:
      (HTMLInputElement):
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::willAddAuthorShadowRoot):
      (WebCore::HTMLMediaElement::createMediaControls):
      * html/HTMLMediaElement.h:
      * html/HTMLMeterElement.cpp:
      (WebCore::HTMLMeterElement::create):
      (WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
      * html/HTMLMeterElement.h:
      (HTMLMeterElement):
      * html/HTMLProgressElement.cpp:
      (WebCore::HTMLProgressElement::create):
      (WebCore::HTMLProgressElement::didAddUserAgentShadowRoot):
      * html/HTMLProgressElement.h:
      * html/HTMLSummaryElement.cpp:
      (WebCore::HTMLSummaryElement::create):
      (WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot):
      * html/HTMLSummaryElement.h:
      (HTMLSummaryElement):
      * html/HTMLTextAreaElement.cpp:
      (WebCore::HTMLTextAreaElement::create):
      (WebCore::HTMLTextAreaElement::didAddUserAgentShadowRoot):
      * html/HTMLTextAreaElement.h:
      * html/shadow/MediaControlElements.cpp:
      (WebCore::MediaControlPanelMuteButtonElement::create):
      (WebCore::MediaControlVolumeSliderMuteButtonElement::create):
      (WebCore::MediaControlPlayButtonElement::create):
      (WebCore::MediaControlOverlayPlayButtonElement::create):
      (WebCore::MediaControlSeekForwardButtonElement::create):
      (WebCore::MediaControlSeekBackButtonElement::create):
      (WebCore::MediaControlRewindButtonElement::create):
      (WebCore::MediaControlReturnToRealtimeButtonElement::create):
      (WebCore::MediaControlToggleClosedCaptionsButtonElement::create):
      (WebCore::MediaControlTimelineElement::create):
      (WebCore::MediaControlPanelVolumeSliderElement::create):
      (WebCore::MediaControlFullscreenVolumeSliderElement::create):
      (WebCore::MediaControlFullscreenButtonElement::create):
      (WebCore::MediaControlFullscreenVolumeMinButtonElement::create):
      (WebCore::MediaControlFullscreenVolumeMaxButtonElement::create):
      * html/shadow/MediaControlsBlackBerry.cpp:
      (WebCore::MediaControlFullscreenPlayButtonElement::create):
      (WebCore::MediaControlFullscreenFullscreenButtonElement::create):
      (WebCore::MediaControlFullscreenTimelineElement::create):
      (WebCore::MediaControlAudioMuteButtonElement::create):
      * svg/SVGTRefElement.cpp:
      (WebCore::SVGTRefElement::create):
      * svg/SVGTRefElement.h:
      (SVGTRefElement):
      * svg/SVGUseElement.cpp:
      (WebCore::SVGUseElement::create):
      * svg/SVGUseElement.h:
      (SVGUseElement):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      933723d8
  13. 25 Jan, 2013 2 commits
    • 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
  14. 16 Jan, 2013 1 commit
    • jer.noble@apple.com's avatar
      Add a Setting to disable QTKit media engine. · e0fcb88a
      jer.noble@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=106972
      
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      Allow the MediaPlayerPrivateQTKit engine to be disabled by adding a
      runtime setting to Settings. Make the setting 'live' by requerying the
      installed media engines when the setting changes.
      
      * WebCore.exp.in: Add new symbols to export list.
      * page/Settings.cpp: Add new gQTKitEnabled global.
      (WebCore::Settings::setAVFoundationEnabled): Requery media engines.
      (WebCore::Settings::setQTKitEnabled): Ditto. Setter for global setting variable.
      * page/Settings.h:
      (WebCore::Settings::isQTKitEnabled): Getter for same.
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::installedMediaEngines): Check isQTKitEnabled() before adding
          MediaPlayerPrivateQTKit engine.
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::requeryMediaEngines): Pass through to MediaPlayer.
      * html/HTMLMediaElement.h:
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::installedMediaEngines): Take an optional requery options parameter.
      (WebCore::MediaPlayer::requeryMediaEngines): Pass through to installedMediaEngines().
      * platform/graphics/MediaPlayer.h:
      
      Source/WebKit/mac:
      
      Add WebKit API to set QTKit enabled setting from user defaults.
      
      * WebView/WebPreferenceKeysPrivate.h:
      * WebView/WebPreferences.mm:
      (+[WebPreferences initialize]): Set WebCore settings based on user defaults.
      (-[WebPreferences setQTKitEnabled:]): Pass through to WebCore.
      (-[WebPreferences isQTKitEnabled]): Ditto.
      * WebView/WebPreferencesPrivate.h:
      * WebView/WebView.mm:
      (-[WebView _preferencesChanged:]): Synchronize WebKit/WebCore settings.
      
      Source/WebKit2:
      
      Add a WebKit2 API to access WebCore QTKitEnabled settings.
      
      * Shared/WebPreferencesStore.h:
      * UIProcess/API/C/WKPreferences.cpp:
      (WKPreferencesSetQTKitEnabled): Pass through to WebCore.
      (WKPreferencesGetQTKitEnabled): Ditto.
      * UIProcess/API/C/WKPreferences.h:
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::updatePreferences): Synchronize WebKit2/WebCore settings.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e0fcb88a
  15. 02 Jan, 2013 1 commit
    • esprehn@chromium.org's avatar
      Clean up dispatchEvent overrides and overloads · f53e9e37
      esprehn@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=105959
      
      Reviewed by Adam Barth.
      
      Add OVERRIDE to all dispatchEvent overrides and use "using" instead of
      reimplementing EventTarget::dispatchEvent in subclasses where having the
      virtual override of dispatchEvent hides the overloads in
      the superclass.
      
      No new tests, just refactoring.
      
      * Modules/indexeddb/IDBDatabase.h:
      (IDBDatabase):
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBRequest.h:
      (IDBRequest):
      * Modules/indexeddb/IDBTransaction.h:
      (IDBTransaction):
      * dom/EventDispatchMediator.h:
      (FocusEventDispatchMediator):
      (BlurEventDispatchMediator):
      * dom/GestureEvent.h:
      (GestureEventDispatchMediator):
      * dom/KeyboardEvent.h:
      (KeyboardEventDispatchMediator):
      * dom/MouseEvent.h:
      * dom/Node.h:
      (Node):
      * dom/UIEvent.h:
      (FocusInEventDispatchMediator):
      (FocusOutEventDispatchMediator):
      * dom/WheelEvent.h:
      (WheelEventDispatchMediator):
      * html/HTMLMediaElement.h:
      * html/track/TextTrackCue.cpp:
      * html/track/TextTrackCue.h:
      (TextTrackCue):
      * page/DOMWindow.h:
      (DOMWindow):
      * svg/SVGElementInstance.h:
      (SVGElementInstance):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f53e9e37
  16. 19 Dec, 2012 1 commit
    • eric.carlson@apple.com's avatar
      Crash in TextTrack::trackIndexRelativeToRenderedTracks() · 716fecdb
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=105371
      
      Reviewed by Simon Fraser.
      
      Source/WebCore:
      
      Add an RAII object to manage text track update blocking, use it to always process the
      current cues to ensure that cues from a track that is deleted are removed from the
      shadow DOM before the next layout.
      
      No new tests, this fixes a crash in media/video-controls-captions-trackmenu.html.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::TrackDisplayUpdateScope::TrackDisplayUpdateScope): New, call beginIgnoringTrackDisplayUpdateRequests.
      (WebCore::TrackDisplayUpdateScope::~TrackDisplayUpdateScope): New, call endIgnoringTrackDisplayUpdateRequests.
      (WebCore::HTMLMediaElement::beginIgnoringTrackDisplayUpdateRequests):
      (WebCore::HTMLMediaElement::endIgnoringTrackDisplayUpdateRequests): Call updateActiveTextTrackCues
          when the ignore count reaches zero.
      (WebCore::HTMLMediaElement::textTrackAddCues): Use TrackDisplayUpdateScope instead of calling
          beginIgnoringTrackDisplayUpdateRequests and endIgnoringTrackDisplayUpdateRequests directly.
      (WebCore::HTMLMediaElement::textTrackRemoveCues): Ditto.
      (WebCore::HTMLMediaElement::removeTrack): Ditto.
      (WebCore::HTMLMediaElement::removeAllInbandTracks): Ditto.
      (WebCore::HTMLMediaElement::didRemoveTrack): Ditto. Call removeTrack.
      * html/HTMLMediaElement.h: Declare TrackDisplayUpdateScope as a friend of HTMLMediaElement so it
          can call protected methods.
      
      LayoutTests:
      
      * platform/mac/TestExpectations: Unskip video-controls-captions-trackmenu.html.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      716fecdb
  17. 16 Dec, 2012 1 commit
    • eric.carlson@apple.com's avatar
      Remove in-band text tracks when media element's src changes · b9acec69
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=105081
      
      Reviewed by Sam Weinig.
      
      Source/WebCore:
      
      No new tests, media/track/track-in-band.html was updated to test this change.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::mediaPlayerDidRemoveTrack): Move some code into removeTrack.
      (WebCore::HTMLMediaElement::removeTrack): New, remove a track and all of its cues.
      (WebCore::HTMLMediaElement::removeAllInbandTracks): New, remove all in-band tracks.
      (WebCore::HTMLMediaElement::clearMediaPlayer): Call removeAllInbandTracks.
      * html/HTMLMediaElement.h:
      
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
      (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
      (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Call clearTextTracks.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::clearTextTracks): Remove all tracks from client.
      
      LayoutTests:
      
      Extend test to verify that all in-band tracks are removed from the media element
      when its src changes.
      
      * media/track/track-in-band-expected.txt:
      * media/track/track-in-band.html:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137844 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b9acec69
  18. 14 Dec, 2012 2 commits
    • jer.noble@apple.com's avatar
      Allow the text track contents to be displayed externally to WebCore. · 365ce1be
      jer.noble@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=105052
      
      Reviewed by Eric Carlson.
      
      Support scenarios where the text track contents must be rendered outside of WebCore, such as to an external
      display or window.  Add an abstract base class which encapsulates the external representation to which the
      text tracks will be rendered.
      
      Add a new abstract base class and client to wrap the external rendering of a TextTrack.
      * platform/graphics/TextTrackRepresentation.h: Added.
      (WebCore::TextTrackRepresentationClient::~TextTrackRepresentationClient):
      (WebCore::TextTrackRepresentation::~TextTrackRepresentation):
      
      Add an empty concrete implementation for those ports who do not yet support external display of subtitles.
      * platform/graphics/TextTrackRepresentation.cpp: Added.
      (NullTextTrackRepresentation):
      (WebCore::NullTextTrackRepresentation::~NullTextTrackRepresentation):
      (WebCore::NullTextTrackRepresentation::update):
      (WebCore::NullTextTrackRepresentation::platformLayer):
      (WebCore::NullTextTrackRepresentation::setContentScale):
      (WebCore::NullTextTrackRepresentation::bounds):
      (WebCore::TextTrackRepresentation::create):
      
      Add methods to MediaPlayerPrivateIOS to handle the TextTrackRepresentation.
      * platform/graphics/ios/MediaPlayerPrivateIOS.h:
      * platform/graphics/ios/MediaPlayerPrivateIOS.mm:
      (WebCore::MediaPlayerPrivateIOS::deliverNotification): Remove the representation when exiting full screen.
      (WebCore::MediaPlayerPrivateIOS::requiresTextTrackRepresentation): Return YES if in full screen mode.
      (WebCore::MediaPlayerPrivateIOS::setTextTrackRepresentation): Pass the representation's layer to the player plug-in.
      
      Expose those methods via HTMLMediaElement:
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::requiresTextTrackRepresentation):
      (WebCore::HTMLMediaElement::setTextTrackRepresentation):
      * html/HTMLMediaElement.h:
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::MediaPlayer::requiresTextTrackRepresentation):
      (WebCore::MediaPlayer::setTextTrackRepresentation):
      * platform/graphics/MediaPlayer.h:
      (WebCore::MediaPlayerClient::textTrackRepresentationBoundsChanged):
      (WebCore::MediaPlayerClient::paintTextTrackRepresentation):
      * platform/graphics/MediaPlayerPrivate.h:
      (WebCore::MediaPlayerPrivateInterface::requiresTextTrackRepresentation):
      (WebCore::MediaPlayerPrivateInterface::setTextTrackRepresentation):
      
      * html/shadow/MediaControlElements.cpp:
      (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Create the representation, if necessary.
      (WebCore::MediaControlTextTrackContainerElement::updateSizes): Use the representation to determine the font size.
      (WebCore::MediaControlTextTrackContainerElement::paintTextTrackRepresentation): Added. Paint the TextTrack into the provided graphics context.
      (WebCore::MediaControlTextTrackContainerElement::textTrackRepresentationBoundsChanged): Added. Call updateSizes().
      * html/shadow/MediaControlElements.h:
      
      Add the new files to the project.
      * WebCore.xcodeproj/project.pbxproj:
      * GNUmakefile.list.am:
      * Target.pri:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137782 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      365ce1be
    • commit-queue@webkit.org's avatar
      EME v0.1: Report defaultURL in KeyMessage. · 1f3d706d
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=104284
      
      Patch by David Dorwin <ddorwin@chromium.org> on 2012-12-14
      Reviewed by Darin Fisher.
      
      Passes defaultURL down from the media engine to HTMLMediaElement.
      Only Valid URLs will be passed.
      
      No test because Clear Key does not provide a defaultURL (in v0.1).
      
      Source/WebCore:
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::mediaPlayerKeyMessage):
      * html/HTMLMediaElement.h:
      (HTMLMediaElement):
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::MediaPlayer::keyMessage):
      * platform/graphics/MediaPlayer.h:
      (WebCore::MediaPlayerClient::mediaPlayerKeyAdded):
      (WebCore::MediaPlayerClient::mediaPlayerKeyError):
      (WebCore::MediaPlayerClient::mediaPlayerKeyMessage):
      (WebCore::MediaPlayerClient::mediaPlayerKeyNeeded):
      (MediaPlayer):
      
      Source/WebKit/chromium:
      
      * public/WebMediaPlayerClient.h:
      * src/WebMediaPlayerClientImpl.cpp:
      (WebKit::WebMediaPlayerClientImpl::keyMessage):
      (WebKit):
      (WebKit::WebMediaPlayerClient::keyMessage):
      * src/WebMediaPlayerClientImpl.h:
      (WebMediaPlayerClientImpl):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1f3d706d
  19. 10 Dec, 2012 1 commit
    • eric.carlson@apple.com's avatar
      Add support for in-band text tracks to Mac port · 134ccfc9
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=103663
      
      Reviewed by Sam Weinig.
      
      Source/WebCore: 
      
      Test: media/track/track-in-band.html
      
      * GNUmakefile.list.am: Move InbandTextTrackPrivate.h to platform/graphics. Add InbandTextTrackPrivateClient.h.
      * Target.pri: Ditto.
      * WebCore.gypi: Ditto.
      
      * WebCore.xcodeproj/project.pbxproj: Add new files.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::setReadyState): No need to call processInbandTextTracks, in-band tracks
          are now registered by the media engine as they are discovered.
      (WebCore::HTMLMediaElement::mediaPlayerDidAddTrack): New, called by the media player when a new
          in-band track is found.
      (WebCore::HTMLMediaElement::mediaPlayerDidRemoveTrack): New, called by the media player when an
          in-band track goes away.
      * html/HTMLMediaElement.h:
      
      * html/track/InbandTextTrack.cpp:
      (WebCore::InbandTextTrack::InbandTextTrack): Use m_private instead of tracksPrivate because
          it is zeroed during assignment.
      
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::MediaPlayer::addTextTrack): New MediaPlayerClient method to allow MediaPlayerPrivate subclasses
          to add a new in-band track.
      (WebCore::MediaPlayer::removeTextTrack): New MediaPlayerClient method to allow MediaPlayerPrivate subclasses
          to remove a new in-band track.
      * platform/graphics/MediaPlayer.h:
      * platform/graphics/MediaPlayerPrivate.h:
      
      * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: Added.
      (WebCore::InbandTextTrackPrivateAVF::InbandTextTrackPrivateAVF):
      (WebCore::InbandTextTrackPrivateAVF::~InbandTextTrackPrivateAVF):
      (WebCore::InbandTextTrackPrivateAVF::processCueAttributes): Convert an attribute string into WebVTT 
          cue setting and content strings.
      (WebCore::InbandTextTrackPrivateAVF::processCue): Process a new cue.
      (WebCore::InbandTextTrackPrivateAVF::disconnect): Clear member variables.
      (WebCore::InbandTextTrackPrivateAVF::resetCueValues): Reset cue values to defaults.
      (WebCore::InbandTextTrackPrivateAVF::setMode): Set track mode and call player's trackModeChanged.
      * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: Added.
      
      * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: Initialize 
          m_inbandTrackConfigurationPending.
      (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
      (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted): Flush the currently accumulating
          cue so it doesn't get the wrong duration.
      (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification): Handle InbandTracksNeedConfiguration.
      (WebCore::MediaPlayerPrivateAVFoundation::flushCurrentCue): New, pass the current cue up to the client.
      (WebCore::MediaPlayerPrivateAVFoundation::configureInbandTracks): Configure in-band tracks.
      (WebCore::MediaPlayerPrivateAVFoundation::trackModeChanged): Schedule a call to configureInbandTracks.
      * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
      
      * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h: Added.
      * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: Added.
      (WebCore::InbandTextTrackPrivateAVFObjC::InbandTextTrackPrivateAVFObjC):
      (WebCore::InbandTextTrackPrivateAVFObjC::disconnect):
      (WebCore::InbandTextTrackPrivateAVFObjC::kind): Return track kind.
      (WebCore::InbandTextTrackPrivateAVFObjC::label): Return track label.
      (WebCore::InbandTextTrackPrivateAVFObjC::language): Return track language.
      (WebCore::InbandTextTrackPrivateAVFObjC::isDefault): 
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
      (MediaPlayerPrivateAVFoundationObjC):
      (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItem):
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
      (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Initialize m_currentTrack.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Clear m_legibleOutput.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Create and initialize m_legibleOutput.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::processTextTracks): Called when the player item's
          "tracks" changes, add and remove in-band text tracks as necessary.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): Pass an attributed string to the current 
          track to be processed.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTrack): Tell AVFoundation to select an in-band track.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::currentTrack): Return the current track.
      (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]): Legible
          output delegate.
      
      Source/WTF: 
      
      * wtf/Platform.h: Define HAVE_AVFOUNDATION_TEXT_TRACK_SUPPORT.
      
      LayoutTests: 
      
      Test for initial support for in-band text tracks. New test skipped on all ports that don't 
      have support in the media engine.
      
      * media/content/counting-subtitled.m4v: Added.
      * media/track/track-in-band-expected.txt: Added.
      * media/track/track-in-band.html: Added.
      * platform/chromium/TestExpectations:
      * platform/efl/TestExpectations:
      * platform/gtk/TestExpectations:
      * platform/mac/TestExpectations:
      * platform/qt/TestExpectations:
      * platform/win/TestExpectations:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      134ccfc9
  20. 04 Dec, 2012 1 commit
    • commit-queue@webkit.org's avatar
      Refactor Media Control Elements to remove code duplication. · a1cafe0a
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=101877
      
      Patch by Silvia Pfeiffer <silviapf@chromium.org> on 2012-12-04
      Reviewed by Eric Carlson.
      
      Instead of having two different types of inheritance trees for
      MediaControlElement and MediaControlInputElement, this
      creates a stand-alone virtual class MediaControlElement that
      provides the common functions: show(), hide(), isShowing(),
      setMediaController(), displayType(), isMediaControlElement(),
      shadowPseudoId(), mediaController(), setDisplayType().
      
      The individual elements inherit from MediaControlElement and
      either HTMLInputElement or HTMLDivElement. They extend/override
      the base functions as appropriate.
      
      As part of this, the RenderXXX classes mixed in between the media
      controls in MediaControlElements.cpp are also moved to
      rendering/RenderMediaControls.h/cpp to follow common code separation.
      
      No new tests since this is just a refactoring.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * Target.pri:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      Build files extended with new files.
      
      * html/HTMLMediaElement.h:
      (WebCore::HTMLMediaElement::textTracksIndexNotFound):
      Replaced const with function, since it is used in multiple files.
      
      * html/shadow/MediaControlElementTypes.cpp: new file
      * html/shadow/MediaControlElementTypes.h: new file
      Added new MediaControlElement class. Moved MediaControlDivElement and MediaControlInputElement
      classes into these files from MediaControlElements.cpp/h. Moved MediaControlElementTypes enum
      into these. Moved other media control element classes that are the basis for inheriting media
      control elements into these (MediaControlTimeDisplayElement, MediaControlMuteButtonElement,
      MediaControlSeekButtonElement, MediaControlVolumeSliderElement).
      
      * html/shadow/MediaControlElements.cpp:
      * html/shadow/MediaControlElements.h:
      Removed common functions between media elements that are now in the common
      base class MediaControlElement.
      Also moved common base classes to MediaControlElementTypes.h/cpp
      
      * html/shadow/MediaControls.cpp:
      * html/shadow/MediaControls.h:
      Renamed MediaControlVolumeSliderElement to MediaControlPanelVolumeSliderElement
      to be consistent in inheritance tree. Updated copyright date.
      
      * html/shadow/MediaControlsApple.cpp:
      * html/shadow/MediaControlsApple.h:
      Renamed MediaControlVolumeSliderElement to MediaControlPanelVolumeSliderElement
      to be consistent in inheritance tree. Updated copyright dates.n
      
      * html/shadow/MediaControlsChromium.cpp:
      * html/shadow/MediaControlsChromium.h:
      Renamed MediaControlVolumeSliderElement to MediaControlPanelVolumeSliderElement
      to be consistent in inheritance tree.
      Moved enclosure element definitions to common MediaControlElements.cpp/h
      file through which different media elements are made available to different ports.
      
      * html/shadow/MediaControlsChromiumAndroid.cpp:
      * html/shadow/MediaControlsChromiumAndroid.h:
      Moved enclosure for overlay button to MediaControlElements.cpp/h files
      through which different media elements are made available to different ports.
      
      * rendering/RenderMediaControlElements.cpp: new file
      * rendering/RenderMediaControlElements.h: new file
      Moved rendering classes for media control elements into these files from
      MediaControlElements.cpp/h.
      
      * rendering/RenderThemeMac.mm:
      Added new RenderMediaControlElements.h file.
      
      * rendering/RenderingAllInOne.cpp:
      Added new RenderMediaControlEleemnt.cpp file.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a1cafe0a
  21. 29 Nov, 2012 1 commit
    • morrita@google.com's avatar
      Source/WebCore: HTMLMediaElement's .textTracks property does not reflect <track> element · 9db3c4a5
      morrita@google.com authored
      https://bugs.webkit.org/show_bug.cgi?id=103420
      
      Reviewed by Eric Carlson.
      
      There were some assumptions that <track> elements are valid only
      if the parent <media> is in document. This change relaxes this
      assumption so that <track> is valid when it has <media> as a
      parent regardless whether the <media> is in the document or not.
      
      HTMLMediaElement::didAddTrack and didRemoveTrack are now called
      when the <track> is inserted to or removed from the parent <media>
      element.
      
      Test: media/track/track-node-add-remove.html
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::didRemoveTrack):
      Renamed from willRemoveTrack() to reflect the timing. This was once called from
      Node::willRemove(), which was removed a while ago.
      * html/HTMLMediaElement.h:
      (HTMLMediaElement):
      * html/HTMLTrackElement.cpp:
      (WebCore::HTMLTrackElement::insertedInto):
      The old code notified parent <media> only if the subtree became a part of the document.
      Now it notifies the <media> when this <track> becomes a child of that <media>.
      
      (WebCore::HTMLTrackElement::removedFrom):
      The old code notifies the parent <media> every time as long as the parent is available.
      Now it notifies the <media> only if this <track> is removed from the parent <media>.
      This matches how corresponding notification is done in insertedInto().
      
      * html/track/LoadableTextTrack.cpp:
      (WebCore::LoadableTextTrack::trackElementIndex):
      
      LayoutTests: HTMLMediaElement's .textTracks property does not reflect <track> element
      https://bugs.webkit.org/show_bug.cgi?id=103420
      
      Reviewed by Eric Carlson.
      
      * media/track/track-node-add-remove-expected.txt: Added.
      * media/track/track-node-add-remove.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136131 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9db3c4a5
  22. 27 Nov, 2012 2 commits
    • dino@apple.com's avatar
      Make track list control active · acacedaf
      dino@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=101670
      
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      Hook up the event handler for the captions menu so that it enables or
      disables tracks in the associated HTMLMediaElement.
      
      Test: media/video-controls-captions-trackmenu.html
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::toggleTrackAtIndex): New method to toggle the state of a track, by index.
      * html/HTMLMediaElement.h:
      (HTMLMediaElement): Ditto.
      (WebCore::HTMLMediaElement::textTracksOffIndex): Static method to return the "Off" value.
      * html/shadow/MediaControlElements.cpp:
      (WebCore::trackListIndexForElement): Helper function to take a track list <li> element and return the value of the custom attribute.
      (WebCore::MediaControlToggleClosedCaptionsButtonElement::updateDisplayType): Toggle the state of the button based on captions visibility.
      (WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler): On Mac platforms show the captions menu. On other platforms, toggle captions.
      (WebCore::MediaControlClosedCaptionsTrackListElement::MediaControlClosedCaptionsTrackListElement): Now has a reference to the controls.
      (WebCore::MediaControlClosedCaptionsTrackListElement::create):
      (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler): When the user clicks on a track list item, look
      for the custom attribute that identifies the associated track, and then toggle that track.
      (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Set a class on the track list elements so they can be
      styled by the injected CSS (with tick marks to represent visibility).
      (WebCore::MediaControlClosedCaptionsTrackListElement::resetTrackListMenu): When building the list of track menu items, add
      a custom HTML attribute to the element so that the corresponding track can be found in the event handler.
      * html/shadow/MediaControlElements.h:
      (MediaControlClosedCaptionsTrackListElement): Add a list of elements representing the track list.
      * html/shadow/MediaControlsApple.cpp:
      (WebCore::MediaControlsApple::createControls):
      (WebCore::MediaControlsApple::changedClosedCaptionsVisibility): Make sure to update the track menu.
      (WebCore::MediaControlsApple::reset):
      * html/shadow/MediaControlsApple.h:
      (MediaControlsApple):
      
      LayoutTests:
      
      New test that exercises the track list menu, and how it can be used
      to enable specific tracks. Since this is only enabled for Mac, it is
      skipped on all other platforms.
      
      Meanwhile, the existing test for a on/off captions button now
      does not work on Mac, so skip it there. I copied the functionality
      into the new test so we still have coverage.
      
      * media/video-controls-captions-trackmenu-expected.txt: Added.
      * media/video-controls-captions-trackmenu.html: Added.
      * platform/chromium/TestExpectations:
      * platform/efl/TestExpectations:
      * platform/gtk/TestExpectations:
      * platform/mac/TestExpectations:
      * platform/qt/TestExpectations:
      * platform/win/TestExpectations:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      acacedaf
    • dino@apple.com's avatar
      No need for ExceptionCode in HTMLMediaElement::load · 2d918bac
      dino@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=103438
      
      Reviewed by Eric Carlson.
      
      After https://bugs.webkit.org/show_bug.cgi?id=103318, there is no
      need for the ExceptionCode parameter in load(). The HTML5 spec says
      that all errors in loading are communicated via state.
      http://dev.w3.org/html5/spec/media-elements.html#dom-media-load
      
      Of the 29 tests exercising load(), none of them were exercising
      exceptions (obviously).
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::load):
      (WebCore::HTMLMediaElement::resume):
      * html/HTMLMediaElement.h:
      * html/HTMLMediaElement.idl:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2d918bac
  23. 21 Nov, 2012 2 commits
    • eric.carlson@apple.com's avatar
      In-band text tracks infrastructure · 243e33e9
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=102830
      
      Reviewed by Philippe Normand.
      
      Add the infrastructure necessary to allow a port-specific media engine to expose in-band text
      tracks.
      
      No new tests, this patch only adds plumbing. Existing tests verify that these changes don't
      break existing functionality.
      
      * CMakeLists.txt: Add new project files.
      * GNUmakefile.list.am: Ditto.
      * Target.pri: Ditto.
      * WebCore.gypi: Ditto.
      * WebCore.xcodeproj/project.pbxproj: Ditto.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::setReadyState): Call processInbandTextTracks when readyState reaches
          HAVE_METADATA
      (WebCore::HTMLMediaElement::processInbandTextTracks): Fetch the in-band text tracks from the 
          media player and processes them.
      * html/HTMLMediaElement.h:
      
      * html/track/InbandTextTrack.cpp: Added.
      * html/track/InbandTextTrack.h: Added.
      * html/track/InbandTextTrackPrivate.h: Added.
      
      * html/track/TextTrack.h:
      (TextTrack):
      (WebCore::TextTrack::clearClient): Remove virtual, it is unnecessary
      (WebCore::TextTrack::mode): Make virtual so derived classes can override.
      (WebCore::TextTrack::setMode): Ditto.
      
      * html/track/TextTrackList.cpp:
      (TextTrackList::length): Update to deal with in-band tracks.
      (TextTrackList::getTrackIndex): Ditto.
      (TextTrackList::getTrackIndexRelativeToRenderedTracks): Ditto.
      (TextTrackList::item): Ditto.
      (TextTrackList::invalidateTrackIndexesAfterTrack): New, invalidate the cached track indexes of
          all tracks after another.
      (TextTrackList::append): Update to deal with in-band tracks.
      (TextTrackList::remove): Update to deal with in-band tracks.
      (TextTrackList::scheduleAddTrackEvent): Remove typo.
      * html/track/TextTrackList.h:
      
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::MediaPlayer::getTextTracks): New, pass through to the media engine.
      (WebCore::MediaPlayer::setTextTrackClient):
      * platform/graphics/MediaPlayer.h:
      
      * platform/graphics/MediaPlayerPrivate.h:
      (WebCore::MediaPlayerPrivateInterface::setPreload): Cleanup.
      (WebCore::MediaPlayerPrivateInterface::sourceEndOfStream): Ditto.
      (WebCore::MediaPlayerPrivateInterface::getTextTracks): New client method.
      (WebCore::MediaPlayerPrivateInterface::setTextTrackClient): Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      243e33e9
    • loislo@chromium.org's avatar
      Web Inspector: NMI add instrumentation to widely used ActiveDOMObjects.... · 08cddc42
      loislo@chromium.org authored
      Web Inspector: NMI add instrumentation to widely used ActiveDOMObjects. XMLHttpRequest, Prerenderer, HTMLMediaElement and DOMTimer.
      https://bugs.webkit.org/show_bug.cgi?id=102818
      
      Reviewed by Vsevolod Vlasov.
      
      Our test bot counts pointers which don't match with objects allocated by tcmalloc.
      This counter becomes nonzero after instrumenting ActiveDOMObject class.
      It happens because it is the base class for many other classes (~30).
      And almost all these classes use multiple inheritance.
      
      * dom/Document.cpp:
      (WebCore::Document::reportMemoryUsage):
      * dom/DocumentEventQueue.cpp:
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::reportMemoryUsage):
      (WebCore):
      * html/HTMLMediaElement.h:
      * loader/Prerenderer.cpp:
      (WebCore::Prerenderer::reportMemoryUsage):
      (WebCore):
      * loader/Prerenderer.h:
      (Prerenderer):
      * page/DOMTimer.cpp:
      (WebCore::DOMTimer::reportMemoryUsage):
      (WebCore):
      * page/DOMTimer.h:
      (DOMTimer):
      * xml/XMLHttpRequest.cpp:
      (WebCore::XMLHttpRequest::reportMemoryUsage):
      (WebCore):
      * xml/XMLHttpRequest.h:
      (XMLHttpRequest):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      08cddc42
  24. 19 Nov, 2012 1 commit
    • eric.carlson@apple.com's avatar
      HTMLMediaElement::configureTextTracks should configure all text tracks · b41ea939
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=102561
      
      Reviewed by Philippe Normand.
      
      Source/WebCore:
      
      No new tests, track-mode-not-changed-by-new-track.html was updated to test the changes.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::textTrackModeChanged): HTMLTrackElement -> TextTrack.
      (WebCore::HTMLMediaElement::willRemoveTrack): Ditto.
      (WebCore::HTMLMediaElement::configureTextTrackGroup): Ditto.
      (WebCore::HTMLMediaElement::configureTextTracks): Ditto.
      (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): Ditto.
      * html/HTMLMediaElement.h:
      
      * html/HTMLTrackElement.cpp:
      (WebCore::HTMLTrackElement::HTMLTrackElement): Move hasBeenConfigured down to TextTrack.
      (WebCore::HTMLTrackElement::parseAttribute): isDefault is stored on TextTrack.
      (WebCore::HTMLTrackElement::ensureTrack): LoadableTextTrack constructor doesn't take
          "default" argument.
      * html/HTMLTrackElement.h:
      
      * html/track/LoadableTextTrack.cpp:
      (WebCore::LoadableTextTrack::LoadableTextTrack): Initialize m_isDefault to false.
      * html/track/LoadableTextTrack.h:
      (WebCore::TextTrack::isDefault): Override base class implementation, because a track element
          can be flagged as default.
      (WebCore::TextTrack::setIsDefault): Ditto.
      
      * html/track/TextTrack.cpp:
      (WebCore::TextTrack::TextTrack): Initialize m_hasBeenConfigured.
      * html/track/TextTrack.h:
      (WebCore::TextTrack::hasBeenConfigured): New, moved from HTMLTrackElement so other code doesn't
          need know what type of track it is calling.
      (WebCore::TextTrack::setHasBeenConfigured): Ditto.
      (WebCore::TextTrack::isDefault): Base, do nothing, implementation because only LoadableTextTrack
          can be "default".
      (WebCore::TextTrack::setIsDefault): Ditto.
      
      LayoutTests:
      
      Update test and results to check that dynamically added tracks are configured correctly.
      
      * media/track/track-mode-not-changed-by-new-track-expected.txt:
      * media/track/track-mode-not-changed-by-new-track.html:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b41ea939
  25. 18 Nov, 2012 1 commit
    • akling@apple.com's avatar
      Element::parseAttribute() should take name & value as separate arguments. · 43e9d04c
      akling@apple.com authored
      <http://webkit.org/b/102608>
      
      Reviewed by Antti Koivisto.
      
      Update the signature of parseAttribute() to take a QualifiedName/AtomicString combo instead
      of an Attribute. This lets us pass avoid refcount churn in Element::attributeChanged() since
      creating a temporary Attribute is no longer necessary.
      
      This was surprisingly hot (~1%) on the DOM/CreateNodes performance test.
      
      * bindings/js/ScriptEventListener.cpp:
      (WebCore::createAttributeEventListener):
      * bindings/js/ScriptEventListener.h:
      (WebCore):
      * bindings/v8/ScriptEventListener.cpp:
      (WebCore::createAttributeEventListener):
      * bindings/v8/ScriptEventListener.h:
      (WebCore):
      * dom/Element.cpp:
      (WebCore::Element::attributeChanged):
      (WebCore::Element::parseAttribute):
      * dom/Element.h:
      (Element):
      * dom/StyledElement.cpp:
      (WebCore::StyledElement::parseAttribute):
      * dom/StyledElement.h:
      (StyledElement):
      * html/HTMLAnchorElement.cpp:
      (WebCore::HTMLAnchorElement::parseAttribute):
      * html/HTMLAnchorElement.h:
      (HTMLAnchorElement):
      * html/HTMLAppletElement.cpp:
      (WebCore::HTMLAppletElement::parseAttribute):
      * html/HTMLAppletElement.h:
      (HTMLAppletElement):
      * html/HTMLAreaElement.cpp:
      (WebCore::HTMLAreaElement::parseAttribute):
      * html/HTMLAreaElement.h:
      (HTMLAreaElement):
      * html/HTMLBaseElement.cpp:
      (WebCore::HTMLBaseElement::parseAttribute):
      * html/HTMLBaseElement.h:
      (HTMLBaseElement):
      * html/HTMLBodyElement.cpp:
      (WebCore::HTMLBodyElement::parseAttribute):
      * html/HTMLBodyElement.h:
      (HTMLBodyElement):
      * html/HTMLButtonElement.cpp:
      (WebCore::HTMLButtonElement::parseAttribute):
      * html/HTMLButtonElement.h:
      * html/HTMLCanvasElement.cpp:
      (WebCore::HTMLCanvasElement::parseAttribute):
      * html/HTMLCanvasElement.h:
      (HTMLCanvasElement):
      * html/HTMLDetailsElement.cpp:
      (WebCore::HTMLDetailsElement::parseAttribute):
      * html/HTMLDetailsElement.h:
      (HTMLDetailsElement):
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::parseAttribute):
      (WebCore::HTMLElement::dirAttributeChanged):
      * html/HTMLElement.h:
      (HTMLElement):
      * html/HTMLEmbedElement.cpp:
      (WebCore::HTMLEmbedElement::parseAttribute):
      * html/HTMLEmbedElement.h:
      (HTMLEmbedElement):
      * html/HTMLFormControlElement.cpp:
      (WebCore::HTMLFormControlElement::parseAttribute):
      * html/HTMLFormControlElement.h:
      (HTMLFormControlElement):
      * html/HTMLFormElement.cpp:
      (WebCore::HTMLFormElement::parseAttribute):
      * html/HTMLFormElement.h:
      (HTMLFormElement):
      * html/HTMLFrameElement.cpp:
      (WebCore::HTMLFrameElement::parseAttribute):
      * html/HTMLFrameElement.h:
      (HTMLFrameElement):
      * html/HTMLFrameElementBase.cpp:
      (WebCore::HTMLFrameElementBase::parseAttribute):
      * html/HTMLFrameElementBase.h:
      (HTMLFrameElementBase):
      * html/HTMLFrameSetElement.cpp:
      (WebCore::HTMLFrameSetElement::parseAttribute):
      * html/HTMLFrameSetElement.h:
      (HTMLFrameSetElement):
      * html/HTMLIFrameElement.cpp:
      (WebCore::HTMLIFrameElement::parseAttribute):
      * html/HTMLIFrameElement.h:
      (HTMLIFrameElement):
      * html/HTMLImageElement.cpp:
      (WebCore::HTMLImageElement::parseAttribute):
      * html/HTMLImageElement.h:
      (HTMLImageElement):
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::parseAttribute):
      (WebCore::HTMLInputElement::parseMaxLengthAttribute):
      * html/HTMLInputElement.h:
      (HTMLInputElement):
      * html/HTMLKeygenElement.cpp:
      (WebCore::HTMLKeygenElement::parseAttribute):
      * html/HTMLKeygenElement.h:
      (HTMLKeygenElement):
      * html/HTMLLIElement.cpp:
      (WebCore::HTMLLIElement::parseAttribute):
      * html/HTMLLIElement.h:
      (HTMLLIElement):
      * html/HTMLLinkElement.cpp:
      (WebCore::HTMLLinkElement::parseAttribute):
      * html/HTMLLinkElement.h:
      (HTMLLinkElement):
      * html/HTMLMapElement.cpp:
      (WebCore::HTMLMapElement::parseAttribute):
      * html/HTMLMapElement.h:
      (HTMLMapElement):
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::parseAttribute):
      * html/HTMLMediaElement.h:
      * html/HTMLMetaElement.cpp:
      (WebCore::HTMLMetaElement::parseAttribute):
      * html/HTMLMetaElement.h:
      (HTMLMetaElement):
      * html/HTMLMeterElement.cpp:
      (WebCore::HTMLMeterElement::parseAttribute):
      * html/HTMLMeterElement.h:
      (HTMLMeterElement):
      * html/HTMLOListElement.cpp:
      (WebCore::HTMLOListElement::parseAttribute):
      * html/HTMLOListElement.h:
      (HTMLOListElement):
      * html/HTMLObjectElement.cpp:
      (WebCore::HTMLObjectElement::parseAttribute):
      * html/HTMLObjectElement.h:
      (HTMLObjectElement):
      * html/HTMLOptGroupElement.cpp:
      (WebCore::HTMLOptGroupElement::parseAttribute):
      * html/HTMLOptGroupElement.h:
      * html/HTMLOptionElement.cpp:
      (WebCore::HTMLOptionElement::parseAttribute):
      * html/HTMLOptionElement.h:
      (HTMLOptionElement):
      * html/HTMLOutputElement.cpp:
      (WebCore::HTMLOutputElement::parseAttribute):
      * html/HTMLOutputElement.h:
      (HTMLOutputElement):
      * html/HTMLProgressElement.cpp:
      (WebCore::HTMLProgressElement::parseAttribute):
      * html/HTMLProgressElement.h:
      * html/HTMLScriptElement.cpp:
      (WebCore::HTMLScriptElement::parseAttribute):
      * html/HTMLScriptElement.h:
      (HTMLScriptElement):
      * html/HTMLSelectElement.cpp:
      (WebCore::HTMLSelectElement::parseAttribute):
      (WebCore::HTMLSelectElement::parseMultipleAttribute):
      * html/HTMLSelectElement.h:
      * html/HTMLStyleElement.cpp:
      (WebCore::HTMLStyleElement::parseAttribute):
      * html/HTMLStyleElement.h:
      (HTMLStyleElement):
      * html/HTMLTableCellElement.cpp:
      (WebCore::HTMLTableCellElement::parseAttribute):
      * html/HTMLTableCellElement.h:
      (HTMLTableCellElement):
      * html/HTMLTableColElement.cpp:
      (WebCore::HTMLTableColElement::parseAttribute):
      * html/HTMLTableColElement.h:
      (HTMLTableColElement):
      * html/HTMLTableElement.cpp:
      (WebCore::HTMLTableElement::parseAttribute):
      * html/HTMLTableElement.h:
      (HTMLTableElement):
      * html/HTMLTextAreaElement.cpp:
      (WebCore::HTMLTextAreaElement::parseAttribute):
      * html/HTMLTextAreaElement.h:
      (HTMLTextAreaElement):
      * html/HTMLTextFormControlElement.cpp:
      (WebCore::HTMLTextFormControlElement::parseAttribute):
      * html/HTMLTextFormControlElement.h:
      (HTMLTextFormControlElement):
      * html/HTMLTrackElement.cpp:
      (WebCore::HTMLTrackElement::parseAttribute):
      * html/HTMLTrackElement.h:
      (HTMLTrackElement):
      * html/HTMLVideoElement.cpp:
      (WebCore::HTMLVideoElement::parseAttribute):
      * html/HTMLVideoElement.h:
      (HTMLVideoElement):
      * html/shadow/HTMLContentElement.cpp:
      (WebCore::HTMLContentElement::parseAttribute):
      * html/shadow/HTMLContentElement.h:
      (HTMLContentElement):
      * mathml/MathMLElement.cpp:
      (WebCore::MathMLElement::parseAttribute):
      * mathml/MathMLElement.h:
      (MathMLElement):
      * svg/SVGAElement.cpp:
      (WebCore::SVGAElement::parseAttribute):
      * svg/SVGAElement.h:
      (SVGAElement):
      * svg/SVGAnimateMotionElement.cpp:
      (WebCore::SVGAnimateMotionElement::parseAttribute):
      * svg/SVGAnimateMotionElement.h:
      (SVGAnimateMotionElement):
      * svg/SVGAnimateTransformElement.cpp:
      (WebCore::SVGAnimateTransformElement::parseAttribute):
      * svg/SVGAnimateTransformElement.h:
      (SVGAnimateTransformElement):
      * svg/SVGAnimationElement.cpp:
      (WebCore::SVGAnimationElement::parseAttribute):
      * svg/SVGAnimationElement.h:
      (SVGAnimationElement):
      * svg/SVGCircleElement.cpp:
      (WebCore::SVGCircleElement::parseAttribute):
      * svg/SVGCircleElement.h:
      (SVGCircleElement):
      * svg/SVGClipPathElement.cpp:
      (WebCore::SVGClipPathElement::parseAttribute):
      * svg/SVGClipPathElement.h:
      (SVGClipPathElement):
      * svg/SVGComponentTransferFunctionElement.cpp:
      (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
      * svg/SVGComponentTransferFunctionElement.h:
      (SVGComponentTransferFunctionElement):
      * svg/SVGCursorElement.cpp:
      (WebCore::SVGCursorElement::parseAttribute):
      * svg/SVGCursorElement.h:
      (SVGCursorElement):
      * svg/SVGElement.cpp:
      (WebCore::SVGElement::reportAttributeParsingError):
      (WebCore::SVGElement::parseAttribute):
      * svg/SVGElement.h:
      (SVGElement):
      * svg/SVGEllipseElement.cpp:
      (WebCore::SVGEllipseElement::parseAttribute):
      * svg/SVGEllipseElement.h:
      (SVGEllipseElement):
      * svg/SVGExternalResourcesRequired.cpp:
      (WebCore::SVGExternalResourcesRequired::parseAttribute):
      * svg/SVGExternalResourcesRequired.h:
      (SVGExternalResourcesRequired):
      * svg/SVGFEBlendElement.cpp:
      (WebCore::SVGFEBlendElement::parseAttribute):
      * svg/SVGFEBlendElement.h:
      (SVGFEBlendElement):
      * svg/SVGFEColorMatrixElement.cpp:
      (WebCore::SVGFEColorMatrixElement::parseAttribute):
      * svg/SVGFEColorMatrixElement.h:
      (SVGFEColorMatrixElement):
      * svg/SVGFEComponentTransferElement.cpp:
      (WebCore::SVGFEComponentTransferElement::parseAttribute):
      * svg/SVGFEComponentTransferElement.h:
      (SVGFEComponentTransferElement):
      * svg/SVGFECompositeElement.cpp:
      (WebCore::SVGFECompositeElement::parseAttribute):
      * svg/SVGFECompositeElement.h:
      (SVGFECompositeElement):
      * svg/SVGFEConvolveMatrixElement.cpp:
      (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
      * svg/SVGFEConvolveMatrixElement.h:
      (SVGFEConvolveMatrixElement):
      * svg/SVGFEDiffuseLightingElement.cpp:
      (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
      * svg/SVGFEDiffuseLightingElement.h:
      (SVGFEDiffuseLightingElement):
      * svg/SVGFEDisplacementMapElement.cpp:
      (WebCore::SVGFEDisplacementMapElement::parseAttribute):
      * svg/SVGFEDisplacementMapElement.h:
      (SVGFEDisplacementMapElement):
      * svg/SVGFEDropShadowElement.cpp:
      (WebCore::SVGFEDropShadowElement::parseAttribute):
      * svg/SVGFEDropShadowElement.h:
      (SVGFEDropShadowElement):
      * svg/SVGFEGaussianBlurElement.cpp:
      (WebCore::SVGFEGaussianBlurElement::parseAttribute):
      * svg/SVGFEGaussianBlurElement.h:
      (SVGFEGaussianBlurElement):
      * svg/SVGFEImageElement.cpp:
      (WebCore::SVGFEImageElement::parseAttribute):
      * svg/SVGFEImageElement.h:
      (SVGFEImageElement):
      * svg/SVGFELightElement.cpp:
      (WebCore::SVGFELightElement::parseAttribute):
      * svg/SVGFELightElement.h:
      (SVGFELightElement):
      * svg/SVGFEMergeNodeElement.cpp:
      (WebCore::SVGFEMergeNodeElement::parseAttribute):
      * svg/SVGFEMergeNodeElement.h:
      (SVGFEMergeNodeElement):
      * svg/SVGFEMorphologyElement.cpp:
      (WebCore::SVGFEMorphologyElement::parseAttribute):
      * svg/SVGFEMorphologyElement.h:
      (SVGFEMorphologyElement):
      * svg/SVGFEOffsetElement.cpp:
      (WebCore::SVGFEOffsetElement::parseAttribute):
      * svg/SVGFEOffsetElement.h:
      (SVGFEOffsetElement):
      * svg/SVGFESpecularLightingElement.cpp:
      (WebCore::SVGFESpecularLightingElement::parseAttribute):
      * svg/SVGFESpecularLightingElement.h:
      (SVGFESpecularLightingElement):
      * svg/SVGFETileElement.cpp:
      (WebCore::SVGFETileElement::parseAttribute):
      * svg/SVGFETileElement.h:
      (SVGFETileElement):
      * svg/SVGFETurbulenceElement.cpp:
      (WebCore::SVGFETurbulenceElement::parseAttribute):
      * svg/SVGFETurbulenceElement.h:
      (SVGFETurbulenceElement):
      * svg/SVGFilterElement.cpp:
      (WebCore::SVGFilterElement::parseAttribute):
      * svg/SVGFilterElement.h:
      (SVGFilterElement):
      * svg/SVGFilterPrimitiveStandardAttributes.cpp:
      (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
      * svg/SVGFilterPrimitiveStandardAttributes.h:
      (SVGFilterPrimitiveStandardAttributes):
      * svg/SVGFitToViewBox.h:
      (WebCore::SVGFitToViewBox::parseAttribute):
      * svg/SVGFontFaceElement.cpp:
      (WebCore::SVGFontFaceElement::parseAttribute):
      * svg/SVGFontFaceElement.h:
      (SVGFontFaceElement):
      * svg/SVGFontFaceUriElement.cpp:
      (WebCore::SVGFontFaceUriElement::parseAttribute):
      * svg/SVGFontFaceUriElement.h:
      (SVGFontFaceUriElement):
      * svg/SVGForeignObjectElement.cpp:
      (WebCore::SVGForeignObjectElement::parseAttribute):
      * svg/SVGForeignObjectElement.h:
      (SVGForeignObjectElement):
      * svg/SVGGElement.cpp:
      (WebCore::SVGGElement::parseAttribute):
      * svg/SVGGElement.h:
      (SVGGElement):
      * svg/SVGGlyphElement.cpp:
      (WebCore::SVGGlyphElement::parseAttribute):
      * svg/SVGGlyphElement.h:
      (SVGGlyphElement):
      * svg/SVGGlyphRefElement.cpp:
      (WebCore::SVGGlyphRefElement::parseAttribute):
      * svg/SVGGlyphRefElement.h:
      * svg/SVGGradientElement.cpp:
      (WebCore::SVGGradientElement::parseAttribute):
      * svg/SVGGradientElement.h:
      * svg/SVGImageElement.cpp:
      (WebCore::SVGImageElement::parseAttribute):
      * svg/SVGImageElement.h:
      (SVGImageElement):
      * svg/SVGLangSpace.cpp:
      (WebCore::SVGLangSpace::parseAttribute):
      * svg/SVGLangSpace.h:
      (SVGLangSpace):
      * svg/SVGLineElement.cpp:
      (WebCore::SVGLineElement::parseAttribute):
      * svg/SVGLineElement.h:
      (SVGLineElement):
      * svg/SVGLinearGradientElement.cpp:
      (WebCore::SVGLinearGradientElement::parseAttribute):
      * svg/SVGLinearGradientElement.h:
      (SVGLinearGradientElement):
      * svg/SVGMPathElement.cpp:
      (WebCore::SVGMPathElement::parseAttribute):
      * svg/SVGMPathElement.h:
      (SVGMPathElement):
      * svg/SVGMarkerElement.cpp:
      (WebCore::SVGMarkerElement::parseAttribute):
      * svg/SVGMarkerElement.h:
      (SVGMarkerElement):
      * svg/SVGMaskElement.cpp:
      (WebCore::SVGMaskElement::parseAttribute):
      * svg/SVGMaskElement.h:
      (SVGMaskElement):
      * svg/SVGPathElement.cpp:
      (WebCore::SVGPathElement::parseAttribute):
      * svg/SVGPathElement.h:
      (SVGPathElement):
      * svg/SVGPatternElement.cpp:
      (WebCore::SVGPatternElement::parseAttribute):
      * svg/SVGPatternElement.h:
      (SVGPatternElement):
      * svg/SVGPolyElement.cpp:
      (WebCore::SVGPolyElement::parseAttribute):
      * svg/SVGPolyElement.h:
      (SVGPolyElement):
      * svg/SVGRadialGradientElement.cpp:
      (WebCore::SVGRadialGradientElement::parseAttribute):
      * svg/SVGRadialGradientElement.h:
      (SVGRadialGradientElement):
      * svg/SVGRectElement.cpp:
      (WebCore::SVGRectElement::parseAttribute):
      * svg/SVGRectElement.h:
      (SVGRectElement):
      * svg/SVGSVGElement.cpp:
      (WebCore::SVGSVGElement::parseAttribute):
      * svg/SVGSVGElement.h:
      (SVGSVGElement):
      * svg/SVGScriptElement.cpp:
      (WebCore::SVGScriptElement::parseAttribute):
      * svg/SVGScriptElement.h:
      (SVGScriptElement):
      * svg/SVGStopElement.cpp:
      (WebCore::SVGStopElement::parseAttribute):
      * svg/SVGStopElement.h:
      (SVGStopElement):
      * svg/SVGStyleElement.cpp:
      (WebCore::SVGStyleElement::parseAttribute):
      * svg/SVGStyleElement.h:
      (SVGStyleElement):
      * svg/SVGStyledElement.cpp:
      (WebCore::SVGStyledElement::parseAttribute):
      * svg/SVGStyledElement.h:
      (SVGStyledElement):
      * svg/SVGStyledTransformableElement.cpp:
      (WebCore::SVGStyledTransformableElement::parseAttribute):
      * svg/SVGStyledTransformableElement.h:
      (SVGStyledTransformableElement):
      * svg/SVGSymbolElement.cpp:
      (WebCore::SVGSymbolElement::parseAttribute):
      * svg/SVGSymbolElement.h:
      (SVGSymbolElement):
      * svg/SVGTRefElement.cpp:
      (WebCore::SVGTRefElement::parseAttribute):
      * svg/SVGTRefElement.h:
      (SVGTRefElement):
      * svg/SVGTests.cpp:
      (WebCore::SVGTests::parseAttribute):
      * svg/SVGTests.h:
      (SVGTests):
      * svg/SVGTextContentElement.cpp:
      (WebCore::SVGTextContentElement::parseAttribute):
      * svg/SVGTextContentElement.h:
      (SVGTextContentElement):
      * svg/SVGTextElement.cpp:
      (WebCore::SVGTextElement::parseAttribute):
      * svg/SVGTextElement.h:
      (SVGTextElement):
      * svg/SVGTextPathElement.cpp:
      (WebCore::SVGTextPathElement::parseAttribute):
      * svg/SVGTextPathElement.h:
      * svg/SVGTextPositioningElement.cpp:
      (WebCore::SVGTextPositioningElement::parseAttribute):
      * svg/SVGTextPositioningElement.h:
      (SVGTextPositioningElement):
      * svg/SVGURIReference.cpp:
      (WebCore::SVGURIReference::parseAttribute):
      * svg/SVGURIReference.h:
      (SVGURIReference):
      * svg/SVGUseElement.cpp:
      (WebCore::SVGUseElement::parseAttribute):
      * svg/SVGUseElement.h:
      (SVGUseElement):
      * svg/SVGViewElement.cpp:
      (WebCore::SVGViewElement::parseAttribute):
      * svg/SVGViewElement.h:
      (SVGViewElement):
      * svg/SVGZoomAndPan.h:
      (WebCore::SVGZoomAndPan::parseAttribute):
      * svg/animation/SVGSMILElement.cpp:
      (WebCore::SVGSMILElement::parseAttribute):
      * svg/animation/SVGSMILElement.h:
      (SVGSMILElement):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      43e9d04c
  26. 15 Nov, 2012 1 commit
    • jer.noble@apple.com's avatar
      Support loading of blob URLs in AVFoundation. · 097fd96f
      jer.noble@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=102182
      
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      Add support for BLOB (and other non-natively supported schemed) URLs through the AVAssetResourceLoader API.
      
      Test: media/video-src-blob.html
      
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
      (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): Only go down the encrypted
          media path if the key scheme is skp://.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::didCancelLoadingRequest): Added.  Cancel resource loading if
          the media engine requests it.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::addKey): Use the new, non-deprecated API.
      
      Use the dispatch_main_queue() as the AVAssetResourceLoadDelegate queue now that <rdar://problem/12362461> is fixed.
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
      (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
      (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
      (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
      
      Add a new helper class to manage loading the CachedRawResource and feed the incoming
      data to the AVAssetResourceLoader.
      * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h: Added.
      * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: Added.
      (WebCore::WebCoreAVFResourceLoader::create): Simple factory.
      (WebCore::WebCoreAVFResourceLoader::WebCoreAVFResourceLoader): Simple constructor.
      (WebCore::WebCoreAVFResourceLoader::~WebCoreAVFResourceLoader): Simple destructor.
      (WebCore::WebCoreAVFResourceLoader::startLoading): Tell the cachedResourceLoader to schedule loading.
      (WebCore::WebCoreAVFResourceLoader::stopLoading): Remove this as a client of the resource.
      (WebCore::WebCoreAVFResourceLoader::responseReceived): Fill in the contentInformation field of the
          AVAssetResourceLoadingRequest.
      (WebCore::WebCoreAVFResourceLoader::dataReceived): Call fulfillRequestWithResource.
      (WebCore::WebCoreAVFResourceLoader::notifyFinished): Tell the AVAssetResourceLoadingRequest that loading
          has completed.
      (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource): Fill in (if possible) the dataRequest
          field of the AVAssetResourceLoadingRequest.
      
      Add a MediaPlayerClient method allowing MediaPlayerPrivate subclasses to access the HTMLMediaElement's
      document's cachedResourceLoader.
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::mediaPlayerCachedResourceLoader):
      * html/HTMLMediaElement.h:
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::MediaPlayer::cachedResourceLoader):
      * platform/graphics/MediaPlayer.h:
      (WebCore::MediaPlayerClient::mediaPlayerCachedResourceLoader):
      
      Add a convenience method to convert from MIME type -> UTI.
      * platform/network/mac/UTIUtilities.h:
      * platform/network/mac/UTIUtilities.mm:
      (WebCore::UTIFromMIMEType):
      
      Add new files to project.
      * WebCore.xcodeproj/project.pbxproj:
      
      LayoutTests:
      
      Add a new test which verifies blob url support in video elements.
      
      * media/video-src-blob-expected.txt: Added.
      * media/video-src-blob.html: Added.
      * platform/mac/TestExpectations: Add expected failure results for OSX releases where
          custom media loading is not supported.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134802 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      097fd96f
  27. 07 Nov, 2012 1 commit
  28. 06 Nov, 2012 1 commit
    • commit-queue@webkit.org's avatar
      [BlackBerry] Automatically go fullscreen on video play · ef10b460
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=101100
      
      Patch by Max Feil <mfeil@rim.com> on 2012-11-06
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      There is a requirement to have HTML5 video automatically enter
      fullscreen when a video starts playing (PR131774). This change
      implements this feature, with restrictions. The main restriction
      is adherence to WebKit's philosophy of only entering fullscreen
      due to a user gesture. This is important in order to avoid
      pop-up advertisements and other unwanted fullscreen content.
      One consequence of this is that video elements with the autoplay
      attribute will not automatically enter fullscreen.
      
      Other caveats:
      - This feature applies only to "small screen" devices where
      automatically going fullscreen makes more sense.
      - Fullscreen will only be entered automatically when the
      video is played from the beginning (current time is zero).
      It is assumed that if the user is resuming play from a paused
      state and is not in fullscreen mode, then they exited fullscreen
      mode intentionally.
      
      Test: platform/blackberry/media/video-automatic-fullscreen.html
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::mediaPlayerEnterFullscreen):
      (WebCore):
      (WebCore::HTMLMediaElement::mediaPlayerIsFullscreen):
      (WebCore::HTMLMediaElement::mediaPlayerIsFullscreenPermitted):
      * html/HTMLMediaElement.h:
      (HTMLMediaElement):
      * platform/graphics/MediaPlayer.h:
      (WebCore::MediaPlayerClient::mediaPlayerEnterFullscreen):
      (WebCore::MediaPlayerClient::mediaPlayerIsFullscreen):
      (WebCore::MediaPlayerClient::mediaPlayerIsFullscreenPermitted):
      * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
      (WebCore::MediaPlayerPrivate::play):
      (WebCore::MediaPlayerPrivate::waitMetadataTimerFired):
      (WebCore::MediaPlayerPrivate::conditionallyGoFullscreenAfterPlay):
      (WebCore):
      * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h:
      (MediaPlayerPrivate):
      
      LayoutTests:
      
      Test that fullscreen is entered automatically when play is
      pressed (PR131774). This test applies to handheld (small screen)
      devices only, not tablets. The html code for this test was based
      on video-controls-fullscreen-volume.html and modified.
      
      * platform/blackberry/media/video-automatic-fullscreen-expected.txt: Added.
      * platform/blackberry/media/video-automatic-fullscreen.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ef10b460
  29. 01 Nov, 2012 2 commits
  30. 24 Oct, 2012 1 commit
    • eric.carlson@apple.com's avatar
      Allow ports to override text track rendering style · 68e8da75
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=97800
      <rdar://problem/12044964>
      
      Reviewed by Maciej Stachowiak.
      
      Source/WebCore:
      
      * WebCore.exp.in: Export new WebkitSystemInterface functions.
      * WebCore.xcodeproj/project.pbxproj: Add CaptionUserPreferences.h, CaptionUserPreferencesMac.mm,
          and CaptionUserPreferencesMac.h.
      
      * css/mediaControls.css: Rearrange the caption CSS so it is possible to style the cue window,
          background, and text independently.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_disableCaptions with theme->userPrefersCaptions().
      (WebCore::HTMLMediaElement::attach): Register for caption preferences change callbacks.
      (WebCore::HTMLMediaElement::detach): Unregister for caption preferences change callbacks.
      (WebCore::HTMLMediaElement::userPrefersCaptions): Return theme->userPrefersCaptions().
      (WebCore::HTMLMediaElement::userIsInterestedInThisTrackKind): Consider userPrefersCaptions().
      (WebCore::HTMLMediaElement::setClosedCaptionsVisible): Move the code that marks all tracks as
          un-configured to markCaptionAndSubtitleTracksAsUnconfigured so it can be reused.
      (WebCore::HTMLMediaElement::captionPreferencesChanged): New, force a reevaluation of all text tracks.
      (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): New, code moved from
          setClosedCaptionsVisible
      * html/HTMLMediaElement.h: Inherit from CaptionPreferencesChangedListener.
      
      * html/shadow/MediaControlElements.cpp:
      (WebCore::MediaControlTextTrackContainerElement::updateSizes): Get rid of unnecessary member
          variable. Get caption font scale from theme instead of hard coding.
      * html/shadow/MediaControlElements.h:
      
      * html/track/TextTrack.cpp:
      (WebCore::TextTrack::TextTrack): Change attributes from String to AtomicString.
      (WebCore::TextTrack::isValidKindKeyword): Ditto.
      (WebCore::TextTrack::setKind): Ditto.
      (WebCore::TextTrack::setMode): Ditto.
      (WebCore::TextTrack::mode): Ditto.
      * html/track/TextTrack.h:
      (WebCore::TextTrack::create): Ditto.
      (WebCore::TextTrack::kind): Ditto.
      (WebCore::TextTrack::label): Ditto.
      (WebCore::TextTrack::setLabel): Ditto.
      (WebCore::TextTrack::language): Ditto.
      (WebCore::TextTrack::setLanguage): Ditto.
      
      * html/track/TextTrackCue.cpp:
      (WebCore::TextTrackCueBox::TextTrackCueBox): Set the shadow pseudo id.
      (WebCore::TextTrackCueBox::textTrackCueBoxShadowPseudoId): New, class method to return the
          shadow pseudo id so it can be used elsewhere.
      (WebCore::TextTrackCueBox::shadowPseudoId): Call textTrackCueBoxShadowPseudoId.
      (WebCore::TextTrackCue::pastNodesShadowPseudoId): New, class method to return the
          shadow pseudo id so it can be used elsewhere.
      (WebCore::TextTrackCue::futureNodesShadowPseudoId): Ditto.
      (WebCore::TextTrackCue::updateDisplayTree):
      * html/track/TextTrackCue.h:
      
      * page/CaptionUserPreferences.h: Added.
      * page/CaptionUserPreferencesMac.h: Added.
      * page/CaptionUserPreferencesMac.mm: Added.
      (WebCore::userCaptionPreferencesChangedNotificationCallback):
      (WebCore::CaptionUserPreferencesMac::CaptionUserPreferencesMac):
      (WebCore::CaptionUserPreferencesMac::~CaptionUserPreferencesMac):
      (WebCore::CaptionUserPreferencesMac::userHasCaptionPreferences): New, passthrough to WKSI function.
      (WebCore::CaptionUserPreferencesMac::userPrefersCaptions): Ditto.
      (WebCore::CaptionUserPreferencesMac::captionsWindowColor): Return Color with user's caption window color preference.
      (WebCore::CaptionUserPreferencesMac::captionsBackgroundColor): Return Color with user's caption
          background color preference.
      (WebCore::CaptionUserPreferencesMac::captionsTextColor): Return Color with user's caption text color preference.
      (WebCore::CaptionUserPreferencesMac::captionsEdgeColorForTextColor): Return Color for text edge effect.
      (WebCore::CaptionUserPreferencesMac::cssPropertyWithTextEdgeColor): Return String with CSS to set a text-shadow
          or webkit-text-stroke property.
      (WebCore::CaptionUserPreferencesMac::cssColorProperty): Return a String with css to set a property
          with a color value.
      (WebCore::CaptionUserPreferencesMac::captionsTextEdgeStyle): Return a String with css to style caption
          text with the user's preferred text edge stye.
      (WebCore::CaptionUserPreferencesMac::captionsDefaultFont): Return a String with css to style caption
          text with the user's preferred font.
      (WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride): Return a String with css to style captions
          with the user's preferred style.
      (WebCore::CaptionUserPreferencesMac::captionFontSizeScale): Return the user's preferred caption font scale.
      (WebCore::CaptionUserPreferencesMac::captionPreferencesChanged): Notify listeners of caption preference change.
      (WebCore::CaptionUserPreferencesMac::registerForCaptionPreferencesChangedCallbacks): Add a caption preferences
          changes listener.
      (WebCore::CaptionUserPreferencesMac::unregisterForCaptionPreferencesChangedCallbacks): Remove a caption preferences
          changes listener.
      (WebCore::CaptionUserPreferencesMac::updateCaptionStyleSheetOveride): New, if theme has a captions style sheet override,
          inject it into the current page group, otherwise remove injected sheet.
      
      * page/PageGroup.cpp:
      (WebCore::PageGroup::captionPreferences):
      (WebCore::PageGroup::registerForCaptionPreferencesChangedCallbacks): New, passthrough to platform specific function
          of the same name.
      (WebCore::PageGroup::unregisterForCaptionPreferencesChangedCallbacks): Ditto.
      (WebCore::PageGroup::userPrefersCaptions): Ditto.
      (WebCore::PageGroup::userHasCaptionPreferences): Ditto.
      (WebCore::PageGroup::captionFontSizeScale): Ditto.
      * page/PageGroup.h:
      
      * platform/mac/WebCoreSystemInterface.h: Updated.
      * platform/mac/WebCoreSystemInterface.mm: Ditto.
      
      Source/WebKit/mac:
      
      * WebCoreSupport/WebSystemInterface.mm:
      (InitWebCoreSystemInterface): Initialize new WKSI function pointers.
      
      Source/WebKit2:
      
      * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
      (InitWebCoreSystemInterface): Initialize new WKSI function pointers.
      
      WebKitLibraries:
      
      Update WKSI header with SPI for getting the user caption appearance preferences.
      
      * WebKitSystemInterface.h:
      
      LayoutTests:
      
      * media/track/track-cue-rendering-expected.txt: Update results for caption css changes.
      * media/track/track-cue-rendering.html:
      * platform/chromium/TestExpectations: Skip tests that need to be rebaselined.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      68e8da75
  31. 12 Oct, 2012 1 commit
    • jer.noble@apple.com's avatar
      Enable ENCRYPTED_MEDIA support on Mac. · a39e5ce6
      jer.noble@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=98044
      
      Reviewed by Anders Carlsson.
      
      Source/JavaScriptCore:
      
      Enable the ENCRYPTED_MEDIA flag.
      
      * Configurations/FeatureDefines.xcconfig:
      
      Source/WebCore:
      
      Enable the ENCRYPTED_MEDIA conditional on the Mac port.
      
      No new tests; Existing media/encrypted-media tests require org.w3.clearkey support, which is not implemented.
      
      * Configurations/FeatureDefines.xcconfig: Enable the ENCRYPTED_MEDIA flag.
      * DerivedSources.make: Add the MediaKeyError and MediaKeyEvent classes.
      * WebCore.xcodeproj/project.pbxproj: Ditto.
      * bindings/js/JSDictionary.cpp:
      (WebCore::JSDictionary::convertValue): Add convertValue functions for Uint8Array and MediaKeyError.
      * bindings/js/JSDictionary.h:
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded): Throw an error if no "needkey"
          handler is registered.
      * html/HTMLMediaElement.h:
      * html/HTMLMediaElement.idl: Change keySystem to DefaultIsUndefined.
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::MediaPlayer::keyNeeded): Return a bool indicating whether the process was aborted
          due to a lack of "needkey" listener.
      * platform/graphics/MediaPlayer.h:
      (WebCore::MediaPlayerClient::mediaPlayerKeyAdded): Remove unused parameter names.
      (WebCore::MediaPlayerClient::mediaPlayerKeyError): Ditto.
      (WebCore::MediaPlayerClient::mediaPlayerKeyMessage): Ditto.
      (WebCore::MediaPlayerClient::mediaPlayerKeyNeeded): Ditto.
      * platform/graphics/MediaPlayerPrivate.h:
      (WebCore::MediaPlayerPrivateInterface::addKey): Ditto.
      (WebCore::MediaPlayerPrivateInterface::generateKeyRequest): Ditto.
      (WebCore::MediaPlayerPrivateInterface::cancelKeyRequest): Ditto.
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
      (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): Call extendedSupportsType.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::extendedSupportsType): Stub. Pass through to supportsType.
      * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
      * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
      (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine): Call extendedSupportsType.
      (WebCore::MediaPlayerPrivateQTKit::extendedSupportsType): Stub. Pass through to supportsType.
      
      LayoutTests:
      
      Add platform specific expected results.
      
      * platform/mac/fast/events/constructors/media-key-event-constructor-expected.txt: Added.
      * platform/chromium/fast/events/constructors/media-key-event-constructor-expected.txt: Copied from
          fast/events/constructors/media-key-event-constructor-expected.txt due to chromium expected results
          search order including platform/mac.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131201 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a39e5ce6
  32. 05 Oct, 2012 1 commit
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r130556 and r130564. · f583bb1a
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/130556
      http://trac.webkit.org/changeset/130564
      https://bugs.webkit.org/show_bug.cgi?id=98572
      
      The patch wasn't reviewed by a reviewer and it is breaking
      Chromium Windows (Requested by jchaffraix on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-10-05
      
      Source/WebCore:
      
      * WebCore.exp.in:
      * WebCore.xcodeproj/project.pbxproj:
      * css/mediaControls.css:
      (video::-webkit-media-text-track-container):
      (video::-webkit-media-text-track-past-nodes):
      (video::-webkit-media-text-track-future-nodes):
      (video::-webkit-media-text-track-display):
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::HTMLMediaElement):
      (WebCore::HTMLMediaElement::attach):
      (WebCore::HTMLMediaElement::userIsInterestedInThisLanguage):
      (WebCore::HTMLMediaElement::userIsInterestedInThisTrackKind):
      (WebCore::HTMLMediaElement::setClosedCaptionsVisible):
      (WebCore::HTMLMediaElement::updateClosedCaptionsControls):
      * html/HTMLMediaElement.h:
      (HTMLMediaElement):
      * html/shadow/MediaControlElements.cpp:
      (WebCore):
      (WebCore::MediaControlTextTrackContainerElement::updateSizes):
      * html/shadow/MediaControlElements.h:
      (MediaControlTextTrackContainerElement):
      * html/shadow/MediaControlRootElement.cpp:
      (WebCore::MediaControlRootElement::updateTextTrackDisplay):
      * html/shadow/MediaControlRootElement.h:
      (MediaControlRootElement):
      * html/shadow/MediaControls.h:
      (MediaControls):
      * html/track/TextTrack.cpp:
      (WebCore::TextTrack::TextTrack):
      (WebCore::TextTrack::isValidKindKeyword):
      (WebCore::TextTrack::setKind):
      (WebCore::TextTrack::setMode):
      (WebCore::TextTrack::mode):
      * html/track/TextTrack.h:
      (WebCore::TextTrack::create):
      (WebCore::TextTrack::kind):
      (TextTrack):
      (WebCore::TextTrack::label):
      (WebCore::TextTrack::setLabel):
      (WebCore::TextTrack::language):
      (WebCore::TextTrack::setLanguage):
      * html/track/TextTrackCue.cpp:
      (WebCore::TextTrackCueBox::TextTrackCueBox):
      (WebCore::TextTrackCueBox::shadowPseudoId):
      (WebCore):
      (WebCore::TextTrackCue::updateDisplayTree):
      * html/track/TextTrackCue.h:
      (TextTrackCueBox):
      (TextTrackCue):
      * platform/mac/WebCoreSystemInterface.h:
      * platform/mac/WebCoreSystemInterface.mm:
      * rendering/CaptionPreferencesChangedListener.h: Removed.
      * rendering/RenderTheme.h:
      (WebCore):
      (RenderTheme):
      * rendering/RenderThemeMac.h:
      (RenderThemeMac):
      * rendering/RenderThemeMac.mm:
      (WebCore):
      (WebCore::RenderThemeMac::RenderThemeMac):
      (WebCore::RenderThemeMac::~RenderThemeMac):
      
      Source/WebKit/mac:
      
      * WebCoreSupport/WebSystemInterface.mm:
      (InitWebCoreSystemInterface):
      
      Source/WebKit2:
      
      * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
      (InitWebCoreSystemInterface):
      
      WebKitLibraries:
      
      * WebKitSystemInterface.h:
      
      LayoutTests:
      
      * media/track/track-cue-rendering-expected.txt:
      * media/track/track-cue-rendering.html:
      * platform/chromium/TestExpectations:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f583bb1a