WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-83869-20121213002353.patch (text/plain), 29.79 KB, created by
Xabier RodrÃguez Calvar
on 2012-12-12 15:26:33 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Xabier RodrÃguez Calvar
Created:
2012-12-12 15:26:33 PST
Size:
29.79 KB
patch
obsolete
>Subversion Revision: 137451 >diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am >index 5a18585963907a69981ed25c6abddadbc90b4113..aa1cf721871d6f2e085bdcb914c779d0eb98bda4 100644 >--- a/Source/WebCore/GNUmakefile.list.am >+++ b/Source/WebCore/GNUmakefile.list.am >@@ -3565,8 +3565,8 @@ webcore_sources += \ > Source/WebCore/html/shadow/MediaControlElementTypes.h \ > Source/WebCore/html/shadow/MediaControls.cpp \ > Source/WebCore/html/shadow/MediaControls.h \ >- Source/WebCore/html/shadow/MediaControlsApple.cpp \ >- Source/WebCore/html/shadow/MediaControlsApple.h \ >+ Source/WebCore/html/shadow/MediaControlsGtk.cpp \ >+ Source/WebCore/html/shadow/MediaControlsGtk.h \ > Source/WebCore/html/shadow/MeterShadowElement.cpp \ > Source/WebCore/html/shadow/MeterShadowElement.h \ > Source/WebCore/html/shadow/ProgressShadowElement.cpp \ >diff --git a/Source/WebCore/css/mediaControlsGtk.css b/Source/WebCore/css/mediaControlsGtk.css >index cd2c4c34d16ea111e5bbac29560c684dd2d73a38..38f3c38c3447f66141ade7c338e17d3a37aa41d5 100644 >--- a/Source/WebCore/css/mediaControlsGtk.css >+++ b/Source/WebCore/css/mediaControlsGtk.css >@@ -1,101 +1,223 @@ > /* >- * WebKitGTK+ specific overrides for HTML5 media elements. >+ * Copyright (C) 2009 Apple Inc. All rights reserved. >+ * Copyright (C) 2009 Google Inc. >+ * Copyright (C) 2012 Zan Dobersek <zandobersek@gmail.com> >+ * Copyright (C) 2012 Igalia S.L. > * >- * Copyright (C) 2009 Zan Dobersek <zandobersek@gmail.com> >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. > * >+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >+/* Chromium default media controls */ >+ >+body:-webkit-full-page-media { >+ background-color: rgb(0, 0, 0); >+} >+ > audio { >- height: 20px; > width: 300px; >+ height: 30px; > } > >-audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel { >- -webkit-box-align: end; >- text-align: right; >- height: 100%; >+audio:-webkit-full-page-media, video:-webkit-full-page-media { >+ max-height: 100%; >+ max-width: 100%; > } > >-audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button { >- width: 20px; >- height: 20px; >- position: relative; >- z-index: 2; >+audio:-webkit-full-page-media::-webkit-media-controls-panel, >+video:-webkit-full-page-media::-webkit-media-controls-panel { >+ bottom: 0px; > } > >-audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-button { >- width: 20px; >- height: 20px; >+::-webkit-media-controls { >+ display: -webkit-box; >+ -webkit-box-orient: vertical; >+ -webkit-box-pack: end; >+ -webkit-box-align: center; > } > >-audio::-webkit-media-controls-timeline-container, video::-webkit-media-controls-timeline-container { >- height: 20px; >- border-left: 1px solid rgba(255, 255, 255, 0.2); >- border-right: 1px solid rgba(255, 255, 255, 0.2); >+audio::-webkit-media-controls-enclosure, video::-webkit-media-controls-enclosure { >+ width: 100%; >+ max-width: 800px; >+ height: 30px; >+ bottom: 0; >+ text-indent: 0; >+ padding: 0; >+ box-sizing: border-box; >+ overflow: visible; > } > >-audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline { >- height: 20px; >+video::-webkit-media-controls-enclosure { >+ padding: 0px 5px 5px 5px; >+ height: 35px; > } > >-audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display { >- -webkit-appearance: media-current-time-display; >- -webkit-user-select: none; >- display: inline-block; >- height: 20px; >- >- padding: 5px; >+audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel { >+ display: -webkit-box; >+ -webkit-box-orient: horizontal; >+ -webkit-box-align: center; >+ -webkit-box-pack: center; >+ bottom: auto; >+ height: 30px; >+ background-color: rgba(20, 20, 20, 0.8); >+ border-radius: 5px; >+ overflow: visible; >+} > >- text-align: center; >- font-size: 10px; >+audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button { >+ -webkit-appearance: media-mute-button; >+ display: -webkit-box; >+ border: none; >+ box-sizing: content-box; >+ width: 30px; >+ height: 30px; >+ line-height: 30px; >+ margin-right: 9px; >+ padding: 0; > } > >-audio::-webkit-media-controls-seek-back-button, video::-webkit-media-controls-seek-back-button { >- width: 20px; >- height: 20px; >+audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-button { >+ -webkit-appearance: media-play-button; >+ display: -webkit-box; >+ border: none; >+ box-sizing: border-box; >+ width: 30px; >+ height: 30px; >+ line-height: 30px; >+ margin-left: 9px; >+ margin-right: 9px; >+ padding: 0; > } > >-audio::-webkit-media-controls-seek-forward-button, video::-webkit-media-controls-seek-forward-button { >- width: 20px; >- height: 20px; >+audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display, >+audio::-webkit-media-controls-time-remaining-display, video::-webkit-media-controls-time-remaining-display { >+ -webkit-appearance: media-current-time-display; >+ -webkit-user-select: none; >+ display: block; >+ border: none; >+ cursor: default; >+ >+ height: 30px; >+ margin: 0 9px 0 0; >+ padding: 0; >+ >+ line-height: 30px; >+ font-family: Arial, Helvetica, sans-serif; >+ font-size: 13px; >+ font-weight: bold; >+ font-style: normal; >+ color: white; >+ >+ letter-spacing: normal; >+ word-spacing: normal; >+ text-transform: none; >+ text-indent: 0; >+ text-shadow: none; >+ text-decoration: none; > } > >-audio::-webkit-media-controls-fullscreen-button, video::-webkit-media-controls-fullscreen-button { >- width: 20px; >- height: 20px; >+audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline { >+ -webkit-appearance: media-slider; >+ display: -webkit-box; >+ -webkit-box-flex: 1; >+ height: 8px; >+ margin: 0 15px 0 0; >+ padding: 0; >+ background-color: transparent; >+ min-width: 25px; > } > > audio::-webkit-media-controls-volume-slider-container, video::-webkit-media-controls-volume-slider-container { > -webkit-appearance: media-volume-slider-container; > position: absolute; >+ padding: 0; > height: 100px; >- width: 20px; >- bottom: 20px; >- z-index: 1; >+ width: 30px; >+ bottom: 30px; >+ z-index: 2; >+ background-color: rgba(20, 20, 20, 0.8); >+ bottom: 30px; >+ right: 10px; >+ border-radius: 5px 5px 0px 0px; > } > > audio::-webkit-media-controls-volume-slider, video::-webkit-media-controls-volume-slider { >- -webkit-appearance: media-volume-slider; >- display: inline; >- position: absolute; >- width: 14px; >- height: 95px; >- >- left: 3px; >+ -webkit-appearance: slider-vertical; >+ display: -webkit-box; >+ -webkit-box-flex: 1; >+ padding: 0; >+ height: 90px; >+ width: 100%; > top: 5px; >+ z-index: 3; >+ background-color: transparent; >+ position: relative; >+} >+ >+/* FIXME these shouldn't use special pseudoShadowIds, but nicer rules. >+ https://code.google.com/p/chromium/issues/detail?id=112508 >+ https://bugs.webkit.org/show_bug.cgi?id=62218 >+*/ >+input[type="range"]::-webkit-media-slider-container { >+ display: -webkit-box; >+ -webkit-box-align: center; >+ -webkit-box-orient: horizontal; /* This property is updated by C++ code. */ >+ box-sizing: border-box; >+ height: 100%; >+ width: 100%; >+ border: 1px solid rgba(230, 230, 230, 0.35); >+ border-radius: 4px; >+ background-color: transparent; /* Background drawing is managed by C++ code to draw ranges. */ >+} >+ >+/* The negative right margin causes the track to overflow its container. */ >+input[type="range"]::-webkit-media-slider-container > div { >+ margin-right: -14px; >+} >+ >+input[type="range"]::-webkit-media-slider-thumb { >+ margin-left: -7px; >+ margin-right: -7px; >+} >+ >+audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button { >+ -webkit-appearance: media-toggle-closed-captions-button; >+ display: -webkit-box; >+ border: none; >+ box-sizing: border-box; >+ width: 30px; >+ height: 30px; >+ line-height: 30px; >+ margin-left: -5px; >+ margin-right: 9px; >+ padding: 0; >+} >+ >+audio::-webkit-media-controls-fullscreen-button, video::-webkit-media-controls-fullscreen-button { >+ -webkit-appearance: media-enter-fullscreen-button; >+ /* display: -webkit-box; */ >+ display: none; >+ border: none; >+ box-sizing: border-box; >+ width: 30px; >+ height: 30px; >+ line-height: 30px; >+ padding: 0; > } >diff --git a/Source/WebCore/html/shadow/MediaControlsGtk.cpp b/Source/WebCore/html/shadow/MediaControlsGtk.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..45680454e09182c66083c264cacbb9d798883569 >--- /dev/null >+++ b/Source/WebCore/html/shadow/MediaControlsGtk.cpp >@@ -0,0 +1,242 @@ >+/* >+ * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. >+ * Copyright (C) 2011, 2012 Google Inc. All rights reserved. >+ * Copyright (C) 2012 Zan Dobersek <zandobersek@gmail.com> >+ * Copyright (C) 2012 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+ >+#if ENABLE(VIDEO) >+#include "MediaControlsGtk.h" >+ >+using namespace std; >+ >+namespace WebCore { >+ >+MediaControlsGtk::MediaControlsGtk(Document* document) >+ : MediaControls(document) >+ , m_durationDisplay(0) >+ , m_enclosure(0) >+{ >+} >+ >+// MediaControls::create() for Android is defined in MediaControlsGtkAndroid.cpp. >+#if !OS(ANDROID) >+PassRefPtr<MediaControls> MediaControls::create(Document* document) >+{ >+ return MediaControlsGtk::createControls(document); >+} >+#endif >+ >+PassRefPtr<MediaControlsGtk> MediaControlsGtk::createControls(Document* document) >+{ >+ if (!document->page()) >+ return 0; >+ >+ RefPtr<MediaControlsGtk> controls = adoptRef(new MediaControlsGtk(document)); >+ >+ if (controls->initializeControls(document)) >+ return controls.release(); >+ >+ return 0; >+} >+ >+bool MediaControlsGtk::initializeControls(Document* document) >+{ >+ // Create an enclosing element for the panel so we can visually offset the controls correctly. >+ RefPtr<MediaControlPanelEnclosureElement> enclosure = MediaControlPanelEnclosureElement::create(document); >+ >+ RefPtr<MediaControlPanelElement> panel = MediaControlPanelElement::create(document); >+ >+ ExceptionCode ec; >+ >+ RefPtr<MediaControlPlayButtonElement> playButton = MediaControlPlayButtonElement::create(document); >+ m_playButton = playButton.get(); >+ panel->appendChild(playButton.release(), ec, true); >+ if (ec) >+ return false; >+ >+ RefPtr<MediaControlTimelineElement> timeline = MediaControlTimelineElement::create(document, this); >+ m_timeline = timeline.get(); >+ panel->appendChild(timeline.release(), ec, true); >+ if (ec) >+ return false; >+ >+ RefPtr<MediaControlCurrentTimeDisplayElement> currentTimeDisplay = MediaControlCurrentTimeDisplayElement::create(document); >+ m_currentTimeDisplay = currentTimeDisplay.get(); >+ m_currentTimeDisplay->hide(); >+ panel->appendChild(currentTimeDisplay.release(), ec, true); >+ if (ec) >+ return false; >+ >+ RefPtr<MediaControlTimeRemainingDisplayElement> durationDisplay = MediaControlTimeRemainingDisplayElement::create(document); >+ m_durationDisplay = durationDisplay.get(); >+ panel->appendChild(durationDisplay.release(), ec, true); >+ if (ec) >+ return false; >+ >+ if (document->page()->theme()->supportsClosedCaptioning()) { >+ RefPtr<MediaControlToggleClosedCaptionsButtonElement> toggleClosedCaptionsButton = MediaControlToggleClosedCaptionsButtonElement::create(document, this); >+ m_toggleClosedCaptionsButton = toggleClosedCaptionsButton.get(); >+ panel->appendChild(toggleClosedCaptionsButton.release(), ec, true); >+ if (ec) >+ return false; >+ } >+ >+ RefPtr<MediaControlFullscreenButtonElement> fullscreenButton = MediaControlFullscreenButtonElement::create(document); >+ m_fullScreenButton = fullscreenButton.get(); >+ panel->appendChild(fullscreenButton.release(), ec, true); >+ if (ec) >+ return false; >+ >+ RefPtr<MediaControlPanelMuteButtonElement> panelMuteButton = MediaControlPanelMuteButtonElement::create(document, this); >+ m_panelMuteButton = panelMuteButton.get(); >+ panel->appendChild(panelMuteButton.release(), ec, true); >+ if (ec) >+ return false; >+ >+ RefPtr<MediaControlVolumeSliderContainerElement> sliderContainer = MediaControlVolumeSliderContainerElement::create(document); >+ m_volumeSliderContainer = sliderContainer.get(); >+ panel->appendChild(sliderContainer.release(), ec, true); >+ if (ec) >+ return false; >+ >+ RefPtr<MediaControlPanelVolumeSliderElement> slider = MediaControlPanelVolumeSliderElement::create(document); >+ m_volumeSlider = slider.get(); >+ m_volumeSlider->setClearMutedOnUserInteraction(true); >+ m_volumeSliderContainer->appendChild(slider.release(), ec, true); >+ if (ec) >+ return false; >+ >+ m_panel = panel.get(); >+ enclosure->appendChild(panel.release(), ec, true); >+ if (ec) >+ return false; >+ >+ m_enclosure = enclosure.get(); >+ appendChild(enclosure.release(), ec, true); >+ if (ec) >+ return false; >+ >+ return true; >+} >+ >+void MediaControlsGtk::setMediaController(MediaControllerInterface* controller) >+{ >+ if (m_mediaController == controller) >+ return; >+ >+ MediaControls::setMediaController(controller); >+ >+ if (m_durationDisplay) >+ m_durationDisplay->setMediaController(controller); >+ if (m_enclosure) >+ m_enclosure->setMediaController(controller); >+} >+ >+void MediaControlsGtk::reset() >+{ >+ Page* page = document()->page(); >+ if (!page) >+ return; >+ >+ float duration = m_mediaController->duration(); >+ m_durationDisplay->setInnerText(page->theme()->formatMediaControlsTime(duration), ASSERT_NO_EXCEPTION); >+ m_durationDisplay->setCurrentValue(duration); >+ >+ MediaControls::reset(); >+} >+ >+void MediaControlsGtk::playbackStarted() >+{ >+ m_currentTimeDisplay->show(); >+ m_durationDisplay->hide(); >+ >+ MediaControls::playbackStarted(); >+} >+ >+void MediaControlsGtk::updateCurrentTimeDisplay() >+{ >+ float now = m_mediaController->currentTime(); >+ float duration = m_mediaController->duration(); >+ >+ Page* page = document()->page(); >+ if (!page) >+ return; >+ >+ // After seek, hide duration display and show current time. >+ if (now > 0) { >+ m_currentTimeDisplay->show(); >+ m_durationDisplay->hide(); >+ } >+ >+ // Allow the theme to format the time. >+ ExceptionCode ec; >+ m_currentTimeDisplay->setInnerText(page->theme()->formatMediaControlsCurrentTime(now, duration), ec); >+ m_currentTimeDisplay->setCurrentValue(now); >+} >+ >+void MediaControlsGtk::changedMute() >+{ >+ MediaControls::changedMute(); >+ >+ if (m_mediaController->muted()) >+ m_volumeSlider->setVolume(0); >+ else >+ m_volumeSlider->setVolume(m_mediaController->volume()); >+} >+ >+void MediaControlsGtk::showVolumeSlider() >+{ >+ if (!m_mediaController->hasAudio()) >+ return; >+ >+ if (m_volumeSliderContainer) >+ m_volumeSliderContainer->show(); >+} >+ >+#if ENABLE(VIDEO_TRACK) >+void MediaControlsGtk::createTextTrackDisplay() >+{ >+ if (m_textDisplayContainer) >+ return; >+ >+ RefPtr<MediaControlTextTrackContainerElement> textDisplayContainer = MediaControlTextTrackContainerElement::create(document()); >+ m_textDisplayContainer = textDisplayContainer.get(); >+ >+ if (m_mediaController) >+ m_textDisplayContainer->setMediaController(m_mediaController); >+ >+ // Insert it before the first controller element so it always displays behind the controls. >+ // In the Chromium case, that's the enclosure element. >+ insertBefore(textDisplayContainer, m_enclosure, ASSERT_NO_EXCEPTION, true); >+ textDisplayContainer->createSubtrees(document()); >+ textDisplayContainer.release(); >+} >+#endif >+ >+} >+ >+#endif >diff --git a/Source/WebCore/html/shadow/MediaControlsGtk.h b/Source/WebCore/html/shadow/MediaControlsGtk.h >new file mode 100644 >index 0000000000000000000000000000000000000000..b78cccaf12ca8266043ee7ec148f6f0a7b2844a4 >--- /dev/null >+++ b/Source/WebCore/html/shadow/MediaControlsGtk.h >@@ -0,0 +1,74 @@ >+/* >+ * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. >+ * Copyright (C) 2011, 2012 Google Inc. All rights reserved. >+ * Copyright (C) 2012 Zan Dobersek <zandobersek@gmail.com> >+ * Copyright (C) 2012 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef MediaControlsGtk_h >+#define MediaControlsGtk_h >+ >+#if ENABLE(VIDEO) >+ >+#include "MediaControls.h" >+ >+namespace WebCore { >+ >+class MediaControlsGtk : public MediaControls { >+public: >+ // Called from port-specific parent create function to create custom controls. >+ static PassRefPtr<MediaControlsGtk> createControls(Document*); >+ >+ virtual void setMediaController(MediaControllerInterface*) OVERRIDE; >+ >+ virtual void reset() OVERRIDE; >+ >+ virtual void playbackStarted() OVERRIDE; >+ >+ void changedMute() OVERRIDE; >+ >+ virtual void updateCurrentTimeDisplay() OVERRIDE; >+ >+ virtual void showVolumeSlider() OVERRIDE; >+ >+#if ENABLE(VIDEO_TRACK) >+ void createTextTrackDisplay() OVERRIDE; >+#endif >+ >+protected: >+ explicit MediaControlsGtk(Document*); >+ >+ bool initializeControls(Document*); >+ >+private: >+ MediaControlTimeRemainingDisplayElement* m_durationDisplay; >+ MediaControlPanelEnclosureElement* m_enclosure; >+ MediaControlVolumeSliderContainerElement* m_volumeSliderContainer; >+}; >+ >+} >+ >+#endif >+ >+#endif >diff --git a/Source/WebCore/platform/gtk/RenderThemeGtk.cpp b/Source/WebCore/platform/gtk/RenderThemeGtk.cpp >index 00aea2564f44b4e70aeb7b0273732baf3b56e338..9e822653fd1418432c8a48518e7ece7a7df40f90 100644 >--- a/Source/WebCore/platform/gtk/RenderThemeGtk.cpp >+++ b/Source/WebCore/platform/gtk/RenderThemeGtk.cpp >@@ -58,6 +58,7 @@ namespace WebCore { > // This would be a static method, except that forward declaring GType is tricky, since its > // definition depends on including glib.h, negating the benefit of using a forward declaration. > extern GRefPtr<GdkPixbuf> getStockIconForWidgetType(GType, const char* iconName, gint direction, gint state, gint iconSize); >+extern GRefPtr<GdkPixbuf> getStockSymbolicIconForWidgetType(GType, const char* iconName, gint direction, gint state, gint iconSize); > > using namespace HTMLNames; > >@@ -501,21 +502,20 @@ void RenderThemeGtk::adjustMediaSliderThumbSize(RenderStyle* style) const > > bool RenderThemeGtk::paintMediaButton(RenderObject* renderObject, GraphicsContext* context, const IntRect& rect, const char* iconName) > { >- GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_CONTAINER, iconName, >- gtkTextDirection(renderObject->style()->direction()), >- gtkIconState(this, renderObject), >- getMediaButtonIconSize(m_mediaIconSize)); > IntRect iconRect(rect.x() + (rect.width() - m_mediaIconSize) / 2, > rect.y() + (rect.height() - m_mediaIconSize) / 2, > m_mediaIconSize, m_mediaIconSize); >- context->fillRect(FloatRect(rect), m_panelColor, ColorSpaceDeviceRGB); >+ GRefPtr<GdkPixbuf> icon = getStockSymbolicIconForWidgetType(GTK_TYPE_CONTAINER, iconName, >+ gtkTextDirection(renderObject->style()->direction()), >+ gtkIconState(this, renderObject), >+ iconRect.width()); > paintGdkPixbuf(context, icon.get(), iconRect); > return false; > } > > bool RenderThemeGtk::paintMediaFullscreenButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect) > { >- return paintMediaButton(renderObject, paintInfo.context, rect, GTK_STOCK_FULLSCREEN); >+ return paintMediaButton(renderObject, paintInfo.context, rect, "view-fullscreen-symbolic"); > } > > bool RenderThemeGtk::paintMediaMuteButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect) >@@ -524,7 +524,7 @@ bool RenderThemeGtk::paintMediaMuteButton(RenderObject* renderObject, const Pain > if (!mediaElement) > return false; > >- return paintMediaButton(renderObject, paintInfo.context, rect, mediaElement->muted() ? "audio-volume-muted" : "audio-volume-high"); >+ return paintMediaButton(renderObject, paintInfo.context, rect, mediaElement->muted() ? "audio-volume-muted-symbolic" : "audio-volume-high-symbolic"); > } > > bool RenderThemeGtk::paintMediaPlayButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect) >@@ -535,17 +535,17 @@ bool RenderThemeGtk::paintMediaPlayButton(RenderObject* renderObject, const Pain > if (!node->isMediaControlElement()) > return false; > >- return paintMediaButton(renderObject, paintInfo.context, rect, mediaControlElementType(node) == MediaPlayButton ? GTK_STOCK_MEDIA_PLAY : GTK_STOCK_MEDIA_PAUSE); >+ return paintMediaButton(renderObject, paintInfo.context, rect, mediaControlElementType(node) == MediaPlayButton ? "media-playback-start-symbolic" : "media-playback-pause-symbolic"); > } > > bool RenderThemeGtk::paintMediaSeekBackButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect) > { >- return paintMediaButton(renderObject, paintInfo.context, rect, GTK_STOCK_MEDIA_REWIND); >+ return paintMediaButton(renderObject, paintInfo.context, rect, "media-seek-backward-symbolic"); > } > > bool RenderThemeGtk::paintMediaSeekForwardButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect) > { >- return paintMediaButton(renderObject, paintInfo.context, rect, GTK_STOCK_MEDIA_FORWARD); >+ return paintMediaButton(renderObject, paintInfo.context, rect, "media-seek-forward-symbolic"); > } > > bool RenderThemeGtk::paintMediaSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r) >@@ -617,9 +617,7 @@ bool RenderThemeGtk::paintMediaSliderThumb(RenderObject* o, const PaintInfo& pai > > bool RenderThemeGtk::paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo& paintInfo, const IntRect& rect) > { >- GraphicsContext* context = paintInfo.context; >- context->fillRect(FloatRect(rect), m_panelColor, ColorSpaceDeviceRGB); >- return false; >+ return true; > } > > bool RenderThemeGtk::paintMediaVolumeSliderTrack(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect) >@@ -639,9 +637,6 @@ String RenderThemeGtk::formatMediaControlsCurrentTime(float currentTime, float d > > bool RenderThemeGtk::paintMediaCurrentTime(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect) > { >- GraphicsContext* context = paintInfo.context; >- >- context->fillRect(FloatRect(rect), m_panelColor, ColorSpaceDeviceRGB); > return false; > } > #endif >diff --git a/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp b/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp >index 0a83827c7febcbe40548fad562b541171ec169f6..6652ce09fb0f32b0428bf32fafff8fbea9ba11f3 100644 >--- a/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp >+++ b/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp >@@ -898,6 +898,33 @@ GRefPtr<GdkPixbuf> getStockIconForWidgetType(GType widgetType, const char* iconN > return adoptGRef(icon); > } > >+GRefPtr<GdkPixbuf> getStockSymbolicIconForWidgetType(GType widgetType, const char* iconName, gint direction, gint state, gint iconSize) >+{ >+ GtkStyleContext* context = getStyleContext(widgetType); >+ >+ gtk_style_context_save(context); >+ >+ guint flags = 0; >+ if (state == GTK_STATE_PRELIGHT) >+ flags |= GTK_STATE_FLAG_PRELIGHT; >+ else if (state == GTK_STATE_INSENSITIVE) >+ flags |= GTK_STATE_FLAG_INSENSITIVE; >+ >+ gtk_style_context_set_state(context, static_cast<GtkStateFlags>(flags)); >+ gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(direction)); >+ GtkIconInfo* info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default(), >+ iconName, >+ iconSize, >+ static_cast<GtkIconLookupFlags>(GTK_ICON_LOOKUP_FORCE_SVG | GTK_ICON_LOOKUP_FORCE_SIZE)); >+ GdkPixbuf* icon = gtk_icon_info_load_symbolic_for_context(info, context, NULL, NULL); >+ >+ gtk_icon_info_free(info); >+ >+ gtk_style_context_restore(context); >+ >+ return adoptGRef(icon); >+} >+ > Color RenderThemeGtk::platformActiveSelectionBackgroundColor() const > { > GdkRGBA gdkRGBAColor; >diff --git a/Tools/gtk/jhbuild.modules b/Tools/gtk/jhbuild.modules >index cb4efc2cfb97bb9d1b8280777befb52abbcd4430..068f15fe495a1dc82e50657a4ce7e639a6728c4c 100644 >--- a/Tools/gtk/jhbuild.modules >+++ b/Tools/gtk/jhbuild.modules >@@ -17,6 +17,7 @@ > <dep package="glib"/> > <dep package="glib-networking"/> > <dep package="gnome-icon-theme"/> >+ <dep package="gnome-icon-theme-symbolic"/> > <dep package="gnome-themes-standard"/> > <dep package="libsoup"/> > <dep package="at-spi2-core"/> >@@ -194,6 +195,17 @@ > </branch> > </autotools> > >+ <autotools id="gnome-icon-theme-symbolic" autogen-sh="configure"> >+ <dependencies> >+ <dep package="gtk+"/> >+ </dependencies> >+ <branch module="pub/GNOME/sources/gnome-icon-theme-symbolic/3.2/gnome-icon-theme-symbolic-3.2.1.tar.xz" version="3.2.1" >+ repo="ftp.gnome.org" >+ hash="sha256:a558af2f87f761f00421f49c1addd2149b70228158e09327fa861219ac1a63cb" >+ md5sum="94137d3c256f2cc80298a9bef15d68c4"> >+ </branch> >+ </autotools> >+ > <autotools id="gnome-themes-standard" autogen-sh="configure"> > <dependencies> > <dep package="gtk+"/>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 83869
:
179135
|
180498
|
181889
|
182087
|
183200
|
183202
|
183573
|
183575
|
184253
|
184255
|
184558
|
185276
|
185278
|
187534
|
187540
|
188404
|
189185