Changeset 164024 in webkit


Ignore:
Timestamp:
Feb 13, 2014 3:28:34 AM (10 years ago)
Author:
calvaris@igalia.com
Message:

[GTK] MEDIA_CONTROLS_SCRIPT support
https://bugs.webkit.org/show_bug.cgi?id=123097

Reviewed by Jer Noble.

.:

Part of the Autotools and CMake structure to build the media
controls script.

  • Source/autotools/SetupWebKitFeatures.m4: Activated the media

controls script by default.

  • Source/cmake/OptionsGTK.cmake: Activated the media controls

script by default.

  • Source/cmake/WebKitFeatures.cmake: Created the option to

activate the controls script.

  • Source/cmakeconfig.h.cmake: Created the define template the the

media controls script.

Source/WebCore:

WebKitGTK+ multimedia controls are now managed from Javascript
code. Apple controls are kept as common code and GTK+ ones are
subclassed for the specific behavior.

Both CMake and Autotools build support is provided.

  • CMakeLists.txt: Added support to build the media controls

script and their associated files.

  • GNUmakefile.am: Added support to generate the C++ code from the

Javascript.

  • GNUmakefile.list.am: Added the media controls script associated

files.

  • Modules/mediacontrols/MediaControlsHost.cpp:
  • Modules/mediacontrols/MediaControlsHost.h:
  • Modules/mediacontrols/MediaControlsHost.idl:

(WebCore::MediaControlsHost::supportsFullscreen): Added attribute
to know if the element supports fullscreen.

  • Modules/mediacontrols/mediaControlsApple.js:

(Controller.prototype.handleWrapperMouseMove):
(Controller.prototype.handleWrapperMouseOut):
(Controller.prototype.updatePlaying): Use clear and
resetHideControlsTimer.
(Controller.prototype.clearHideControlsTimer): Added.
(Controller.prototype.resetHideControlsTimer): Added.

  • Modules/mediacontrols/mediaControlsGtk.js: Added.

(createControls): Calls ControllerGtk.
(ControllerGtk): Calls the superclass.
(contains): Defines a function to know if an object is contained
in an array.
(ControllerGtk.prototype.inheritFrom): Copies the method of the
superclass that are not reimplemented in the subclass.
(ControllerGtk.prototype.createControls): Calls the superclass and
create the remaining needed elements.
(ControllerGtk.prototype.configureInlineControls): Configures the
controls.
(ControllerGtk.prototype.setStatusHidden): Redefined empty.
(ControllerGtk.prototype.updateTime): Writes the duration and
current position. As it was so far, current time also includes
duration. If current time is bigger than 0 we show that.
(ControllerGtk.prototype.showCurrentTime): Shows current time and
hides duration label (that is included in current time).
(ControllerGtk.prototype.handlePlay): Calls the superclass and
force showing the current time.
(ControllerGtk.prototype.handleTimeUpdate): Always update the
time.
(ControllerGtk.prototype.handleMuteButtonMouseOver): Shows the
volume slider.
(ControllerGtk.prototype.handleVolumeBoxMouseOut): Hides the
volume slider.
(ControllerGtk.prototype.addControls): Adds the enclosure instead
of the panel directly. Panel is, of course, part of the enclosure.
(ControllerGtk.prototype.updateReadyState): Shows the fullscreen
button only if fullscreen is supported. Sets the volume in up or
down mode depending on its position in the document. Updates the
volume.
(ControllerGtk.prototype.setControlsType): Creates the controls it
they were not created before. Unlike Apple ones, WebKitGTK+
fullscreen and inline controls are the same.
(ControllerGtk.prototype.updatePlaying): Calls the superclass and
shows the controls if not playing.
(ControllerGtk.prototype.handleCaptionButtonClicked): Redefined
empty. To be coherent with volume, that also shows a popup, this
is handled with mouseover instead of click.
(ControllerGtk.prototype.buildCaptionMenu): Calls the superclass
to build the menu, sets some listeners, centers the popup with the
captions button, keeps the current height and sets the style to 0,
which is needed to animate it.
(ControllerGtk.prototype.destroyCaptionMenu): Hides the caption menu.
(ControllerGtk.prototype.showCaptionMenu): Resets the height to
its original. We don't animate it with CSS because we would need
to specify a height in the style and we don't know it in advance.
(ControllerGtk.prototype.hideCaptionMenu): Sets height to 0.
(ControllerGtk.prototype.captionMenuTransitionEnd): When the
captions menu transtition ends, it is destroyed.
(ControllerGtk.prototype.handleCaptionButtonMouseOver): Creates
the caption menu and shows it.
(ControllerGtk.prototype.handleCaptionButtonMouseOut): Hides the
captions menu.
(ControllerGtk.prototype.handleCaptionMouseOut): Hides the
captions menu.

  • PlatformGTK.cmake: Added WebCore to the target link libraries

and initialized the variables needed at CMakelists.txt

  • css/mediaControlsGtk.css:

(audio::-webkit-media-controls-panel)
(video::-webkit-media-controls-panel): Added transtion based on opacity.
(video::-webkit-media-controls-panel): Set video opacity to 0.
(video::-webkit-media-controls-panel.paused): Set video opacity to 1.
(audio::-webkit-media-controls-panel div.mute-box): Set the same
style as the mute button to preserve the layout.
(audio::-webkit-media-controls-panel div.mute-box.hidden): Sets
the display to none.
(audio::-webkit-media-controls-mute-button)
(video::-webkit-media-controls-mute-button): Removed the outline
and the margin that is managed by the mute box now.
(audio::-webkit-media-controls-play-button)
(video::-webkit-media-controls-play-button): Removed the outline.
(audio::-webkit-media-controls-time-remaining-display)
(video::-webkit-media-controls-time-remaining-display): Removed
the display.
(audio::-webkit-media-controls-current-time-display)
(video::-webkit-media-controls-current-time-display): Added the
display block.
(video::-webkit-media-controls-time-remaining-display): Set
display none.
(video::-webkit-media-controls-time-remaining-display.show): Set
display block.
(video::-webkit-media-controls-time-remaining-display.hidden): Set
display none.
(audio::-webkit-media-controls-timeline)
(video::-webkit-media-controls-timeline): Removed outline.
(audio::-webkit-media-controls-volume-slider-container)
(video::-webkit-media-controls-volume-slider-container): Set
overflow hidden and set a transition by height.
(video::-webkit-media-controls-volume-slider-container.hidden):
Set height 0.
(video::-webkit-media-controls-volume-slider-container.down): Set
bottom to be below the panel. Changed the border radius and
transition accordingly.
(video::-webkit-media-controls-panel .hidden.down): Sets default
bottom as 0.
(audio::-webkit-media-controls-volume-slider)
(video::-webkit-media-controls-volume-slider): Removed the outline.
(audio::-webkit-media-controls-toggle-closed-captions-button)
(video::-webkit-media-controls-toggle-closed-captions-button):
Removed the background that is painted from C++ and removed the
outline.
(video::-webkit-media-controls-closed-captions-container):
(video::-webkit-media-controls-closed-captions-container h3):
(video::-webkit-media-controls-closed-captions-container ul):
(video::-webkit-media-controls-closed-captions-container li):
(video::-webkit-media-controls-closed-captions-container li.selected): Changed
the style to make it more coherent with the rest of the controls.
(audio::-webkit-media-controls-fullscreen-button)
(video::-webkit-media-controls-fullscreen-button): Removed the outline.
(audio::-webkit-media-controls-panel button.hidden): Sets the
display to none.

  • html/HTMLMediaElement.cpp: UserAgentScripts.h is not needed here

and build cmake build would need for changes to get this compiled.

  • platform/gtk/RenderThemeGtk.cpp:

(WebCore::nodeHasPseudo): Added. Checks if a node has a certain
pseudo.
(WebCore::nodeHasClass): Added. Checks if a node has a certain
class.
(WebCore::supportsFocus): Removed some element types as outline is
now handled in CSS.
(WebCore::RenderThemeGtk::paintMediaPlayButton): Checks if the
play button has the class paused to show the play icon instead of
the pause one.
(WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
Added. Paints the captions icon.
(WebCore::RenderThemeGtk::mediaControlsScript): Added. Loads the
bundled scripts.

  • platform/gtk/RenderThemeGtk.h: Added the mediaControlsScript

method and declared the redefinition of the method to play the
captions icon.

LayoutTests:

Tests infrastructure for the media controls script.

  • media/click-volume-bar-not-pausing.html:
  • media/media-volume-slider-rendered-normal.html:
  • media/video-controls-captions-trackmenu-hide-on-click-outside.html:
  • media/video-volume-slider.html: Fixed.
  • platform/gtk-wk2/TestExpectations: Tests flagged.
  • platform/gtk/TestExpectations: Changed tests flags.
  • platform/gtk/accessibility/media-element-expected.txt:
  • platform/gtk/fast/hidpi/video-controls-in-hidpi-expected.txt:
  • platform/gtk/fast/layers/video-layer-expected.txt: Rebaseline.
  • platform/gtk/fullscreen/video-controls-override-expected.txt: Added.
  • platform/gtk/http/tests/media/video-buffered-range-contains-currentTime-expected.png:
  • platform/gtk/media/audio-controls-rendering-expected.png:
  • platform/gtk/media/audio-controls-rendering-expected.txt:
  • platform/gtk/media/audio-repaint-expected.txt:
  • platform/gtk/media/controls-after-reload-expected.png:
  • platform/gtk/media/controls-after-reload-expected.txt:
  • platform/gtk/media/controls-strict-expected.png:
  • platform/gtk/media/controls-strict-expected.txt:
  • platform/gtk/media/controls-styling-strict-expected.png:
  • platform/gtk/media/controls-styling-strict-expected.txt:
  • platform/gtk/media/controls-without-preload-expected.png:
  • platform/gtk/media/controls-without-preload-expected.txt:
  • platform/gtk/media/video-controls-rendering-expected.png:
  • platform/gtk/media/video-controls-rendering-expected.txt:
  • platform/gtk/media/video-display-toggle-expected.png:
  • platform/gtk/media/video-display-toggle-expected.txt:
  • platform/gtk/media/video-empty-source-expected.txt:
  • platform/gtk/media/video-no-audio-expected.png:
  • platform/gtk/media/video-no-audio-expected.txt:
  • platform/gtk/media/video-volume-slider-expected.png:
  • platform/gtk/media/video-volume-slider-expected.txt:
  • platform/gtk/media/video-zoom-controls-expected.png:
  • platform/gtk/media/video-zoom-controls-expected.txt:

Rebaseline.

Location:
trunk
Files:
2 added
51 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r163970 r164024  
     12014-02-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        [GTK] MEDIA_CONTROLS_SCRIPT support
     4        https://bugs.webkit.org/show_bug.cgi?id=123097
     5
     6        Reviewed by Jer Noble.
     7
     8        Part of the Autotools and CMake structure to build the media
     9        controls script.
     10
     11        * Source/autotools/SetupWebKitFeatures.m4: Activated the media
     12        controls script by default.
     13        * Source/cmake/OptionsGTK.cmake: Activated the media controls
     14        script by default.
     15        * Source/cmake/WebKitFeatures.cmake: Created the option to
     16        activate the controls script.
     17        * Source/cmakeconfig.h.cmake: Created the define template the the
     18        media controls script.
     19
    1202014-02-12  Zan Dobersek  <zdobersek@igalia.com>
    221
  • trunk/LayoutTests/ChangeLog

    r164019 r164024  
     12014-02-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        [GTK] MEDIA_CONTROLS_SCRIPT support
     4        https://bugs.webkit.org/show_bug.cgi?id=123097
     5
     6        Reviewed by Jer Noble.
     7
     8        Tests infrastructure for the media controls script.
     9
     10        * media/click-volume-bar-not-pausing.html:
     11        * media/media-volume-slider-rendered-normal.html:
     12        * media/video-controls-captions-trackmenu-hide-on-click-outside.html:
     13        * media/video-volume-slider.html: Fixed.
     14        * platform/gtk-wk2/TestExpectations: Tests flagged.
     15        * platform/gtk/TestExpectations: Changed tests flags.
     16        * platform/gtk/accessibility/media-element-expected.txt:
     17        * platform/gtk/fast/hidpi/video-controls-in-hidpi-expected.txt:
     18        * platform/gtk/fast/layers/video-layer-expected.txt: Rebaseline.
     19        * platform/gtk/fullscreen/video-controls-override-expected.txt: Added.
     20        * platform/gtk/http/tests/media/video-buffered-range-contains-currentTime-expected.png:
     21        * platform/gtk/media/audio-controls-rendering-expected.png:
     22        * platform/gtk/media/audio-controls-rendering-expected.txt:
     23        * platform/gtk/media/audio-repaint-expected.txt:
     24        * platform/gtk/media/controls-after-reload-expected.png:
     25        * platform/gtk/media/controls-after-reload-expected.txt:
     26        * platform/gtk/media/controls-strict-expected.png:
     27        * platform/gtk/media/controls-strict-expected.txt:
     28        * platform/gtk/media/controls-styling-strict-expected.png:
     29        * platform/gtk/media/controls-styling-strict-expected.txt:
     30        * platform/gtk/media/controls-without-preload-expected.png:
     31        * platform/gtk/media/controls-without-preload-expected.txt:
     32        * platform/gtk/media/video-controls-rendering-expected.png:
     33        * platform/gtk/media/video-controls-rendering-expected.txt:
     34        * platform/gtk/media/video-display-toggle-expected.png:
     35        * platform/gtk/media/video-display-toggle-expected.txt:
     36        * platform/gtk/media/video-empty-source-expected.txt:
     37        * platform/gtk/media/video-no-audio-expected.png:
     38        * platform/gtk/media/video-no-audio-expected.txt:
     39        * platform/gtk/media/video-volume-slider-expected.png:
     40        * platform/gtk/media/video-volume-slider-expected.txt:
     41        * platform/gtk/media/video-zoom-controls-expected.png:
     42        * platform/gtk/media/video-zoom-controls-expected.txt:
     43        Rebaseline.
     44
    1452014-02-12  Ryosuke Niwa  <rniwa@webkit.org>
    246
  • trunk/LayoutTests/media/click-volume-bar-not-pausing.html

    r156699 r164024  
    7171                }
    7272
     73                internals.suspendAnimations(); // Volumebar can be animated and we would need a timeout to have it shown.
     74
     75                mediaElement.volume = 1;
     76
    7377                waitForEventAndFail("error");
    7478                waitForEventOnce('playing', playing);
  • trunk/LayoutTests/media/media-volume-slider-rendered-normal.html

    r120416 r164024  
    1818        function init()
    1919        {
     20            internals.suspendAnimations(); // Volumebar can be animated and we would need a timeout to have it shown.
    2021            video = document.getElementsByTagName("video")[0];
    2122            video.src = findMediaFile("video", "content/test");
  • trunk/LayoutTests/media/video-controls-captions-trackmenu-hide-on-click-outside.html

    r150371 r164024  
    4545                video.src = findMediaFile('video', 'content/test');
    4646                waitForEvent('canplaythrough', function () { startTrackMenuTest(startTest); });
     47
     48                internals.suspendAnimations(); // Captions menu can be animated and allowing the animation can create flakyness.
    4749            }
    4850        </script>
  • trunk/LayoutTests/media/video-volume-slider.html

    r154941 r164024  
    1111            if (window.testRunner)
    1212                testRunner.waitUntilDone();
     13
     14            internals.suspendAnimations(); // Volumebar can be animated and we would need a timeout to have it shown.
    1315
    1416            video = document.getElementsByTagName("video")[0];
  • trunk/LayoutTests/platform/gtk-wk2/TestExpectations

    r163749 r164024  
    475475Bug(GTK) fast/media/view-mode-media-feature.html [ ImageOnlyFailure ]
    476476
     477Bug(GTK) media/video-volume-slider.html [ ImageOnlyFailure ]
     478
    477479#////////////////////////////////////////////////////////////////////////////////////////
    478480# End of Tests failing
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r164013 r164024  
    442442
    443443# New chromium based controls
    444 webkit.org/b/107825 fullscreen/video-controls-drag.html [ Failure ]
    445444webkit.org/b/107825 media/audio-delete-while-step-button-clicked.html [ Failure ]
    446 webkit.org/b/107825 media/media-volume-slider-rendered-below.html [ Failure ]
    447445webkit.org/b/107825 media/nodesFromRect-shadowContent.html [ Failure ]
    448446webkit.org/b/107825 media/video-controls-fullscreen-volume.html [ Failure ]
     
    994992
    995993# GTK is moving from toggle button to a menu of tracks.
    996 webkit.org/b/101670 media/video-controls-captions-trackmenu.html [ Failure ]
     994webkit.org/b/101670 media/video-controls-captions-trackmenu.html [ Timeout Failure ]
    997995webkit.org/b/101670 media/track/track-user-preferences.html [ Failure ]
    998996webkit.org/b/101670 media/video-controls-captions-trackmenu-includes-enabled-track.html [ Failure ]
     
    14851483
    14861484webkit.org/b/124509 media/video-controls-captions-trackmenu-hide-on-click-outside.html [ Failure ]
    1487 webkit.org/b/124509 media/video-controls-captions-trackmenu-hide-on-click.html [ Failure ]
     1485webkit.org/b/124509 media/video-controls-captions-trackmenu-hide-on-click.html [ Timeout Failure ]
    14881486
    14891487webkit.org/b/124566 fast/dom/SelectorAPI/resig-SelectorsAPI-test.xhtml [ Failure ]
     
    15151513
    15161514webkit.org/b/126519 inspector-protocol/model/highlight-shape-outside-margin.html [ Failure ]
    1517 
    1518 webkit.org/b/126520 media/click-volume-bar-not-pausing.html [ Failure ]
    15191515
    15201516webkit.org/b/126521 accessibility/menu-list-sends-change-notification.html [ Failure ]
     
    15481544# End of subpixel failures.
    15491545
     1546# After webkit.org/b/123097 we flag these tests that also fail in mac
     1547webkit.org/b/123097 media/track/track-cue-mutable-text.html [ Failure ]
     1548webkit.org/b/123097 media/video-controls-captions-trackmenu-sorted.html [ Failure ]
     1549webkit.org/b/123097 media/video-controls-toggling.html [ Timeout ]
     1550
    15501551#////////////////////////////////////////////////////////////////////////////////////////
    15511552# End of Tests failing
  • trunk/LayoutTests/platform/gtk/accessibility/media-element-expected.txt

    r158841 r164024  
    1010
    1111
    12         description: AXDescription: video playback
     12        description: AXDescription: Video Playback
    1313        role: AXRole: AXToolbar
    1414
    1515
    16             description: AXDescription: video playback
    17             role: AXRole: AXToolbar
     16            description: AXDescription: Play
     17            role: AXRole: AXButton
    1818
    1919
    20                 description: AXDescription: play
    21                 role: AXRole: AXButton
     20            description: AXDescription: Duration
     21            role: AXRole: AXSlider
    2222
    2323
    24                 description: AXDescription:
    25                 role: AXRole: AXSlider
     24            description: AXDescription: Remaining
     25            role: AXRole: AXTimer
    2626
    2727
    28                 description: AXDescription: enter fullscreen
    29                 role: AXRole: AXButton
     28            description: AXDescription: Display Full Screen
     29            role: AXRole: AXButton
    3030
    3131
    32                 description: AXDescription: mute
    33                 role: AXRole: AXButton
     32            description: AXDescription: Mute
     33            role: AXRole: AXButton
     34
     35
     36            description: AXDescription: Volume
     37            role: AXRole: AXSlider
    3438
    3539
  • trunk/LayoutTests/platform/gtk/fast/hidpi/video-controls-in-hidpi-expected.txt

    r148821 r164024  
    1616layer at (13,140) size 290x30
    1717  RenderFlexibleBox {DIV} at (5,5) size 290x30 [bgcolor=#141414CC]
    18     RenderButton {INPUT} at (9,0) size 30x30
     18    RenderButton {BUTTON} at (9,0) size 30x30
    1919    RenderSlider {INPUT} at (49,11) size 179x8 [color=#E6E6E659]
    2020      RenderFlexibleBox {DIV} at (0,0) size 179x8 [border: (1px solid #E6E6E659)]
  • trunk/LayoutTests/platform/gtk/fast/layers/video-layer-expected.txt

    r148819 r164024  
    2121layer at (64,224) size 290x30
    2222  RenderFlexibleBox {DIV} at (5,5) size 290x30 [bgcolor=#141414CC]
    23     RenderButton {INPUT} at (9,0) size 30x30
     23    RenderButton {BUTTON} at (9,0) size 30x30
    2424    RenderSlider {INPUT} at (49,11) size 179x8 [color=#E6E6E659]
    2525      RenderFlexibleBox {DIV} at (0,0) size 179x8 [border: (1px solid #E6E6E659)]
  • trunk/LayoutTests/platform/gtk/media/audio-controls-rendering-expected.txt

    r148815 r164024  
    2020layer at (8,41) size 300x30
    2121  RenderFlexibleBox {DIV} at (0,0) size 300x30 [bgcolor=#141414CC]
    22     RenderButton {INPUT} at (9,0) size 30x30
     22    RenderButton {BUTTON} at (9,0) size 30x30
    2323    RenderSlider {INPUT} at (49,11) size 157x8 [color=#E6E6E659]
    2424      RenderFlexibleBox {DIV} at (0,0) size 157x8 [border: (1px solid #E6E6E659)]
     
    2828      RenderText {#text} at (0,7) size 32x15
    2929        text run at (0,7) width 32: "00:07"
    30     RenderButton {INPUT} at (261,0) size 30x30
     30    RenderFlexibleBox {DIV} at (261,0) size 30x30
     31      RenderButton {BUTTON} at (0,0) size 30x30
    3132layer at (8,88) size 320x30
    3233  RenderFlexibleBox {DIV} at (0,0) size 320x30
     
    3435layer at (8,88) size 320x30
    3536  RenderFlexibleBox {DIV} at (0,0) size 320x30 [bgcolor=#141414CC]
    36     RenderButton {INPUT} at (9,0) size 30x30
     37    RenderButton {BUTTON} at (9,0) size 30x30
    3738    RenderSlider {INPUT} at (49,11) size 177x8 [color=#E6E6E659]
    3839      RenderFlexibleBox {DIV} at (0,0) size 177x8 [border: (1px solid #E6E6E659)]
     
    4243      RenderText {#text} at (0,7) size 32x15
    4344        text run at (0,7) width 32: "00:07"
    44     RenderButton {INPUT} at (281,0) size 30x30
     45    RenderFlexibleBox {DIV} at (281,0) size 30x30
     46      RenderButton {BUTTON} at (0,0) size 30x30
    4547layer at (8,135) size 320x100
    4648  RenderMedia {AUDIO} at (8,135) size 320x100 [bgcolor=#0000FF]
     
    5052layer at (8,205) size 320x30
    5153  RenderFlexibleBox {DIV} at (0,0) size 320x30 [bgcolor=#141414CC]
    52     RenderButton {INPUT} at (9,0) size 30x30
     54    RenderButton {BUTTON} at (9,0) size 30x30
    5355    RenderSlider {INPUT} at (49,11) size 177x8 [color=#E6E6E659]
    5456      RenderFlexibleBox {DIV} at (0,0) size 177x8 [border: (1px solid #E6E6E659)]
     
    5860      RenderText {#text} at (0,7) size 32x15
    5961        text run at (0,7) width 32: "00:07"
    60     RenderButton {INPUT} at (281,0) size 30x30
     62    RenderFlexibleBox {DIV} at (281,0) size 30x30
     63      RenderButton {BUTTON} at (0,0) size 30x30
  • trunk/LayoutTests/platform/gtk/media/audio-repaint-expected.txt

    r148815 r164024  
    2020layer at (8,71) size 300x30
    2121  RenderFlexibleBox {DIV} at (0,0) size 300x30 [bgcolor=#141414CC]
    22     RenderButton {INPUT} at (9,0) size 30x30
     22    RenderButton {BUTTON} at (9,0) size 30x30
    2323    RenderSlider {INPUT} at (49,11) size 115x8 [color=#E6E6E659]
    2424      RenderFlexibleBox {DIV} at (0,0) size 115x8 [border: (1px solid #E6E6E659)]
     
    2828      RenderText {#text} at (0,7) size 74x15
    2929        text run at (0,7) width 74: "00:00 / 00:01"
    30     RenderButton {INPUT} at (261,0) size 30x30
     30    RenderFlexibleBox {DIV} at (261,0) size 30x30
     31      RenderButton {BUTTON} at (0,0) size 30x30
    3132layer at (8,41) size 300x30
    3233  RenderFlexibleBox {DIV} at (0,0) size 300x30
     
    3435layer at (8,41) size 300x30
    3536  RenderFlexibleBox {DIV} at (0,0) size 300x30 [bgcolor=#141414CC]
    36     RenderButton {INPUT} at (9,0) size 30x30
     37    RenderButton {BUTTON} at (9,0) size 30x30
    3738    RenderSlider {INPUT} at (49,11) size 115x8 [color=#E6E6E659]
    3839      RenderFlexibleBox {DIV} at (0,0) size 115x8 [border: (1px solid #E6E6E659)]
     
    4243      RenderText {#text} at (0,7) size 74x15
    4344        text run at (0,7) width 74: "00:00 / 00:01"
    44     RenderButton {INPUT} at (261,0) size 30x30
     45    RenderFlexibleBox {DIV} at (261,0) size 30x30
     46      RenderButton {BUTTON} at (0,0) size 30x30
    4547layer at (8,153) size 300x30
    4648  RenderMedia {AUDIO} at (0,112) size 300x30
     
    5052layer at (8,153) size 300x30
    5153  RenderFlexibleBox {DIV} at (0,0) size 300x30 [bgcolor=#141414CC]
    52     RenderButton {INPUT} at (9,0) size 30x30
     54    RenderButton {BUTTON} at (9,0) size 30x30
    5355    RenderSlider {INPUT} at (49,11) size 115x8 [color=#E6E6E659]
    5456      RenderFlexibleBox {DIV} at (0,0) size 115x8 [border: (1px solid #E6E6E659)]
     
    5860      RenderText {#text} at (0,7) size 74x15
    5961        text run at (0,7) width 74: "00:00 / 00:01"
    60     RenderButton {INPUT} at (261,0) size 30x30
     62    RenderFlexibleBox {DIV} at (261,0) size 30x30
     63      RenderButton {BUTTON} at (0,0) size 30x30
  • trunk/LayoutTests/platform/gtk/media/controls-after-reload-expected.txt

    r148815 r164024  
    1616layer at (13,246) size 310x30
    1717  RenderFlexibleBox {DIV} at (5,5) size 310x30 [bgcolor=#141414CC]
    18     RenderButton {INPUT} at (9,0) size 30x30
     18    RenderButton {BUTTON} at (9,0) size 30x30
    1919    RenderSlider {INPUT} at (49,11) size 93x8 [color=#E6E6E659]
    2020      RenderFlexibleBox {DIV} at (0,0) size 93x8 [border: (1px solid #E6E6E659)]
     
    2424      RenderText {#text} at (0,7) size 74x15
    2525        text run at (0,7) width 74: "00:00 / 00:06"
    26     RenderButton {INPUT} at (239,0) size 30x30
    27     RenderButton {INPUT} at (271,0) size 30x30
     26    RenderButton {BUTTON} at (239,0) size 30x30
     27    RenderFlexibleBox {DIV} at (271,0) size 30x30
     28      RenderButton {BUTTON} at (0,0) size 30x30
  • trunk/LayoutTests/platform/gtk/media/controls-strict-expected.txt

    r148815 r164024  
    1616layer at (13,254) size 310x30
    1717  RenderFlexibleBox {DIV} at (5,5) size 310x30 [bgcolor=#141414CC]
    18     RenderButton {INPUT} at (9,0) size 30x30
     18    RenderButton {BUTTON} at (9,0) size 30x30
    1919    RenderSlider {INPUT} at (49,11) size 93x8 [color=#E6E6E659]
    2020      RenderFlexibleBox {DIV} at (0,0) size 93x8 [border: (1px solid #E6E6E659)]
     
    2424      RenderText {#text} at (0,7) size 74x15
    2525        text run at (0,7) width 74: "00:00 / 00:06"
    26     RenderButton {INPUT} at (239,0) size 30x30
    27     RenderButton {INPUT} at (271,0) size 30x30
     26    RenderButton {BUTTON} at (239,0) size 30x30
     27    RenderFlexibleBox {DIV} at (271,0) size 30x30
     28      RenderButton {BUTTON} at (0,0) size 30x30
  • trunk/LayoutTests/platform/gtk/media/controls-styling-strict-expected.txt

    r148815 r164024  
    2020layer at (13,254) size 310x30
    2121  RenderFlexibleBox {DIV} at (5,5) size 310x30 [bgcolor=#141414CC]
    22     RenderButton {INPUT} at (9,0) size 30x30
     22    RenderButton {BUTTON} at (9,0) size 30x30
    2323    RenderSlider {INPUT} at (49,11) size 93x8 [color=#E6E6E659]
    2424      RenderFlexibleBox {DIV} at (0,0) size 93x8 [border: (1px solid #E6E6E659)]
     
    2828      RenderText {#text} at (0,7) size 74x15
    2929        text run at (0,7) width 74: "00:00 / 00:06"
    30     RenderButton {INPUT} at (239,0) size 30x30
    31     RenderButton {INPUT} at (271,0) size 30x30
     30    RenderButton {BUTTON} at (239,0) size 30x30
     31    RenderFlexibleBox {DIV} at (271,0) size 30x30
     32      RenderButton {BUTTON} at (0,0) size 30x30
    3233layer at (332,49) size 320x240
    3334  RenderFlexibleBox {DIV} at (0,0) size 320x240
     
    3536layer at (337,254) size 310x30
    3637  RenderFlexibleBox {DIV} at (5,5) size 310x30 [bgcolor=#141414CC]
    37     RenderButton {INPUT} at (9,0) size 30x30
     38    RenderButton {BUTTON} at (9,0) size 30x30
    3839    RenderSlider {INPUT} at (49,11) size 93x8 [color=#E6E6E659]
    3940      RenderFlexibleBox {DIV} at (0,0) size 93x8 [border: (1px solid #E6E6E659)]
     
    4344      RenderText {#text} at (0,7) size 74x15
    4445        text run at (0,7) width 74: "00:00 / 00:06"
    45     RenderButton {INPUT} at (239,0) size 30x30
    46     RenderButton {INPUT} at (271,0) size 30x30
     46    RenderButton {BUTTON} at (239,0) size 30x30
     47    RenderFlexibleBox {DIV} at (271,0) size 30x30
     48      RenderButton {BUTTON} at (0,0) size 30x30
  • trunk/LayoutTests/platform/gtk/media/controls-without-preload-expected.txt

    r148815 r164024  
    1616layer at (13,246) size 310x30
    1717  RenderFlexibleBox {DIV} at (5,5) size 310x30 [bgcolor=#141414CC]
    18     RenderButton {INPUT} at (9,0) size 30x30
     18    RenderButton {BUTTON} at (9,0) size 30x30
    1919    RenderSlider {INPUT} at (49,11) size 93x8 [color=#E6E6E659]
    2020      RenderFlexibleBox {DIV} at (0,0) size 93x8 [border: (1px solid #E6E6E659)]
     
    2424      RenderText {#text} at (0,7) size 74x15
    2525        text run at (0,7) width 74: "00:00 / 00:06"
    26     RenderButton {INPUT} at (239,0) size 30x30
    27     RenderButton {INPUT} at (271,0) size 30x30
     26    RenderButton {BUTTON} at (239,0) size 30x30
     27    RenderFlexibleBox {DIV} at (271,0) size 30x30
     28      RenderButton {BUTTON} at (0,0) size 30x30
  • trunk/LayoutTests/platform/gtk/media/video-controls-rendering-expected.txt

    r148815 r164024  
    2121layer at (13,246) size 310x30
    2222  RenderFlexibleBox {DIV} at (5,5) size 310x30 [bgcolor=#141414CC]
    23     RenderButton {INPUT} at (9,0) size 30x30
     23    RenderButton {BUTTON} at (9,0) size 30x30
    2424    RenderSlider {INPUT} at (49,11) size 93x8 [color=#E6E6E659]
    2525      RenderFlexibleBox {DIV} at (0,0) size 93x8 [border: (1px solid #E6E6E659)]
     
    2929      RenderText {#text} at (0,7) size 74x15
    3030        text run at (0,7) width 74: "00:00 / 00:06"
    31     RenderButton {INPUT} at (239,0) size 30x30
    32     RenderButton {INPUT} at (271,0) size 30x30
     31    RenderButton {BUTTON} at (239,0) size 30x30
     32    RenderFlexibleBox {DIV} at (271,0) size 30x30
     33      RenderButton {BUTTON} at (0,0) size 30x30
    3334layer at (8,281) size 320x240
    3435  RenderFlexibleBox {DIV} at (0,0) size 320x240
     
    3637layer at (13,486) size 310x30
    3738  RenderFlexibleBox {DIV} at (5,5) size 310x30 [bgcolor=#141414CC]
    38     RenderButton {INPUT} at (9,0) size 30x30
     39    RenderButton {BUTTON} at (9,0) size 30x30
    3940    RenderSlider {INPUT} at (49,11) size 93x8 [color=#E6E6E659]
    4041      RenderFlexibleBox {DIV} at (0,0) size 93x8 [border: (1px solid #E6E6E659)]
     
    4445      RenderText {#text} at (0,7) size 74x15
    4546        text run at (0,7) width 74: "00:00 / 00:06"
    46     RenderButton {INPUT} at (239,0) size 30x30
    47     RenderButton {INPUT} at (271,0) size 30x30
     47    RenderButton {BUTTON} at (239,0) size 30x30
     48    RenderFlexibleBox {DIV} at (271,0) size 30x30
     49      RenderButton {BUTTON} at (0,0) size 30x30
    4850layer at (8,521) size 320x240
    4951  RenderVideo {VIDEO} at (8,521) size 320x240
     
    5355layer at (13,726) size 310x30
    5456  RenderFlexibleBox {DIV} at (5,5) size 310x30 [bgcolor=#141414CC]
    55     RenderButton {INPUT} at (9,0) size 30x30
     57    RenderButton {BUTTON} at (9,0) size 30x30
    5658    RenderSlider {INPUT} at (49,11) size 93x8 [color=#E6E6E659]
    5759      RenderFlexibleBox {DIV} at (0,0) size 93x8 [border: (1px solid #E6E6E659)]
     
    6163      RenderText {#text} at (0,7) size 74x15
    6264        text run at (0,7) width 74: "00:00 / 00:06"
    63     RenderButton {INPUT} at (239,0) size 30x30
    64     RenderButton {INPUT} at (271,0) size 30x30
     65    RenderButton {BUTTON} at (239,0) size 30x30
     66    RenderFlexibleBox {DIV} at (271,0) size 30x30
     67      RenderButton {BUTTON} at (0,0) size 30x30
  • trunk/LayoutTests/platform/gtk/media/video-display-toggle-expected.txt

    r148815 r164024  
    1515layer at (13,230) size 310x30
    1616  RenderFlexibleBox {DIV} at (5,5) size 310x30 [bgcolor=#141414CC]
    17     RenderButton {INPUT} at (9,0) size 30x30
     17    RenderButton {BUTTON} at (9,0) size 30x30
    1818    RenderSlider {INPUT} at (49,11) size 135x8 [color=#E6E6E659]
    1919      RenderFlexibleBox {DIV} at (0,0) size 135x8 [border: (1px solid #E6E6E659)]
     
    2323      RenderText {#text} at (0,7) size 32x15
    2424        text run at (0,7) width 32: "00:06"
    25     RenderButton {INPUT} at (239,0) size 30x30
    26     RenderButton {INPUT} at (271,0) size 30x30
     25    RenderButton {BUTTON} at (239,0) size 30x30
     26    RenderFlexibleBox {DIV} at (271,0) size 30x30
     27      RenderButton {BUTTON} at (0,0) size 30x30
  • trunk/LayoutTests/platform/gtk/media/video-empty-source-expected.txt

    r148815 r164024  
    1616layer at (14,157) size 290x30
    1717  RenderFlexibleBox {DIV} at (5,5) size 290x30 [bgcolor=#141414CC]
    18     RenderButton {INPUT} at (9,0) size 30x30
     18    RenderButton {BUTTON} at (9,0) size 30x30
    1919    RenderSlider {INPUT} at (49,11) size 179x8 [color=#E6E6E659]
    2020      RenderFlexibleBox {DIV} at (0,0) size 179x8 [border: (1px solid #E6E6E659)]
  • trunk/LayoutTests/platform/gtk/media/video-no-audio-expected.txt

    r148815 r164024  
    1616layer at (13,294) size 342x30
    1717  RenderFlexibleBox {DIV} at (5,5) size 342x30 [bgcolor=#141414CC]
    18     RenderButton {INPUT} at (9,0) size 30x30
     18    RenderButton {BUTTON} at (9,0) size 30x30
    1919    RenderSlider {INPUT} at (49,11) size 199x8 [color=#E6E6E659]
    2020      RenderFlexibleBox {DIV} at (0,0) size 199x8 [border: (1px solid #E6E6E659)]
     
    2424      RenderText {#text} at (0,7) size 32x15
    2525        text run at (0,7) width 32: "00:09"
    26     RenderButton {INPUT} at (303,0) size 30x30
     26    RenderButton {BUTTON} at (303,0) size 30x30
  • trunk/LayoutTests/platform/gtk/media/video-volume-slider-expected.txt

    r154941 r164024  
    77        text run at (0,0) width 433: "Tests if the volume slider is rendererd properly. This test assumes the"
    88      RenderBR {BR} at (433,14) size 0x0
    9       RenderText {#text} at (0,17) size 453x17
    10         text run at (0,17) width 453: "volume slider is implemented and mouse over the right bottom corner of"
    11       RenderBR {BR} at (453,31) size 0x0
    12       RenderText {#text} at (0,34) size 270x17
    13         text run at (0,34) width 270: "video element will show the volume slider."
    14       RenderBR {BR} at (270,48) size 0x0
     9      RenderText {#text} at (0,18) size 453x17
     10        text run at (0,18) width 453: "volume slider is implemented and mouse over the right bottom corner of"
     11      RenderBR {BR} at (453,32) size 0x0
     12      RenderText {#text} at (0,36) size 270x17
     13        text run at (0,36) width 270: "video element will show the volume slider."
     14      RenderBR {BR} at (270,50) size 0x0
    1515      RenderText {#text} at (0,0) size 0x0
    16 layer at (8,59) size 320x240
    17   RenderVideo {VIDEO} at (0,51) size 320x240
    18 layer at (8,59) size 320x240
     16layer at (8,62) size 320x240
     17  RenderVideo {VIDEO} at (0,54) size 320x240
     18layer at (8,62) size 320x240
    1919  RenderFlexibleBox {DIV} at (0,0) size 320x240
    2020    RenderBlock {DIV} at (0,200) size 320x40
    21 layer at (13,264) size 310x30
     21layer at (13,267) size 310x30
    2222  RenderFlexibleBox {DIV} at (5,5) size 310x30 [bgcolor=#141414CC]
    23     RenderButton {INPUT} at (9,0) size 30x30
     23    RenderButton {BUTTON} at (9,0) size 30x30
    2424    RenderSlider {INPUT} at (49,11) size 135x8 [color=#E6E6E659]
    2525      RenderFlexibleBox {DIV} at (0,0) size 135x8 [border: (1px solid #E6E6E659)]
     
    2929      RenderText {#text} at (0,7) size 32x15
    3030        text run at (0,7) width 32: "00:06"
    31     RenderButton {INPUT} at (239,0) size 30x30
    32     RenderButton {INPUT} at (271,0) size 30x30
    33 layer at (284,164) size 30x100
    34   RenderBlock (positioned) zI: 2 {DIV} at (271,-100) size 30x100
     31    RenderButton {BUTTON} at (239,0) size 30x30
     32    RenderFlexibleBox {DIV} at (271,0) size 30x30
     33      RenderButton {BUTTON} at (0,0) size 30x30
     34layer at (284,167) size 30x100
     35  RenderBlock (positioned) zI: 2 {DIV} at (271,-100) size 30x100 [bgcolor=#141414CC]
    3536    RenderSlider {INPUT} at (11,10) size 8x80 [color=#E6E6E659]
    3637      RenderFlexibleBox {DIV} at (0,0) size 8x80 [border: (1px solid #E6E6E659)]
    3738        RenderBlock {DIV} at (-2,-6) size 12x92
    38           RenderBlock {DIV} at (0,24) size 12x13 [color=#FFFFFF]
     39          RenderBlock {DIV} at (0,24) size 12x12 [color=#FFFFFF]
  • trunk/LayoutTests/platform/gtk/media/video-zoom-controls-expected.txt

    r148815 r164024  
    1414layer at (65,211) size 225x45
    1515  RenderFlexibleBox {DIV} at (7,7) size 226x46 [bgcolor=#141414CC]
    16     RenderButton {INPUT} at (13,0) size 46x45
     16    RenderButton {BUTTON} at (13,0) size 46x45
    1717    RenderSlider {INPUT} at (73,16) size 38x13 [color=#E6E6E659]
    1818      RenderFlexibleBox {DIV} at (0,0) size 38x12 [border: (1px solid #E6E6E659)]
     
    2222      RenderText {#text} at (0,11) size 108x22
    2323        text run at (0,11) width 108: "00:00 / 00:06"
    24     RenderButton {INPUT} at (253,0) size 46x45
    25     RenderButton {INPUT} at (301,0) size 46x45
     24    RenderButton {BUTTON} at (253,0) size 46x45
     25    RenderFlexibleBox {DIV} at (301,0) size 46x45
     26      RenderButton {BUTTON} at (0,0) size 45x45
    2627layer at (57,308) size 240x180
    2728  RenderVideo {VIDEO} at (45,296) size 240x180
     
    3132layer at (65,436) size 225x45
    3233  RenderFlexibleBox {DIV} at (7,7) size 226x46 [bgcolor=#141414CC]
    33     RenderButton {INPUT} at (13,0) size 46x45
     34    RenderButton {BUTTON} at (13,0) size 46x45
    3435    RenderSlider {INPUT} at (73,16) size 38x13 [color=#E6E6E659]
    3536      RenderFlexibleBox {DIV} at (0,0) size 38x12 [border: (1px solid #E6E6E659)]
     
    3940      RenderText {#text} at (0,11) size 108x22
    4041        text run at (0,11) width 108: "00:00 / 00:06"
    41     RenderButton {INPUT} at (253,0) size 46x45
    42     RenderButton {INPUT} at (301,0) size 46x45
     42    RenderButton {BUTTON} at (253,0) size 46x45
     43    RenderFlexibleBox {DIV} at (301,0) size 46x45
     44      RenderButton {BUTTON} at (0,0) size 45x45
  • trunk/Source/WebCore/CMakeLists.txt

    r163987 r164024  
    77    "${WEBCORE_DIR}/Modules/indexeddb/leveldb"
    88    "${WEBCORE_DIR}/Modules/indieui"
     9    "${WEBCORE_DIR}/Modules/mediacontrols/"
    910    "${WEBCORE_DIR}/Modules/mediasource"
    1011    "${WEBCORE_DIR}/Modules/mediastream"
     
    185186    Modules/indexeddb/IDBVersionChangeEvent.idl
    186187    Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl
     188
     189    Modules/mediacontrols/MediaControlsHost.idl
    187190
    188191    Modules/mediasource/DOMURLMediaSource.idl
     
    832835    Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp
    833836
     837    Modules/mediacontrols/MediaControlsHost.cpp
     838
    834839    Modules/mediasource/DOMURLMediaSource.cpp
    835840    Modules/mediasource/MediaSource.cpp
     
    29842989set(IDL_ATTRIBUTES_FILE ${WEBCORE_DIR}/bindings/scripts/IDLAttributes.txt)
    29852990
    2986 include(${WEBCORE_DIR}/UseJSC.cmake)
    2987 
    29882991WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
    29892992
     
    31343137ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/StyleResolver.cpp UserAgentStyleSheetsData.cpp UserAgentStyleSheets.h)
    31353138
     3139if (WebCore_USER_AGENT_SCRIPTS)
     3140    # Necessary variables:
     3141    # WebCore_USER_AGENT_SCRIPTS containing the JavaScript sources list
     3142    # WebCore_USER_AGENT_SCRIPTS_DEPENDENCIES containing the source file that will load the scripts to add the proper
     3143    #   dependency and having them built at the right moment
     3144
     3145    add_custom_command(
     3146        OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/UserAgentScriptsData.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/UserAgentScripts.h
     3147        MAIN_DEPENDENCY ${WEBCORE_DIR}/Scripts/make-js-file-arrays.py
     3148        DEPENDS ${WebCore_USER_AGENT_SCRIPTS}
     3149        COMMAND "PYTHONPATH=${WebCore_INSPECTOR_SCRIPTS_DIR}" ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/Scripts/make-js-file-arrays.py ${DERIVED_SOURCES_WEBCORE_DIR}/UserAgentScripts.h ${DERIVED_SOURCES_WEBCORE_DIR}/UserAgentScriptsData.cpp ${WebCore_USER_AGENT_SCRIPTS}
     3150        VERBATIM)
     3151    list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/UserAgentScriptsData.cpp)
     3152    ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${WebCore_USER_AGENT_SCRIPTS_DEPENDENCIES} UserAgentScriptsData.cpp UserAgentScripts.h)
     3153endif ()
     3154
    31363155# Generate plug-in resources
    31373156add_custom_command(
     
    31523171
    31533172
     3173include(${WEBCORE_DIR}/UseJSC.cmake)
    31543174
    31553175ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLTreeBuilder.cpp MathMLNames.cpp)
  • trunk/Source/WebCore/ChangeLog

    r164008 r164024  
     12014-02-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        [GTK] MEDIA_CONTROLS_SCRIPT support
     4        https://bugs.webkit.org/show_bug.cgi?id=123097
     5
     6        Reviewed by Jer Noble.
     7
     8        WebKitGTK+ multimedia controls are now managed from Javascript
     9        code. Apple controls are kept as common code and GTK+ ones are
     10        subclassed for the specific behavior.
     11
     12        Both CMake and Autotools build support is provided.
     13
     14        * CMakeLists.txt: Added support to build the media controls
     15        script and their associated files.
     16        * GNUmakefile.am: Added support to generate the C++ code from the
     17        Javascript.
     18        * GNUmakefile.list.am: Added the media controls script associated
     19        files.
     20        * Modules/mediacontrols/MediaControlsHost.cpp:
     21        * Modules/mediacontrols/MediaControlsHost.h:
     22        * Modules/mediacontrols/MediaControlsHost.idl:
     23        (WebCore::MediaControlsHost::supportsFullscreen): Added attribute
     24        to know if the element supports fullscreen.
     25        * Modules/mediacontrols/mediaControlsApple.js:
     26        (Controller.prototype.handleWrapperMouseMove):
     27        (Controller.prototype.handleWrapperMouseOut):
     28        (Controller.prototype.updatePlaying): Use clear and
     29        resetHideControlsTimer.
     30        (Controller.prototype.clearHideControlsTimer): Added.
     31        (Controller.prototype.resetHideControlsTimer): Added.
     32        * Modules/mediacontrols/mediaControlsGtk.js: Added.
     33        (createControls): Calls ControllerGtk.
     34        (ControllerGtk): Calls the superclass.
     35        (contains): Defines a function to know if an object is contained
     36        in an array.
     37        (ControllerGtk.prototype.inheritFrom): Copies the method of the
     38        superclass that are not reimplemented in the subclass.
     39        (ControllerGtk.prototype.createControls): Calls the superclass and
     40        create the remaining needed elements.
     41        (ControllerGtk.prototype.configureInlineControls): Configures the
     42        controls.
     43        (ControllerGtk.prototype.setStatusHidden): Redefined empty.
     44        (ControllerGtk.prototype.updateTime): Writes the duration and
     45        current position. As it was so far, current time also includes
     46        duration. If current time is bigger than 0 we show that.
     47        (ControllerGtk.prototype.showCurrentTime): Shows current time and
     48        hides duration label (that is included in current time).
     49        (ControllerGtk.prototype.handlePlay): Calls the superclass and
     50        force showing the current time.
     51        (ControllerGtk.prototype.handleTimeUpdate): Always update the
     52        time.
     53        (ControllerGtk.prototype.handleMuteButtonMouseOver): Shows the
     54        volume slider.
     55        (ControllerGtk.prototype.handleVolumeBoxMouseOut): Hides the
     56        volume slider.
     57        (ControllerGtk.prototype.addControls): Adds the enclosure instead
     58        of the panel directly. Panel is, of course, part of the enclosure.
     59        (ControllerGtk.prototype.updateReadyState): Shows the fullscreen
     60        button only if fullscreen is supported. Sets the volume in up or
     61        down mode depending on its position in the document. Updates the
     62        volume.
     63        (ControllerGtk.prototype.setControlsType): Creates the controls it
     64        they were not created before. Unlike Apple ones, WebKitGTK+
     65        fullscreen and inline controls are the same.
     66        (ControllerGtk.prototype.updatePlaying): Calls the superclass and
     67        shows the controls if not playing.
     68        (ControllerGtk.prototype.handleCaptionButtonClicked): Redefined
     69        empty. To be coherent with volume, that also shows a popup, this
     70        is handled with mouseover instead of click.
     71        (ControllerGtk.prototype.buildCaptionMenu): Calls the superclass
     72        to build the menu, sets some listeners, centers the popup with the
     73        captions button, keeps the current height and sets the style to 0,
     74        which is needed to animate it.
     75        (ControllerGtk.prototype.destroyCaptionMenu): Hides the caption menu.
     76        (ControllerGtk.prototype.showCaptionMenu): Resets the height to
     77        its original. We don't animate it with CSS because we would need
     78        to specify a height in the style and we don't know it in advance.
     79        (ControllerGtk.prototype.hideCaptionMenu): Sets height to 0.
     80        (ControllerGtk.prototype.captionMenuTransitionEnd): When the
     81        captions menu transtition ends, it is destroyed.
     82        (ControllerGtk.prototype.handleCaptionButtonMouseOver): Creates
     83        the caption menu and shows it.
     84        (ControllerGtk.prototype.handleCaptionButtonMouseOut): Hides the
     85        captions menu.
     86        (ControllerGtk.prototype.handleCaptionMouseOut): Hides the
     87        captions menu.
     88        * PlatformGTK.cmake: Added WebCore to the target link libraries
     89        and initialized the variables needed at CMakelists.txt
     90        * css/mediaControlsGtk.css:
     91        (audio::-webkit-media-controls-panel)
     92        (video::-webkit-media-controls-panel): Added transtion based on opacity.
     93        (video::-webkit-media-controls-panel): Set video opacity to 0.
     94        (video::-webkit-media-controls-panel.paused): Set video opacity to 1.
     95        (audio::-webkit-media-controls-panel div.mute-box): Set the same
     96        style as the mute button to preserve the layout.
     97        (audio::-webkit-media-controls-panel div.mute-box.hidden): Sets
     98        the display to none.
     99        (audio::-webkit-media-controls-mute-button)
     100        (video::-webkit-media-controls-mute-button): Removed the outline
     101        and the margin that is managed by the mute box now.
     102        (audio::-webkit-media-controls-play-button)
     103        (video::-webkit-media-controls-play-button): Removed the outline.
     104        (audio::-webkit-media-controls-time-remaining-display)
     105        (video::-webkit-media-controls-time-remaining-display): Removed
     106        the display.
     107        (audio::-webkit-media-controls-current-time-display)
     108        (video::-webkit-media-controls-current-time-display): Added the
     109        display block.
     110        (video::-webkit-media-controls-time-remaining-display): Set
     111        display none.
     112        (video::-webkit-media-controls-time-remaining-display.show): Set
     113        display block.
     114        (video::-webkit-media-controls-time-remaining-display.hidden): Set
     115        display none.
     116        (audio::-webkit-media-controls-timeline)
     117        (video::-webkit-media-controls-timeline): Removed outline.
     118        (audio::-webkit-media-controls-volume-slider-container)
     119        (video::-webkit-media-controls-volume-slider-container): Set
     120        overflow hidden and set a transition by height.
     121        (video::-webkit-media-controls-volume-slider-container.hidden):
     122        Set height 0.
     123        (video::-webkit-media-controls-volume-slider-container.down): Set
     124        bottom to be below the panel. Changed the border radius and
     125        transition accordingly.
     126        (video::-webkit-media-controls-panel .hidden.down): Sets default
     127        bottom as 0.
     128        (audio::-webkit-media-controls-volume-slider)
     129        (video::-webkit-media-controls-volume-slider): Removed the outline.
     130        (audio::-webkit-media-controls-toggle-closed-captions-button)
     131        (video::-webkit-media-controls-toggle-closed-captions-button):
     132        Removed the background that is painted from C++ and removed the
     133        outline.
     134        (video::-webkit-media-controls-closed-captions-container):
     135        (video::-webkit-media-controls-closed-captions-container h3):
     136        (video::-webkit-media-controls-closed-captions-container ul):
     137        (video::-webkit-media-controls-closed-captions-container li):
     138        (video::-webkit-media-controls-closed-captions-container li.selected): Changed
     139        the style to make it more coherent with the rest of the controls.
     140        (audio::-webkit-media-controls-fullscreen-button)
     141        (video::-webkit-media-controls-fullscreen-button): Removed the outline.
     142        (audio::-webkit-media-controls-panel button.hidden): Sets the
     143        display to none.
     144        * html/HTMLMediaElement.cpp: UserAgentScripts.h is not needed here
     145        and build cmake build would need for changes to get this compiled.
     146        * platform/gtk/RenderThemeGtk.cpp:
     147        (WebCore::nodeHasPseudo): Added. Checks if a node has a certain
     148        pseudo.
     149        (WebCore::nodeHasClass): Added. Checks if a node has a certain
     150        class.
     151        (WebCore::supportsFocus): Removed some element types as outline is
     152        now handled in CSS.
     153        (WebCore::RenderThemeGtk::paintMediaPlayButton): Checks if the
     154        play button has the class paused to show the play icon instead of
     155        the pause one.
     156        (WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
     157        Added. Paints the captions icon.
     158        (WebCore::RenderThemeGtk::mediaControlsScript): Added. Loads the
     159        bundled scripts.
     160        * platform/gtk/RenderThemeGtk.h: Added the mediaControlsScript
     161        method and declared the redefinition of the method to play the
     162        captions icon.
     163
    11642014-02-11  Alexey Proskuryakov  <ap@apple.com>
    2165
  • trunk/Source/WebCore/GNUmakefile.am

    r163568 r164024  
    1616        -I$(srcdir)/Source/WebCore/Modules/indexeddb/leveldb \
    1717        -I$(srcdir)/Source/WebCore/Modules/indieui \
     18        -I$(srcdir)/Source/WebCore/Modules/mediacontrols \
    1819        -I$(srcdir)/Source/WebCore/Modules/mediasource \
    1920        -I$(srcdir)/Source/WebCore/Modules/mediastream \
     
    265266        $(AM_V_at)perl -I $(WebCore)/bindings/scripts $(WebCore)/css/makegrammar.pl --extraDefines "$(feature_defines)" --outputDir $(GENSOURCES_WEBCORE) --bison "$(BISON)" --symbolsPrefix cssyy $<
    266267
     268USER_AGENT_SCRIPT_FILES = $(WebCore)/Modules/mediacontrols/mediaControlsApple.js $(WebCore)/Modules/mediacontrols/mediaControlsGtk.js
     269DerivedSources/WebCore/UserAgentScriptsData.cpp: DerivedSources/WebCore/UserAgentScripts.h
     270DerivedSources/WebCore/UserAgentScripts.h: PYTHONPATH=$(INSPECTOR_SCRIPTS_DIR)
     271DerivedSources/WebCore/UserAgentScripts.h: $(WebCore)/Scripts/make-js-file-arrays.py $(USER_AGENT_SCRIPT_FILES)
     272        $(AM_V_GEN)$(PYTHON) $< $@ DerivedSources/WebCore/UserAgentScriptsData.cpp $(USER_AGENT_SCRIPT_FILES)
     273
    267274# user agent style sheets
    268275USER_AGENT_STYLE_SHEETS = \
     
    399406    $(WebCore)/Modules/geolocation \
    400407    $(WebCore)/Modules/indexeddb \
     408    $(WebCore)/Modules/mediacontrols \
    401409    $(WebCore)/Modules/mediasource \
    402410    $(WebCore)/Modules/mediastream \
  • trunk/Source/WebCore/GNUmakefile.list.am

    r163987 r164024  
    464464        DerivedSources/WebCore/JSMediaController.cpp \
    465465        DerivedSources/WebCore/JSMediaController.h \
     466        DerivedSources/WebCore/JSMediaControlsHost.cpp \
     467        DerivedSources/WebCore/JSMediaControlsHost.h \
    466468        DerivedSources/WebCore/JSMediaElementAudioSourceNode.cpp \
    467469        DerivedSources/WebCore/JSMediaElementAudioSourceNode.h \
     
    855857        DerivedSources/WebCore/PlugInsResources.h \
    856858        DerivedSources/WebCore/SettingsMacros.h \
     859        DerivedSources/WebCore/UserAgentScriptsData.cpp \
     860        DerivedSources/WebCore/UserAgentScripts.h \
    857861        DerivedSources/WebCore/UserAgentStyleSheetsData.cpp \
    858862        DerivedSources/WebCore/UserAgentStyleSheets.h \
     
    12011205        $(WebCore)/Modules/indexeddb/IDBVersionChangeEvent.idl \
    12021206        $(WebCore)/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl \
     1207        $(WebCore)/Modules/mediacontrols/MediaControlsHost.idl \
    12031208        $(WebCore)/Modules/mediasource/DOMURLMediaSource.idl \
    12041209        $(WebCore)/Modules/mediasource/MediaSource.idl \
     
    18801885        Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp \
    18811886        Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h \
     1887        Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp \
     1888        Source/WebCore/Modules/mediacontrols/MediaControlsHost.h \
    18821889        Source/WebCore/Modules/mediasource/MediaSource.cpp \
    18831890        Source/WebCore/Modules/mediasource/MediaSource.h \
  • trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp

    r163094 r164024  
    154154}
    155155
     156bool MediaControlsHost::supportsFullscreen()
     157{
     158    return m_mediaElement->supportsFullscreen();
     159}
     160
    156161}
    157162
  • trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h

    r163094 r164024  
    6060    void updateTextTrackContainer();
    6161    bool mediaPlaybackAllowsInline() const;
     62    bool supportsFullscreen();
    6263
    6364private:
  • trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl

    r163094 r164024  
    3838    void updateTextTrackContainer();
    3939    readonly attribute boolean mediaPlaybackAllowsInline;
     40    readonly attribute boolean supportsFullscreen;
    4041};
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js

    r163094 r164024  
    7777        volumeBox: 'volume-box',
    7878        noVideo: 'no-video',
     79        down: 'down',
    7980    },
    8081    KeyCodes: {
     
    573574    {
    574575        this.showControls();
    575         if (this.hideTimer)
    576             clearTimeout(this.hideTimer);
    577         this.hideTimer = setTimeout(this.hideControls.bind(this), this.HideControlsDelay);
     576        this.resetHideControlsTimer();
    578577
    579578        if (!this.isDragging)
     
    588587    {
    589588        this.hideControls();
    590         if (this.hideTimer)
    591             clearTimeout(this.hideTimer);
     589        this.clearHideControlsTimer();
    592590    },
    593591
     
    865863
    866864            this.hideControls();
    867             if (this.hideTimer)
    868                 clearTimeout(this.hideTimer);
    869             this.hideTimer = setTimeout(this.hideControls.bind(this), this.HideControlsDelay);
     865            this.resetHideControlsTimer();
    870866        }
    871867    },
     
    11531149    },
    11541150
     1151    clearHideControlsTimer: function()
     1152    {
     1153        if (this.hideTimer)
     1154            clearTimeout(this.hideTimer);
     1155        this.hideTimer = null;
     1156    },
     1157
     1158    resetHideControlsTimer: function()
     1159    {
     1160        if (this.hideTimer)
     1161            clearTimeout(this.hideTimer);
     1162        this.hideTimer = setTimeout(this.hideControls.bind(this), this.HideControlsDelay);
     1163    },
    11551164};
  • trunk/Source/WebCore/PlatformGTK.cmake

    r163797 r164024  
    296296)
    297297
     298set(WebCore_USER_AGENT_SCRIPTS
     299    ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsApple.js
     300    ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsGtk.js
     301)
     302
     303set(WebCore_USER_AGENT_SCRIPTS_DEPENDENCIES ${WEBCORE_DIR}/platform/gtk/RenderThemeGtk.cpp)
     304
    298305list(APPEND WebCore_LIBRARIES
    299306    ${ATK_LIBRARIES}
     
    456463)
    457464target_link_libraries(WebCorePlatformGTK
     465    WebCore
    458466    ${WebCore_LIBRARIES}
    459467    ${GTK_LIBRARIES}
  • trunk/Source/WebCore/css/mediaControlsGtk.css

    r155048 r164024  
    8080    border-radius: 5px;
    8181    overflow: visible;
     82    transition: opacity 0.25s linear;
     83}
     84
     85video::-webkit-media-controls-panel {
     86    opacity: 0;
     87}
     88
     89video::-webkit-media-controls-panel.show,
     90video::-webkit-media-controls-panel.paused {
     91    opacity: 1;
     92}
     93
     94video::-webkit-media-controls-panel div.mute-box,
     95audio::-webkit-media-controls-panel div.mute-box {
     96    display: -webkit-flex;
     97    -webkit-flex: none;
     98    box-sizing: border-box;
     99    width: 30px;
     100    height: 30px;
     101    margin: 0 9px 0 -7px;
     102}
     103
     104video::-webkit-media-controls-panel div.mute-box.hidden,
     105audio::-webkit-media-controls-panel div.mute-box.hidden {
     106    display: none;
    82107}
    83108
     
    91116    height: 30px;
    92117    line-height: 30px;
    93     margin: 0 9px 0 -7px;
     118    outline: none;
    94119}
    95120
     
    104129    line-height: 30px;
    105130    margin: 0 9px;
     131    outline: none;
    106132}
    107133
     
    111137    -webkit-user-select: none;
    112138    -webkit-flex: none;
    113     display: block;
    114139    border: none;
    115140    cursor: default;
     
    131156    text-shadow: none;
    132157    text-decoration: none;
     158}
     159
     160audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display {
     161    display: block;
     162}
     163
     164audio::-webkit-media-controls-time-remaining-display,
     165video::-webkit-media-controls-time-remaining-display {
     166    display: none;
     167}
     168
     169audio::-webkit-media-controls-time-remaining-display.show,
     170video::-webkit-media-controls-time-remaining-display.show {
     171    display: block;
     172}
     173
     174audio::-webkit-media-controls-current-time-display.hidden,
     175video::-webkit-media-controls-current-time-display.hidden,
     176audio::-webkit-media-controls-time-remaining-display.hidden,
     177video::-webkit-media-controls-time-remaining-display.hidden {
     178    display: none;
    133179}
    134180
     
    144190    border-radius: 4px;
    145191    color: rgba(230, 230, 230, 0.35);
     192    outline: none;
    146193}
    147194
    148195audio::-webkit-media-controls-volume-slider-container, video::-webkit-media-controls-volume-slider-container {
    149196    -webkit-appearance: media-volume-slider-container;
     197    overflow: hidden;
    150198    position: absolute;
    151199    padding: 0;
     
    157205    right: 9px;
    158206    border-radius: 5px 5px 0px 0px;
     207    transition: height 0.10s linear;
     208}
     209
     210audio::-webkit-media-controls-volume-slider-container.hidden,
     211video::-webkit-media-controls-volume-slider-container.hidden {
     212    height: 0;
     213}
     214
     215audio::-webkit-media-controls-volume-slider-container.down,
     216video::-webkit-media-controls-volume-slider-container.down {
     217    bottom: -100px;
     218    border-radius: 0px 0px 5px 5px;
     219    transition: height 0.10s linear, bottom 0.10s linear;
     220}
     221
     222audio::-webkit-media-controls-panel .hidden.down,
     223video::-webkit-media-controls-panel .hidden.down {
     224    bottom: 0;
    159225}
    160226
     
    171237    background-color: transparent;
    172238    color: rgba(230, 230, 230, 0.35);
     239    outline: none;
    173240}
    174241
     
    223290    line-height: 30px;
    224291    margin: 0 9px 0 -7px;
    225     background-repeat:no-repeat;
    226     background-position:center;
    227     background-image: url('data:image/svg+xml,<svg id="svg7384" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata id="metadata90"><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title>Gnome Symbolic Icon Theme</dc:title></cc:Work></rdf:RDF></metadata><g id="layer9" transform="translate(-101,-357)"><path id="path12148" style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" fill="#bebebe" d="m104.75,357.06c-2.0602,0-3.75,1.6898-3.75,3.75v4.4375c0,2.0602,1.6898,3.75,3.75,3.75h4.9375l3.75,2.6562,1.5938,1.125v-1.9688l-0.0313-2.5c1.1106-0.59715,1.9688-1.6526,1.9688-3.0625v-4.4375c0-2.0602-1.6898-3.75-3.75-3.75h-8.4688zm0,2,8.4688,0c0.9868,0,1.75,0.7632,1.75,1.75v4.4375c0,0.86273-0.63508,1.541-1.125,1.625l-0.84,0.12v0.84375,1.0312l-2.4062-1.6875-0.25-0.1875h-0.3125-5.2812c-0.9868,0-1.75-0.7632-1.75-1.75v-4.4375c0-0.9868,0.7632-1.75,1.75-1.75z"/></g></svg>');
     292    outline: none;
    228293}
    229294
    230295video::-webkit-media-controls-closed-captions-container {
    231296    -webkit-appearance: media-closed-captions-container;
     297    display: -webkit-flex;
    232298    position: absolute;
    233     display: block;
    234     right: 38px;
    235299    bottom: 35px;
     300    z-index: 2;
     301    background-color: rgba(20, 20, 20, 0.8);
     302    border-radius: 5px 5px 0px 0px;
     303    overflow: hidden;
    236304    max-width: -webkit-calc(100% - 48px); /* right + 10px */
    237305    max-height: -webkit-calc(100% - 35px); /* bottom + 10px */
    238     overflow-x: hidden;
    239     overflow-y: auto;
    240     background-color: rgba(20, 20, 20, 0.8);
    241     border-radius: 10px;
    242306    cursor: default;
    243     z-index: 2;
    244 }
    245 
    246 video::-webkit-media-controls-closed-captions-track-list {
    247     display: block;
    248     font-family: "Helvetica Bold", Helvetica;
     307    font-family: -webkit-small-control;
    249308    font-size: 10pt;
     309    font-weight: normal;
     310    font-style: normal;
     311    color: white;
    250312    -webkit-user-select: none;
    251 }
    252 
    253 video::-webkit-media-controls-closed-captions-track-list h3 {
    254     margin: 1px 30px;
    255     color: #757575;
    256     text-shadow: 0 1px 0 black;
    257     padding-top: 0px;
    258     font-weight: bold;
    259     font-size: 10pt;
    260 }
    261 
    262 video::-webkit-media-controls-closed-captions-track-list ul {
     313    transition: height 0.10s linear;
     314}
     315
     316video::-webkit-media-controls-closed-captions-container h3 {
     317    margin: 1px 10px;
     318    padding-top: 4px;
     319}
     320
     321video::-webkit-media-controls-closed-captions-container ul {
    263322    list-style-type: none;
    264323    margin: 0 0 4px 0;
    265324    padding: 0;
    266     font-weight: bold;
    267 }
    268 
    269 video::-webkit-media-controls-closed-captions-track-list li {
     325}
     326
     327video::-webkit-media-controls-closed-captions-container li {
    270328    position: relative;
    271329    color: white;
    272     background-image: none;
    273     text-shadow: 0 1px 0 black;
    274330    margin: 0;
    275     padding-left: 37px;
    276     padding-right: 35px;
     331    padding-left: 17px;
     332    padding-right: 15px;
    277333    padding-top: 0.15em;
    278334    padding-bottom: 0.2em;
     
    281337    white-space: nowrap;
    282338    text-overflow: ellipsis;
    283     border-top: 1px solid rgba(0, 0, 0, 0);
    284     border-bottom: 1px solid rgba(0, 0, 0, 0);
    285 }
    286 video::-webkit-media-controls-closed-captions-track-list li.selected {
     339    outline: none;
     340}
     341video::-webkit-media-controls-closed-captions-container li.selected {
    287342    background-color: rgba(230, 230, 230, 0.15);
    288343}
     
    298353    line-height: 30px;
    299354    margin: 0 9px 0 -7px;
    300 }
     355    outline: none;
     356}
     357
     358video::-webkit-media-controls-panel button.hidden,
     359audio::-webkit-media-controls-panel button.hidden {
     360    display: none;
     361}
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r163983 r164024  
    142142#include "MediaControlsHost.h"
    143143#include "ScriptGlobalObject.h"
    144 #include "UserAgentScripts.h"
    145144#include <bindings/ScriptObject.h>
    146145#endif
  • trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp

    r163797 r164024  
    3737#include "LocalizedStrings.h"
    3838#include "MediaControlElements.h"
     39#include "NamedNodeMap.h"
    3940#include "PaintInfo.h"
    4041#include "PlatformContextCairo.h"
     
    4344#include "StringTruncator.h"
    4445#include "TimeRanges.h"
     46#include "UserAgentScripts.h"
    4547#include "UserAgentStyleSheets.h"
    4648#include <cmath>
     
    5052#include <wtf/gobject/GUniquePtr.h>
    5153#include <wtf/text/CString.h>
     54#include <wtf/text/StringBuilder.h>
    5255
    5356#if ENABLE(PROGRESS_ELEMENT)
     
    101104}
    102105#endif
     106
     107static bool nodeHasPseudo(Node* node, const char* pseudo)
     108{
     109    RefPtr<Node> attributeNode = node->attributes()->getNamedItem("pseudo");
     110
     111    return attributeNode ? attributeNode->nodeValue() == pseudo : false;
     112}
     113
     114static bool nodeHasClass(Node* node, const char* className)
     115{
     116    return node->isElementNode() ? toElement(node)->classNames().contains(className) : false;
     117}
    103118
    104119PassRefPtr<RenderTheme> RenderThemeGtk::create()
     
    140155    case SliderHorizontalPart:
    141156    case SliderVerticalPart:
    142     case MediaPlayButtonPart:
    143     case MediaVolumeSliderPart:
    144     case MediaMuteButtonPart:
    145     case MediaEnterFullscreenButtonPart:
    146     case MediaSliderPart:
    147157        return true;
    148158    default:
     
    526536    if (!node)
    527537        return false;
    528     if (!node->isMediaControlElement())
     538
     539    if (!nodeHasPseudo(node, "-webkit-media-controls-play-button"))
    529540        return false;
    530 
    531     bool play = mediaControlElementType(node) == MediaPlayButton;
     541    bool showPlayButton = nodeHasClass(node, "paused");
     542
    532543    return paintMediaButton(renderObject, paintInfo.context, rect,
    533         play ? "media-playback-start-symbolic" : "media-playback-pause-symbolic",
    534         play ? GTK_STOCK_MEDIA_PLAY : GTK_STOCK_MEDIA_PAUSE);
     544        showPlayButton ? "media-playback-start-symbolic" : "media-playback-pause-symbolic",
     545        showPlayButton ? GTK_STOCK_MEDIA_PLAY : GTK_STOCK_MEDIA_PAUSE);
    535546}
    536547
     
    544555    return paintMediaButton(renderObject, paintInfo.context, rect, "media-seek-forward-symbolic", GTK_STOCK_MEDIA_FORWARD);
    545556}
     557
     558#if ENABLE(VIDEO_TRACK)
     559bool RenderThemeGtk::paintMediaToggleClosedCaptionsButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     560{
     561    return paintMediaButton(renderObject, paintInfo.context, rect, "user-invisible-symbolic", GTK_STOCK_JUSTIFY_FILL);
     562}
     563#endif
    546564
    547565static RoundedRect::Radii borderRadiiFromStyle(RenderStyle* style)
     
    727745#endif
    728746
    729 }
     747String RenderThemeGtk::mediaControlsScript()
     748{
     749    StringBuilder scriptBuilder;
     750    scriptBuilder.append(mediaControlsAppleJavaScript, sizeof(mediaControlsAppleJavaScript));
     751    scriptBuilder.append(mediaControlsGtkJavaScript, sizeof(mediaControlsGtkJavaScript));
     752    return scriptBuilder.toString();
     753}
     754}
  • trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h

    r162139 r164024  
    8989    virtual String formatMediaControlsCurrentTime(float currentTime, float duration) const;
    9090    virtual bool supportsClosedCaptioning() const override { return true; }
     91    virtual String mediaControlsScript();
    9192
    9293#if ENABLE(FULLSCREEN_API)
     
    175176    virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
    176177    virtual bool paintMediaCurrentTime(RenderObject*, const PaintInfo&, const IntRect&);
     178#if ENABLE(VIDEO_TRACK)
     179    virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const PaintInfo&, const IntRect&);
     180#endif
    177181#endif
    178182
  • trunk/Source/autotools/SetupWebKitFeatures.m4

    r163749 r164024  
    132132    ENABLE_MATHML=1 \
    133133    ENABLE_MEDIA_CAPTURE=0 \
     134    ENABLE_MEDIA_CONTROLS_SCRIPT=1 \
    134135    ENABLE_MEDIA_SOURCE=0 \
    135136    ENABLE_MEDIA_STATISTICS=0 \
  • trunk/Source/cmake/OptionsGTK.cmake

    r163749 r164024  
    5353WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LLINT ON)
    5454WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_CAPTURE ON)
     55WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_CONTROLS_SCRIPT ON)
    5556WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER ON)
    5657WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MHTML ON)
  • trunk/Source/cmake/WebKitFeatures.cmake

    r163786 r164024  
    7878    WEBKIT_OPTION_DEFINE(ENABLE_MATHML "Toggle MathML support" ON)
    7979    WEBKIT_OPTION_DEFINE(ENABLE_MEDIA_CAPTURE "Toggle Media Capture support" OFF)
     80    WEBKIT_OPTION_DEFINE(ENABLE_MEDIA_CONTROLS_SCRIPT "Toggle definition of media controls in Javascript" OFF)
    8081    WEBKIT_OPTION_DEFINE(ENABLE_MEDIA_SOURCE "Toggle Media Source support" OFF)
    8182    WEBKIT_OPTION_DEFINE(ENABLE_MEDIA_STATISTICS "Toggle Media Statistics support" OFF)
  • trunk/Source/cmakeconfig.h.cmake

    r163786 r164024  
    7070#cmakedefine01 ENABLE_MATHML
    7171#cmakedefine01 ENABLE_MEDIA_CAPTURE
     72#cmakedefine01 ENABLE_MEDIA_CONTROLS_SCRIPT
    7273#cmakedefine01 ENABLE_MEDIA_SOURCE
    7374#cmakedefine01 ENABLE_MEDIA_STATISTICS
Note: See TracChangeset for help on using the changeset viewer.