Reviewed by Adam and Antti.
WebCore part of fix for <rdar://problem/5619062> Add load progress indicator to video controls
* WebCore.base.exp: Removed symbol for wkGetMediaControlBackgroundImageData. Added symbol for wkDrawMediaSliderTrack.
* css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Removed case for MediaBackgroundAppearance.
* css/html4.css: Removed -webkit-appearance: media-background rule for the media panel element. Removed unnecessary margin for slider.
* rendering/RenderStyle.h: (WebCore::): Removed MediaBackgroundAppearance.
* html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::initAndDispatchProgressEvent):
Call updateMediaPlayer more frequently so the load progress control gets updated appropriately.
* platform/mac/WebCoreSystemInterface.h: Removed wkGetMediaControlBackgroundImageData. Added wkDrawMediaSliderTrack.
* platform/mac/WebCoreSystemInterface.mm: ditto.
* rendering/RenderTheme.h: Removed paintMediaBackground. Added paintMediaSliderTrack.
* rendering/RenderTheme.cpp: (WebCore::RenderTheme::paint): Call paintMediaSliderTrack for elements with MediaSliderAppearance.
* rendering/RenderThemeMac.h: Removed paintMediaBackground. Added paintMediaSliderTrack.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::adjustSliderThumbSize): Added different sizes for the media slider thumb.
(WebCore::RenderThemeMac::paintMediaSliderTrack): Added. Calls wkDrawMediaSliderTrack with the percentage the media has loaded.
* rendering/RenderThemeSafari.cpp: ditto.
(WebCore::RenderThemeSafari::adjustSliderThumbSize):
(WebCore::RenderThemeSafari::paintMediaSliderTrack):
* rendering/RenderThemeSafari.h:
WebKit/mac:
Reviewed by Adam and Antti.
WebKit part of fix for <rdar://problem/5619062> Add load progress indicator to video controls
* WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface):
Removed initialization for GetMediaControlBackgroundImageData. Added initialization for DrawMediaSliderTrack.
WebKitLibraries:
Reviewed by Adam and Antti.
Updated libraries for <rdar://problem/5619062> Add load progress indicator to video controls
* WebKitSystemInterface.h:
* libWebKitSystemInterfaceLeopard.a:
* libWebKitSystemInterfaceTiger.a:
* win/include/SafariTheme: Added.
* win/include/SafariTheme/SafariThemeConstants.h: Added. Placeholder empty header until we release an updated WebKitSupportLibrary.
LayoutTests:
Reviewed by Adam and Antti.
Updated tests for <rdar://problem/5619062> Add load progress indicator to video controls
* platform/mac/media/audio-controls-rendering-expected.checksum:
* platform/mac/media/audio-controls-rendering-expected.png:
* platform/mac/media/audio-controls-rendering-expected.txt:
* platform/mac/media/video-controls-rendering-expected.checksum:
* platform/mac/media/video-controls-rendering-expected.png:
* platform/mac/media/video-controls-rendering-expected.txt:
* platform/mac/media/video-display-toggle-expected.checksum:
* platform/mac/media/video-display-toggle-expected.png:
* platform/mac/media/video-display-toggle-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29492
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2008-01-15 Adele Peterson <adele@apple.com>
+
+ Reviewed by Adam and Antti.
+
+ Updated tests for <rdar://problem/5619062> Add load progress indicator to video controls
+
+ * platform/mac/media/audio-controls-rendering-expected.checksum:
+ * platform/mac/media/audio-controls-rendering-expected.png:
+ * platform/mac/media/audio-controls-rendering-expected.txt:
+ * platform/mac/media/video-controls-rendering-expected.checksum:
+ * platform/mac/media/video-controls-rendering-expected.png:
+ * platform/mac/media/video-controls-rendering-expected.txt:
+ * platform/mac/media/video-display-toggle-expected.checksum:
+ * platform/mac/media/video-display-toggle-expected.png:
+ * platform/mac/media/video-display-toggle-expected.txt:
+
2008-01-14 Stephanie <slewis@apple.com>
RS=Oliver
-543d9e24ff0b46122a92e5cb6c81e891
\ No newline at end of file
+2327e711f1bf311dce4af719f1f06fdf
\ No newline at end of file
RenderButton {INPUT} at (0,0) size 17x16
layer at (24,42) size 17x16
RenderButton {INPUT} at (16,0) size 17x16
-layer at (45,42) size 126x16
- RenderSlider {INPUT} at (37,0) size 126x16
-layer at (45,43) size 15x15
- RenderBlock (relative positioned) {DIV} at (0,0) size 15x15
+layer at (40,42) size 136x16
+ RenderSlider {INPUT} at (32,0) size 136x16
+layer at (40,43) size 13x14
+ RenderBlock (relative positioned) {DIV} at (0,0) size 13x14
layer at (175,42) size 17x16
RenderButton {INPUT} at (167,0) size 17x16
layer at (191,42) size 17x16
RenderButton {INPUT} at (0,0) size 17x16
layer at (24,76) size 17x16
RenderButton {INPUT} at (16,0) size 17x16
-layer at (45,76) size 246x16
- RenderSlider {INPUT} at (37,0) size 246x16
-layer at (45,77) size 15x15
- RenderBlock (relative positioned) {DIV} at (0,0) size 15x15
+layer at (40,76) size 256x16
+ RenderSlider {INPUT} at (32,0) size 256x16
+layer at (40,77) size 13x14
+ RenderBlock (relative positioned) {DIV} at (0,0) size 13x14
layer at (295,76) size 17x16
RenderButton {INPUT} at (287,0) size 17x16
layer at (311,76) size 17x16
RenderButton {INPUT} at (0,0) size 17x16
layer at (24,194) size 17x16
RenderButton {INPUT} at (16,0) size 17x16
-layer at (45,194) size 246x16
- RenderSlider {INPUT} at (37,0) size 246x16
-layer at (45,195) size 15x15
- RenderBlock (relative positioned) {DIV} at (0,0) size 15x15
+layer at (40,194) size 256x16
+ RenderSlider {INPUT} at (32,0) size 256x16
+layer at (40,195) size 13x14
+ RenderBlock (relative positioned) {DIV} at (0,0) size 13x14
layer at (295,194) size 17x16
RenderButton {INPUT} at (287,0) size 17x16
layer at (311,194) size 17x16
-7b3f3dcbdcc080767b89400162bd90cf
\ No newline at end of file
+9bd3d5476fa3f1755351a61c55c7e511
\ No newline at end of file
RenderButton {INPUT} at (0,0) size 17x16
layer at (24,266) size 17x16
RenderButton {INPUT} at (16,0) size 17x16
-layer at (45,266) size 246x16
- RenderSlider {INPUT} at (37,0) size 246x16
-layer at (45,267) size 15x15
- RenderBlock (relative positioned) {DIV} at (0,0) size 15x15
+layer at (40,266) size 256x16
+ RenderSlider {INPUT} at (32,0) size 256x16
+layer at (40,267) size 13x14
+ RenderBlock (relative positioned) {DIV} at (0,0) size 13x14
layer at (295,266) size 17x16
RenderButton {INPUT} at (287,0) size 17x16
layer at (311,266) size 17x16
RenderButton {INPUT} at (0,0) size 17x16
layer at (24,506) size 17x16
RenderButton {INPUT} at (16,0) size 17x16
-layer at (45,506) size 246x16
- RenderSlider {INPUT} at (37,0) size 246x16
-layer at (45,507) size 15x15
- RenderBlock (relative positioned) {DIV} at (0,0) size 15x15
+layer at (40,506) size 256x16
+ RenderSlider {INPUT} at (32,0) size 256x16
+layer at (40,507) size 13x14
+ RenderBlock (relative positioned) {DIV} at (0,0) size 13x14
layer at (295,506) size 17x16
RenderButton {INPUT} at (287,0) size 17x16
layer at (311,506) size 17x16
RenderButton {INPUT} at (0,0) size 17x16
layer at (24,746) size 17x16
RenderButton {INPUT} at (16,0) size 17x16
-layer at (45,746) size 246x16
- RenderSlider {INPUT} at (37,0) size 246x16
-layer at (45,747) size 15x15
- RenderBlock (relative positioned) {DIV} at (0,0) size 15x15
+layer at (40,746) size 256x16
+ RenderSlider {INPUT} at (32,0) size 256x16
+layer at (40,747) size 13x14
+ RenderBlock (relative positioned) {DIV} at (0,0) size 13x14
layer at (295,746) size 17x16
RenderButton {INPUT} at (287,0) size 17x16
layer at (311,746) size 17x16
-3a4a9d54dc06beb8c235c812b8309e75
\ No newline at end of file
+ca88e90ac046e170895bf33ee22b9e8e
\ No newline at end of file
RenderButton {INPUT} at (0,0) size 17x16
layer at (24,250) size 17x16
RenderButton {INPUT} at (16,0) size 17x16
-layer at (45,250) size 246x16
- RenderSlider {INPUT} at (37,0) size 246x16
-layer at (45,251) size 15x15
- RenderBlock (relative positioned) {DIV} at (0,0) size 15x15
+layer at (40,250) size 256x16
+ RenderSlider {INPUT} at (32,0) size 256x16
+layer at (40,251) size 13x14
+ RenderBlock (relative positioned) {DIV} at (0,0) size 13x14
layer at (295,250) size 17x16
RenderButton {INPUT} at (287,0) size 17x16
layer at (311,250) size 17x16
+2008-01-15 Adele Peterson <adele@apple.com>
+
+ Reviewed by Adam and Antti.
+
+ WebCore part of fix for <rdar://problem/5619062> Add load progress indicator to video controls
+
+ * WebCore.base.exp: Removed symbol for wkGetMediaControlBackgroundImageData. Added symbol for wkDrawMediaSliderTrack.
+ * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Removed case for MediaBackgroundAppearance.
+ * css/html4.css: Removed -webkit-appearance: media-background rule for the media panel element. Removed unnecessary margin for slider.
+ * rendering/RenderStyle.h: (WebCore::): Removed MediaBackgroundAppearance.
+
+ * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::initAndDispatchProgressEvent):
+ Call updateMediaPlayer more frequently so the load progress control gets updated appropriately.
+ * platform/mac/WebCoreSystemInterface.h: Removed wkGetMediaControlBackgroundImageData. Added wkDrawMediaSliderTrack.
+ * platform/mac/WebCoreSystemInterface.mm: ditto.
+
+ * rendering/RenderTheme.h: Removed paintMediaBackground. Added paintMediaSliderTrack.
+ * rendering/RenderTheme.cpp: (WebCore::RenderTheme::paint): Call paintMediaSliderTrack for elements with MediaSliderAppearance.
+ * rendering/RenderThemeMac.h: Removed paintMediaBackground. Added paintMediaSliderTrack.
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::adjustSliderThumbSize): Added different sizes for the media slider thumb.
+ (WebCore::RenderThemeMac::paintMediaSliderTrack): Added. Calls wkDrawMediaSliderTrack with the percentage the media has loaded.
+ * rendering/RenderThemeSafari.cpp: ditto.
+ (WebCore::RenderThemeSafari::adjustSliderThumbSize):
+ (WebCore::RenderThemeSafari::paintMediaSliderTrack):
+ * rendering/RenderThemeSafari.h:
+
2008-01-15 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Mark Rowe.
_wkDrawMediaSeekBackButton
_wkDrawMediaSeekForwardButton
_wkDrawMediaSliderThumb
+_wkDrawMediaSliderTrack
_wkDrawMediaUnMuteButton
_wkDrawTextFieldCellFocusRing
_wkFontSmoothingModeIsLCD
_wkGetGlyphVectorNumGlyphs
_wkGetGlyphVectorRecordSize
_wkGetMIMETypeForExtension
-_wkGetMediaControlBackgroundImageData
_wkGetNSFontATSUFontId
_wkGetNSURLResponseCalculatedExpiration
_wkGetNSURLResponseLastModifiedDate
case ListItemAppearance:
m_value.ident = CSS_VAL_LISTITEM;
break;
- case MediaBackgroundAppearance:
- m_value.ident = CSS_VAL_MEDIA_BACKGROUND;
- break;
case MediaFullscreenButtonAppearance:
m_value.ident = CSS_VAL_MEDIA_FULLSCREEN_BUTTON;
break;
button-bevel
listbox
listitem
-media-background
media-fullscreen-button
media-mute-button
media-play-button
}
audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel {
- -webkit-appearance: media-background;
position: absolute;
bottom: 0;
width: 100%;
left: 32px;
right: 32px;
height: 16px;
- margin: 0px 5px;
}
audio::-webkit-media-controls-seek-back-button, video::-webkit-media-controls-seek-back-button {
unsigned loaded = m_player ? m_player->bytesLoaded() : 0;
unsigned total = m_player ? m_player->totalBytes() : 0;
dispatchProgressEvent(eventName, totalKnown, loaded, total);
+ if (renderer())
+ renderer()->updateFromElement();
}
void HTMLMediaElement::dispatchEventAsync(const AtomicString& eventName)
extern ATSLayoutRecord* (*wkGetGlyphVectorFirstRecord)(void* glyphVector);
extern int (*wkGetGlyphVectorNumGlyphs)(void* glyphVector);
extern size_t (*wkGetGlyphVectorRecordSize)(void* glyphVector);
-extern NSData* (*wkGetMediaControlBackgroundImageData)(void);
extern void (*wkDrawMediaFullscreenButton)(CGContextRef context, CGRect rect, BOOL active);
extern void (*wkDrawMediaMuteButton)(CGContextRef context, CGRect rect, BOOL active);
extern void (*wkDrawMediaPauseButton)(CGContextRef context, CGRect rect, BOOL active);
extern void (*wkDrawMediaPlayButton)(CGContextRef context, CGRect rect, BOOL active);
extern void (*wkDrawMediaSeekBackButton)(CGContextRef context, CGRect rect, BOOL active);
extern void (*wkDrawMediaSeekForwardButton)(CGContextRef context, CGRect rect, BOOL active);
+extern void (*wkDrawMediaSliderTrack)(CGContextRef context, CGRect rect, float percentLoaded);
extern void (*wkDrawMediaSliderThumb)(CGContextRef context, CGRect rect, BOOL active);
extern void (*wkDrawMediaUnMuteButton)(CGContextRef context, CGRect rect, BOOL active);
extern NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*);
ATSLayoutRecord* (*wkGetGlyphVectorFirstRecord)(void* glyphVector);
int (*wkGetGlyphVectorNumGlyphs)(void* glyphVector);
size_t (*wkGetGlyphVectorRecordSize)(void* glyphVector);
-NSData*(*wkGetMediaControlBackgroundImageData)(void);
void (*wkDrawMediaFullscreenButton)(CGContextRef context, CGRect rect, BOOL active);
void (*wkDrawMediaMuteButton)(CGContextRef context, CGRect rect, BOOL active);
void (*wkDrawMediaPauseButton)(CGContextRef context, CGRect rect, BOOL active);
void (*wkDrawMediaPlayButton)(CGContextRef context, CGRect rect, BOOL active);
void (*wkDrawMediaSeekBackButton)(CGContextRef context, CGRect rect, BOOL active);
void (*wkDrawMediaSeekForwardButton)(CGContextRef context, CGRect rect, BOOL active);
+void (*wkDrawMediaSliderTrack)(CGContextRef context, CGRect rect, float percentLoaded);
void (*wkDrawMediaSliderThumb)(CGContextRef context, CGRect rect, BOOL active);
void (*wkDrawMediaUnMuteButton)(CGContextRef context, CGRect rect, BOOL active);
NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*);
enum EAppearance {
NoAppearance, CheckboxAppearance, RadioAppearance, PushButtonAppearance, SquareButtonAppearance, ButtonAppearance,
ButtonBevelAppearance, ListboxAppearance, ListItemAppearance,
- MediaBackgroundAppearance, MediaFullscreenButtonAppearance, MediaMuteButtonAppearance, MediaPlayButtonAppearance,
+ MediaFullscreenButtonAppearance, MediaMuteButtonAppearance, MediaPlayButtonAppearance,
MediaSeekBackButtonAppearance, MediaSeekForwardButtonAppearance, MediaSliderAppearance, MediaSliderThumbAppearance,
MenulistAppearance, MenulistButtonAppearance, MenulistTextAppearance, MenulistTextFieldAppearance,
ScrollbarButtonUpAppearance, ScrollbarButtonDownAppearance,
return paintMenuList(o, paintInfo, r);
case SliderHorizontalAppearance:
case SliderVerticalAppearance:
- case MediaSliderAppearance:
return paintSliderTrack(o, paintInfo, r);
case SliderThumbHorizontalAppearance:
case SliderThumbVerticalAppearance:
return paintSliderThumb(o, paintInfo, r);
// We don't support drawing a slider thumb without a parent slider
break;
- case MediaBackgroundAppearance:
- return paintMediaBackground(o, paintInfo, r);
case MediaFullscreenButtonAppearance:
return paintMediaFullscreenButton(o, paintInfo, r);
case MediaPlayButtonAppearance:
return paintMediaSeekBackButton(o, paintInfo, r);
case MediaSeekForwardButtonAppearance:
return paintMediaSeekForwardButton(o, paintInfo, r);
+ case MediaSliderAppearance:
+ return paintMediaSliderTrack(o, paintInfo, r);
case MediaSliderThumbAppearance:
if (o->parent()->isSlider())
return paintMediaSliderThumb(o, paintInfo, r);
virtual void adjustSearchFieldResultsButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
virtual bool paintSearchFieldResultsButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
- virtual bool paintMediaBackground(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
virtual bool paintMediaFullscreenButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
virtual bool paintMediaPlayButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
virtual bool paintMediaMuteButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
virtual bool paintMediaSeekBackButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
virtual bool paintMediaSeekForwardButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
+ virtual bool paintMediaSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
virtual bool paintMediaSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
private:
virtual void adjustSearchFieldResultsButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
virtual bool paintSearchFieldResultsButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
- virtual bool paintMediaBackground(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaFullscreenButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaPlayButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaMuteButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaSeekBackButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaSeekForwardButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+ virtual bool paintMediaSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
private:
const int sliderThumbWidth = 15;
const int sliderThumbHeight = 15;
+const int mediaSliderThumbWidth = 13;
+const int mediaSliderThumbHeight = 14;
void RenderThemeMac::adjustSliderThumbSize(RenderObject* o) const
{
- if (o->style()->appearance() == SliderThumbHorizontalAppearance ||
- o->style()->appearance() == SliderThumbVerticalAppearance ||
- o->style()->appearance() == MediaSliderThumbAppearance) {
+ if (o->style()->appearance() == SliderThumbHorizontalAppearance || o->style()->appearance() == SliderThumbVerticalAppearance) {
o->style()->setWidth(Length(sliderThumbWidth, Fixed));
o->style()->setHeight(Length(sliderThumbHeight, Fixed));
+ } else if (o->style()->appearance() == MediaSliderThumbAppearance) {
+ o->style()->setWidth(Length(mediaSliderThumbWidth, Fixed));
+ o->style()->setHeight(Length(mediaSliderThumbHeight, Fixed));
}
}
return false;
}
-bool RenderThemeMac::paintMediaBackground(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
-{
- if (!m_mediaControlBackgroundImage) {
- m_mediaControlBackgroundImage = new BitmapImage;
- m_mediaControlBackgroundImage->setData(SharedBuffer::wrapNSData(wkGetMediaControlBackgroundImageData()), true);
- }
-
- LocalCurrentGraphicsContext localContext(paintInfo.context);
- paintInfo.context->drawTiledImage(m_mediaControlBackgroundImage, r,
- IntRect(0, 0, m_mediaControlBackgroundImage->width(), m_mediaControlBackgroundImage->height()),
- Image::RepeatTile, Image::StretchTile);
-
- return false;
-}
-
bool RenderThemeMac::paintMediaFullscreenButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
{
Node* node = o->element();
return false;
}
+bool RenderThemeMac::paintMediaSliderTrack(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+ Node* node = o->element();
+ Node* mediaNode = node ? node->shadowAncestorNode() : 0;
+ if (!mediaNode || (!mediaNode->hasTagName(videoTag) && !mediaNode->hasTagName(audioTag)))
+ return false;
+
+ HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(mediaNode);
+ if (!mediaElement)
+ return false;
+
+ float percentLoaded = 0;
+ if (MediaPlayer* player = mediaElement->player())
+ if (player->duration())
+ percentLoaded = player->maxTimeBuffered() / player->duration();
+
+ wkDrawMediaSliderTrack(paintInfo.context->platformContext(), r, percentLoaded);
+ return false;
+}
+
bool RenderThemeMac::paintMediaSliderThumb(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
{
Node* node = o->element();
#endif
SOFT_LINK(SafariTheme, paintThemePart, void, __stdcall, (ThemePart part, CGContextRef context, const CGRect& rect, NSControlSize size, ThemeControlState state), (part, context, rect, size, state))
+SOFT_LINK(SafariTheme, STPaintProgressIndicator, void, APIENTRY, (ProgressIndicatorType type, CGContextRef context, const CGRect& rect, NSControlSize size, ThemeControlState state, float value), (type, context, rect, size, state, value))
ThemeControlState RenderThemeSafari::determineState(RenderObject* o) const
{
const int sliderThumbWidth = 15;
const int sliderThumbHeight = 15;
+const int mediaSliderThumbWidth = 13;
+const int mediaSliderThumbHeight = 14;
void RenderThemeSafari::adjustSliderThumbSize(RenderObject* o) const
{
- if (o->style()->appearance() == SliderThumbHorizontalAppearance ||
- o->style()->appearance() == SliderThumbVerticalAppearance ||
- o->style()->appearance() == MediaSliderThumbAppearance) {
+ if (o->style()->appearance() == SliderThumbHorizontalAppearance || o->style()->appearance() == SliderThumbVerticalAppearance) {
o->style()->setWidth(Length(sliderThumbWidth, Fixed));
o->style()->setHeight(Length(sliderThumbHeight, Fixed));
+ } else if (o->style()->appearance() == MediaSliderThumbAppearance) {
+ o->style()->setWidth(Length(mediaSliderThumbWidth, Fixed));
+ o->style()->setHeight(Length(mediaSliderThumbHeight, Fixed));
}
+
}
bool RenderThemeSafari::paintSearchField(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
return false;
}
#if ENABLE(VIDEO)
-bool RenderThemeSafari::paintMediaBackground(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
-{
- ASSERT(SafariThemeLibrary());
-
-#if defined(SAFARI_THEME_VERSION) && SAFARI_THEME_VERSION >= 2
- paintThemePart(MediaBackgroundPart, paintInfo.context->platformContext(), r, NSRegularControlSize, 0);
-#endif
-
- return false;
-
-}
-
bool RenderThemeSafari::paintMediaFullscreenButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
{
ASSERT(SafariThemeLibrary());
return false;
}
+bool RenderThemeSafari::paintMediaSliderTrack(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+ Node* node = o->element();
+ Node* mediaNode = node ? node->shadowAncestorNode() : 0;
+ if (!mediaNode || (!mediaNode->hasTagName(videoTag) && !mediaNode->hasTagName(audioTag)))
+ return false;
+
+ HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(mediaNode);
+ if (!mediaElement)
+ return false;
+
+ float percentLoaded = 0;
+ if (MediaPlayer* player = mediaElement->player())
+ if (player->duration())
+ percentLoaded = player->maxTimeBuffered() / player->duration();
+
+#if defined(SAFARI_THEME_VERSION) && SAFARI_THEME_VERSION >= 2
+ STPaintProgressIndicator(SafariTheme::MediaType, paintInfo.context->platformContext(), r, NSRegularControlSize, 0, percentLoaded);
+#endif
+ return false;
+}
+
bool RenderThemeSafari::paintMediaSliderThumb(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
{
ASSERT(SafariThemeLibrary());
#include "RenderTheme.h"
+// If you have an empty placeholder SafariThemeConstants.h, then include SafariTheme.h
+// This is a workaround until a version of WebKitSupportLibrary is released with an updated SafariThemeConstants.h
+#include <SafariTheme/SafariThemeConstants.h>
+#ifndef SafariThemeConstants_h
#include <SafariTheme/SafariTheme.h>
+#endif
#if PLATFORM(WIN)
typedef void* HANDLE;
virtual bool paintCapsLockIndicator(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
#if ENABLE(VIDEO)
- virtual bool paintMediaBackground(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaFullscreenButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaPlayButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaMuteButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaSeekBackButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaSeekForwardButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+ virtual bool paintMediaSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
#endif
+2008-01-15 Adele Peterson <adele@apple.com>
+
+ Reviewed by Adam and Antti.
+
+ WebKit part of fix for <rdar://problem/5619062> Add load progress indicator to video controls
+
+ * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface):
+ Removed initialization for GetMediaControlBackgroundImageData. Added initialization for DrawMediaSliderTrack.
+
2008-01-10 Geoffrey Garen <ggaren@apple.com>
Reviewed by John Sullivan.
INIT(DrawMediaPlayButton);
INIT(DrawMediaSeekBackButton);
INIT(DrawMediaSeekForwardButton);
+ INIT(DrawMediaSliderTrack);
INIT(DrawMediaSliderThumb);
INIT(DrawMediaUnMuteButton);
INIT(DrawTextFieldCellFocusRing);
INIT(GetGlyphVectorFirstRecord);
INIT(GetGlyphVectorNumGlyphs);
INIT(GetGlyphVectorRecordSize);
- INIT(GetMediaControlBackgroundImageData);
INIT(GetMIMETypeForExtension);
INIT(GetNSFontATSUFontId);
INIT(GetNSURLResponseCalculatedExpiration);
+2008-01-15 Adele Peterson <adele@apple.com>
+
+ Reviewed by Adam and Antti.
+
+ Updated libraries for <rdar://problem/5619062> Add load progress indicator to video controls
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLeopard.a:
+ * libWebKitSystemInterfaceTiger.a:
+ * win/include/SafariTheme: Added.
+ * win/include/SafariTheme/SafariThemeConstants.h: Added. Placeholder empty header until we release an updated WebKitSupportLibrary.
+
2008-01-14 Steve Falkenburg <sfalken@apple.com>
Use shared vsprops for most vcproj properties.
CFStringRef WKCopyFoundationCacheDirectory(void);
-NSData *WKGetMediaControlBackgroundImageData(void);
void WKDrawMediaFullscreenButton(CGContextRef context, CGRect rect, BOOL active);
void WKDrawMediaMuteButton(CGContextRef context, CGRect rect, BOOL active);
void WKDrawMediaPauseButton(CGContextRef context, CGRect rect, BOOL active);
void WKDrawMediaPlayButton(CGContextRef context, CGRect rect, BOOL active);
void WKDrawMediaSeekBackButton(CGContextRef context, CGRect rect, BOOL active);
void WKDrawMediaSeekForwardButton(CGContextRef context, CGRect rect, BOOL active);
+void WKDrawMediaSliderTrack(CGContextRef context, CGRect rect, float percentLoaded);
void WKDrawMediaSliderThumb(CGContextRef context, CGRect rect, BOOL active);
void WKDrawMediaUnMuteButton(CGContextRef context, CGRect rect, BOOL active);
--- /dev/null
+// This is a placeholder header used in WebCore/rendering/RenderThemeSafari.h until a version of WebKitSupportLibrary containing this header is released