WebCore:
authoradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2008 20:37:25 +0000 (20:37 +0000)
committeradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2008 20:37:25 +0000 (20:37 +0000)
        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

32 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/media/audio-controls-rendering-expected.checksum
LayoutTests/platform/mac/media/audio-controls-rendering-expected.png
LayoutTests/platform/mac/media/audio-controls-rendering-expected.txt
LayoutTests/platform/mac/media/video-controls-rendering-expected.checksum
LayoutTests/platform/mac/media/video-controls-rendering-expected.png
LayoutTests/platform/mac/media/video-controls-rendering-expected.txt
LayoutTests/platform/mac/media/video-display-toggle-expected.checksum
LayoutTests/platform/mac/media/video-display-toggle-expected.png
LayoutTests/platform/mac/media/video-display-toggle-expected.txt
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/css/CSSPrimitiveValueMappings.h
WebCore/css/CSSValueKeywords.in
WebCore/css/html4.css
WebCore/html/HTMLMediaElement.cpp
WebCore/platform/mac/WebCoreSystemInterface.h
WebCore/platform/mac/WebCoreSystemInterface.mm
WebCore/rendering/RenderStyle.h
WebCore/rendering/RenderTheme.cpp
WebCore/rendering/RenderTheme.h
WebCore/rendering/RenderThemeMac.h
WebCore/rendering/RenderThemeMac.mm
WebCore/rendering/RenderThemeSafari.cpp
WebCore/rendering/RenderThemeSafari.h
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebSystemInterface.m
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLeopard.a
WebKitLibraries/libWebKitSystemInterfaceTiger.a
WebKitLibraries/win/include/SafariTheme/SafariThemeConstants.h [new file with mode: 0644]

index 0594521..03b323f 100644 (file)
@@ -1,3 +1,19 @@
+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
index 4d02e73..b4d114d 100644 (file)
Binary files a/LayoutTests/platform/mac/media/audio-controls-rendering-expected.png and b/LayoutTests/platform/mac/media/audio-controls-rendering-expected.png differ
index 813f950..bc8fca8 100644 (file)
@@ -24,10 +24,10 @@ layer at (8,42) size 17x16
   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
@@ -41,10 +41,10 @@ layer at (8,76) 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
@@ -60,10 +60,10 @@ layer at (8,194) 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
index c496f75..47c9d79 100644 (file)
Binary files a/LayoutTests/platform/mac/media/video-controls-rendering-expected.png and b/LayoutTests/platform/mac/media/video-controls-rendering-expected.png differ
index eae2ec0..ae21982 100644 (file)
@@ -22,10 +22,10 @@ layer at (8,266) size 17x16
   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
@@ -39,10 +39,10 @@ layer at (8,506) 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
@@ -58,10 +58,10 @@ layer at (8,746) 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
index dc5608d..6ed6c12 100644 (file)
Binary files a/LayoutTests/platform/mac/media/video-display-toggle-expected.png and b/LayoutTests/platform/mac/media/video-display-toggle-expected.png differ
index a255264..497a74c 100644 (file)
@@ -19,10 +19,10 @@ layer at (8,250) size 17x16
   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
index 33e8c6d..332afed 100644 (file)
@@ -1,3 +1,30 @@
+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.
index 296078a..38a2264 100644 (file)
@@ -733,6 +733,7 @@ _wkDrawMediaPlayButton
 _wkDrawMediaSeekBackButton
 _wkDrawMediaSeekForwardButton
 _wkDrawMediaSliderThumb
+_wkDrawMediaSliderTrack
 _wkDrawMediaUnMuteButton
 _wkDrawTextFieldCellFocusRing
 _wkFontSmoothingModeIsLCD
@@ -747,7 +748,6 @@ _wkGetGlyphVectorFirstRecord
 _wkGetGlyphVectorNumGlyphs
 _wkGetGlyphVectorRecordSize
 _wkGetMIMETypeForExtension
-_wkGetMediaControlBackgroundImageData
 _wkGetNSFontATSUFontId
 _wkGetNSURLResponseCalculatedExpiration
 _wkGetNSURLResponseLastModifiedDate
index bf19ffc..502f737 100644 (file)
@@ -191,9 +191,6 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EAppearance e)
         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;
index 94890e2..a8c0062 100644 (file)
@@ -493,7 +493,6 @@ button
 button-bevel
 listbox
 listitem
-media-background
 media-fullscreen-button
 media-mute-button
 media-play-button
index 80b12e4..f266265 100644 (file)
@@ -593,7 +593,6 @@ audio {
 }
 
 audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel {
-    -webkit-appearance: media-background;
     position: absolute;
     bottom: 0;
     width: 100%;
@@ -630,7 +629,6 @@ audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline {
     left: 32px;
     right: 32px;
     height: 16px;
-    margin: 0px 5px;
 }
 
 audio::-webkit-media-controls-seek-back-button, video::-webkit-media-controls-seek-back-button {
index 58a4e48..73da9ad 100644 (file)
@@ -164,6 +164,8 @@ void HTMLMediaElement::initAndDispatchProgressEvent(const AtomicString& eventNam
     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)
index d45aaf1..fbbacd2 100644 (file)
@@ -103,13 +103,13 @@ extern BOOL (*wkGetGlyphTransformedAdvances)(CGFontRef, NSFont*, CGAffineTransfo
 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*);
index 11a7a56..9e8856d 100644 (file)
@@ -46,13 +46,13 @@ BOOL (*wkGetGlyphTransformedAdvances)(CGFontRef, NSFont*, CGAffineTransform*, AT
 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*);
index b5c61bc..a81cbe6 100644 (file)
@@ -955,7 +955,7 @@ enum EResize {
 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, 
index ea940a4..8ebbb7e 100644 (file)
@@ -122,7 +122,6 @@ bool RenderTheme::paint(RenderObject* o, const RenderObject::PaintInfo& paintInf
             return paintMenuList(o, paintInfo, r);
         case SliderHorizontalAppearance:
         case SliderVerticalAppearance:
-        case MediaSliderAppearance:
             return paintSliderTrack(o, paintInfo, r);
         case SliderThumbHorizontalAppearance:
         case SliderThumbVerticalAppearance:
@@ -130,8 +129,6 @@ bool RenderTheme::paint(RenderObject* o, const RenderObject::PaintInfo& paintInf
                 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:
@@ -142,6 +139,8 @@ bool RenderTheme::paint(RenderObject* o, const RenderObject::PaintInfo& paintInf
             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);
index 6e6d260..966c077 100644 (file)
@@ -193,12 +193,12 @@ protected:
     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:
index 9533cae..e6b2818 100644 (file)
@@ -127,12 +127,12 @@ protected:
     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:
index bd52620..6fa92cd 100644 (file)
@@ -1297,14 +1297,17 @@ bool RenderThemeMac::paintSliderThumb(RenderObject* o, const RenderObject::Paint
 
 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));
     }
 }
 
@@ -1487,21 +1490,6 @@ bool RenderThemeMac::paintSearchFieldResultsButton(RenderObject* o, const Render
     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();
@@ -1573,6 +1561,26 @@ bool RenderThemeMac::paintMediaSeekForwardButton(RenderObject* o, const RenderOb
     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();
index 803e6fc..879ad41 100644 (file)
@@ -74,6 +74,7 @@ SOFT_LINK_LIBRARY(SafariTheme)
 #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
 {
@@ -960,15 +961,19 @@ bool RenderThemeSafari::paintSliderThumb(RenderObject* o, const RenderObject::Pa
 
 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)
@@ -1116,18 +1121,6 @@ bool RenderThemeSafari::paintSearchFieldResultsButton(RenderObject* o, const Ren
     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());
@@ -1201,6 +1194,28 @@ bool RenderThemeSafari::paintMediaSeekForwardButton(RenderObject* o, const Rende
     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());
index 634492c..543dd22 100644 (file)
 
 #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;
@@ -122,12 +127,12 @@ protected:
     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
 
index eafd8f8..22c6dc1 100644 (file)
@@ -1,3 +1,12 @@
+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.
index e4f7f0d..e20adfd 100644 (file)
@@ -54,6 +54,7 @@ void InitWebCoreSystemInterface(void)
     INIT(DrawMediaPlayButton);
     INIT(DrawMediaSeekBackButton);
     INIT(DrawMediaSeekForwardButton);
+    INIT(DrawMediaSliderTrack);
     INIT(DrawMediaSliderThumb);
     INIT(DrawMediaUnMuteButton);
     INIT(DrawTextFieldCellFocusRing);
@@ -68,7 +69,6 @@ void InitWebCoreSystemInterface(void)
     INIT(GetGlyphVectorFirstRecord);
     INIT(GetGlyphVectorNumGlyphs);
     INIT(GetGlyphVectorRecordSize);
-    INIT(GetMediaControlBackgroundImageData);
     INIT(GetMIMETypeForExtension);
     INIT(GetNSFontATSUFontId);
     INIT(GetNSURLResponseCalculatedExpiration);
index 63fa186..3b9ad36 100644 (file)
@@ -1,3 +1,15 @@
+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.
index 64878ff..de8cb12 100644 (file)
@@ -165,13 +165,13 @@ void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
 
 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);
 
index c7680e6..48fbd61 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
index ed7b744..b73a60a 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceTiger.a and b/WebKitLibraries/libWebKitSystemInterfaceTiger.a differ
diff --git a/WebKitLibraries/win/include/SafariTheme/SafariThemeConstants.h b/WebKitLibraries/win/include/SafariTheme/SafariThemeConstants.h
new file mode 100644 (file)
index 0000000..e21d6ae
--- /dev/null
@@ -0,0 +1 @@
+// This is a placeholder header used in WebCore/rendering/RenderThemeSafari.h until a version of WebKitSupportLibrary containing this header is released