2009-11-19 Eric Carlson <eric.carlson@apple.com>
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Nov 2009 18:14:01 +0000 (18:14 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Nov 2009 18:14:01 +0000 (18:14 +0000)
commit9f2f9c6c61c2a8e471bab264e0b1b22a75d7e10d
tree18b4576a540b759ee0bb5fd3adb77431d91f0652
parent4891d52249798699a3a123796a6125557980376e
2009-11-19  Eric Carlson  <eric.carlson@apple.com>

        Reviewed by Dan Bernstein.

        <rdar://problem/7035231>
        Support closed caption in <video> element

        Test: media/media-captions.html

        * WebCore.base.exp:
        * accessibility/AccessibilityMediaControls.cpp:
        (WebCore::AccessibilityMediaControl::controlTypeName):
            Define ShowClosedCaptionsButton and HideClosedCaptionsButton.

        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
            Add MediaToggleClosedCaptionsButtonPart.

        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::extractPseudoType):
            Define and match mediaControlsToggleClosedCaptionsButton.

        * css/CSSSelector.h:
        (WebCore::CSSSelector::):
        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
            Define and match PseudoMediaControlsToggleClosedCaptions.

        * css/CSSValueKeywords.in:
            Define and use media-toggle-closed-captions-button.

        * css/mediaControls.css:
        * css/mediaControlsQuickTime.css:
            Add webkit-media-controls-toggle-closed-captions-button.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::HTMLMediaElement):
            Initialize m_closedCaptionsVisible.
        (WebCore::HTMLMediaElement::loadInternal):
            Set m_closedCaptionsVisible to false.
        (WebCore::HTMLMediaElement::hasClosedCaptions):
        (WebCore::HTMLMediaElement::closedCaptionsVisible):
        (WebCore::HTMLMediaElement::setClosedCaptionsVisible):
            New, captions internal methods.
        (WebCore::HTMLMediaElement::setWebkitClosedCaptionsVisible):
        (WebCore::HTMLMediaElement::webkitClosedCaptionsVisible):
        (WebCore::HTMLMediaElement::webkitHasClosedCaptions):
            New, captions DOM API.

        * html/HTMLMediaElement.h:
        * html/HTMLMediaElement.idl:
            Declare methods needed for captions API.

        * platform/ThemeTypes.h:
            Add MediaToggleClosedCaptionsButtonPart.

        * platform/android/LocalizedStringsAndroid.cpp:
        (WebCore::localizedMediaControlElementString):
        (WebCore::localizedMediaControlElementHelpText):
        (WebCore::localizedMediaTimeDescription):
            Add empty implmentations.

        * platform/graphics/MediaPlayer.cpp:
        (WebCore::NullMediaPlayerPrivate::hasClosedCaptions):
        (WebCore::NullMediaPlayerPrivate::setClosedCaptionsVisible):
            New, empty implementations of media engine closed caption functions.
        (WebCore::MediaPlayer::hasClosedCaptions):
        (WebCore::MediaPlayer::setClosedCaptionsVisible):
            New, call media engine closed caption functions.

        * platform/graphics/MediaPlayer.h:
        * platform/graphics/MediaPlayerPrivate.h:
        (WebCore::MediaPlayerPrivateInterface::hasClosedCaptions):
        (WebCore::MediaPlayerPrivateInterface::setClosedCaptionsVisible):
            Declare new media engine methods.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::MediaPlayerPrivate::hasClosedCaptions):
        (WebCore::MediaPlayerPrivate::setClosedCaptionsVisible):
            New, QTKit implementation of closed caption methods.

        * platform/gtk/LocalizedStringsGtk.cpp:
        (WebCore::localizedMediaControlElementString):
        (WebCore::localizedMediaControlElementHelpText):
            Add help text for ShowClosedCaptionsButton and HideClosedCaptionsButton.

        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:
            Declare and initialize wkQTMovieHasClosedCaptions and wkQTMovieSetShowClosedCaptions.

        * rendering/MediaControlElements.cpp:
        (WebCore::MediaControlInputElement::MediaControlInputElement):
            Deal with MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON.
        (WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement):
        (WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
        (WebCore::MediaControlToggleClosedCaptionsButtonElement::updateDisplayType):
            New, implement the closed caption toggle button,

        * rendering/MediaControlElements.h:
            Define MediaShowClosedCaptionsButton and MediaHideClosedCaptionsButton,
            declare MediaControlToggleClosedCaptionsButtonElement.

        * rendering/RenderMedia.cpp:
        (WebCore::RenderMedia::styleDidChange):
        (WebCore::RenderMedia::createToggleClosedCaptionsButton):
        (WebCore::RenderMedia::createStatusDisplay):
        (WebCore::RenderMedia::updateControls):
        (WebCore::RenderMedia::forwardEvent):
        * rendering/RenderMedia.h:
            Deal with m_toggleClosedCaptionsButton.

        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::paint):
            Deal with MediaToggleClosedCaptionsButtonPart.

        * rendering/RenderTheme.h:
        * rendering/RenderThemeMac.h:
            Declare paintMediaToggleClosedCaptionsButton.

        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::paintMediaToggleClosedCaptionsButton):
            New.
        (WebCore::RenderThemeMac::shouldRenderMediaControlPart):
            Don't render captions toggle button unless we are using the new theme, the
            movie has captions, and the movie is in a <video> element since we currently
            rely on QTKit to render the captions.

        * rendering/style/RenderStyleConstants.h:
            Define MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON.

2009-11-19  Eric Carlson  <eric.carlson@apple.com>

        Reviewed by Dan Bernstein.

        <rdar://problem/7035231>
        Support closed caption in <video> element

        * media/media-captions-expected.txt: Added.
        * media/media-captions.html: Added.
        * media/content/counting-captioned.mov: Added.

        * platform/gtk/Skipped:
        * platform/mac-leopard/Skipped:
        * platform/mac-tiger/Skipped:
        * platform/win/Skipped:
            Skipped on platforms that don't support closed captions yet.

2009-11-19  Eric Carlson  <eric.carlson@apple.com>

        Reviewed by Dan Bernstein.

        <rdar://problem/7035231>
        Support closed caption in <video> element

        * English.lproj/Localizable.strings:
            Add strings for toggle captions button.

2009-11-19  Eric Carlson  <eric.carlson@apple.com>

        Reviewed by Dan Bernstein.

        <rdar://problem/7035231>
        Support closed caption in <video> element

        * WebCoreSupport/WebSystemInterface.m:
        (InitWebCoreSystemInterface):
            Add QTMovieHasClosedCaptions and QTMovieSetShowClosedCaptions.

        * WebCoreSupport/WebViewFactory.mm:
        (-[WebViewFactory localizedMediaControlElementString:]):
        (-[WebViewFactory localizedMediaControlElementHelpText:]):
            Add accessibility help strings for media controller closed caption button.

2009-11-19  Eric Carlson  <eric.carlson@apple.com>

        Reviewed by Dan Bernstein.

        <rdar://problem/7035231>
        Support closed caption in <video> element

        * WebCoreLocalizedStrings.cpp:
        (WebCore::localizedMediaControlElementString):
        (WebCore::localizedMediaControlElementHelpText):
            Add accessibility help strings for media controller closed caption button.

2009-11-19  Eric Carlson  <eric.carlson@apple.com>

        Reviewed by Dan Bernstein.

        <rdar://problem/7035231>
        Support closed caption in <video> element

        * WebKitSystemInterface.h:
            Add prototypes for WKQTMovieHasClosedCaptions and WKQTMovieSetShowClosedCaptions,
            define WKMediaUIPartToggleClosedCaptionsButton.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
52 files changed:
LayoutTests/ChangeLog
LayoutTests/media/content/counting-captioned.mov [new file with mode: 0644]
LayoutTests/media/media-captions-expected.txt [new file with mode: 0644]
LayoutTests/media/media-captions.html [new file with mode: 0644]
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/mac-leopard/Skipped
LayoutTests/platform/mac-tiger/Skipped
LayoutTests/platform/win/Skipped
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/accessibility/AccessibilityMediaControls.cpp
WebCore/css/CSSPrimitiveValueMappings.h
WebCore/css/CSSSelector.cpp
WebCore/css/CSSSelector.h
WebCore/css/CSSStyleSelector.cpp
WebCore/css/CSSValueKeywords.in
WebCore/css/mediaControls.css
WebCore/css/mediaControlsQuickTime.css
WebCore/html/HTMLMediaElement.cpp
WebCore/html/HTMLMediaElement.h
WebCore/html/HTMLMediaElement.idl
WebCore/platform/ThemeTypes.h
WebCore/platform/android/LocalizedStringsAndroid.cpp
WebCore/platform/graphics/MediaPlayer.cpp
WebCore/platform/graphics/MediaPlayer.h
WebCore/platform/graphics/MediaPlayerPrivate.h
WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
WebCore/platform/gtk/LocalizedStringsGtk.cpp
WebCore/platform/mac/WebCoreSystemInterface.h
WebCore/platform/mac/WebCoreSystemInterface.mm
WebCore/rendering/MediaControlElements.cpp
WebCore/rendering/MediaControlElements.h
WebCore/rendering/RenderMedia.cpp
WebCore/rendering/RenderMedia.h
WebCore/rendering/RenderTheme.cpp
WebCore/rendering/RenderTheme.h
WebCore/rendering/RenderThemeMac.h
WebCore/rendering/RenderThemeMac.mm
WebCore/rendering/style/RenderStyleConstants.h
WebKit/ChangeLog
WebKit/English.lproj/Localizable.strings
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebSystemInterface.m
WebKit/mac/WebCoreSupport/WebViewFactory.mm
WebKit/win/ChangeLog
WebKit/win/WebCoreLocalizedStrings.cpp
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLeopard.a
WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
WebKitLibraries/libWebKitSystemInterfaceTiger.a