2009-07-06 Eric Carlson <eric.carlson@apple.com>
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Jul 2009 22:56:34 +0000 (22:56 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Jul 2009 22:56:34 +0000 (22:56 +0000)
        Reviewed by Darin Adler.

        <rdar://problem/7008093> Media controller can’t be used to scrub when movie is
        narrow — track is too narrow

        Do not show media controller time display elements when the a movie is too narrow.

        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:
            The 'state' parameter to wkDrawMediaUIPart is now an unsigned bitfield.

        * rendering/MediaControlElements.cpp:
        (WebCore::MediaControlTimeDisplayElement::MediaControlTimeDisplayElement):
            Give current time and time remaining controls a common base class.
        (WebCore::MediaControlTimeDisplayElement::setVisible):
            New method, hide and show the element.
        * rendering/MediaControlElements.h:

        * rendering/RenderMedia.cpp:
        (WebCore::RenderMedia::RenderMedia):
            Initialize m_previousVisible.
        (WebCore::RenderMedia::layout):
            Show/hide the time display elements as the movie width changes.
        (WebCore::RenderMedia::createCurrentTimeDisplay):
        (WebCore::RenderMedia::createTimeRemainingDisplay):
            Base class is now MediaControlTimeDisplayElement, not MediaControlElement.
        (WebCore::RenderMedia::shouldShowTimeDisplayControls):
            New, decide if time display elements should be visible or not.
        * rendering/RenderMedia.h:

        * rendering/RenderThemeMac.mm:
        (WebCore::):
        (WebCore::RenderThemeMac::paintMediaFullscreenButton):
        (WebCore::RenderThemeMac::paintMediaMuteButton):
        (WebCore::RenderThemeMac::paintMediaPlayButton):
        (WebCore::RenderThemeMac::paintMediaSeekBackButton):
        (WebCore::RenderThemeMac::paintMediaSeekForwardButton):
        (WebCore::RenderThemeMac::paintMediaSliderTrack):
        (WebCore::RenderThemeMac::paintMediaSliderThumb):
        (WebCore::RenderThemeMac::paintMediaRewindButton):
        (WebCore::RenderThemeMac::paintMediaReturnToRealtimeButton):
        (WebCore::RenderThemeMac::paintMediaControlsBackground):
        (WebCore::RenderThemeMac::paintMediaCurrentTime):
        (WebCore::RenderThemeMac::paintMediaTimeRemaining):
            The 'state' parameter to wkDrawMediaUIPart is now an unsigned bitfield.

2009-07-06  Eric Carlson  <eric.carlson@apple.com>

        Update WebKitSystemInterface for <rdar://problem/7008093>.

        * WebKitSystemInterface.h:
        * libWebKitSystemInterfaceLeopard.a:
        * libWebKitSystemInterfaceSnowLeopard.a:
        * libWebKitSystemInterfaceTiger.a:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@45572 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
WebCore/ChangeLog
WebCore/platform/mac/WebCoreSystemInterface.h
WebCore/platform/mac/WebCoreSystemInterface.mm
WebCore/rendering/MediaControlElements.cpp
WebCore/rendering/MediaControlElements.h
WebCore/rendering/RenderMedia.cpp
WebCore/rendering/RenderMedia.h
WebCore/rendering/RenderThemeMac.mm
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLeopard.a
WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
WebKitLibraries/libWebKitSystemInterfaceTiger.a

index e0e42b84425ed7f3a6632797d7bde77f52dca702..b2897bd3480bdb2def82db1b01fa7dba08923986 100644 (file)
@@ -1,3 +1,51 @@
+2009-07-06  Eric Carlson  <eric.carlson@apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/7008093> Media controller can’t be used to scrub when movie is 
+        narrow — track is too narrow
+
+        Do not show media controller time display elements when the a movie is too narrow.
+
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+            The 'state' parameter to wkDrawMediaUIPart is now an unsigned bitfield.
+
+        * rendering/MediaControlElements.cpp:
+        (WebCore::MediaControlTimeDisplayElement::MediaControlTimeDisplayElement):
+            Give current time and time remaining controls a common base class.
+        (WebCore::MediaControlTimeDisplayElement::setVisible):
+            New method, hide and show the element.
+        * rendering/MediaControlElements.h:
+
+        * rendering/RenderMedia.cpp:
+        (WebCore::RenderMedia::RenderMedia):
+            Initialize m_previousVisible.
+        (WebCore::RenderMedia::layout):
+            Show/hide the time display elements as the movie width changes.
+        (WebCore::RenderMedia::createCurrentTimeDisplay):
+        (WebCore::RenderMedia::createTimeRemainingDisplay):
+            Base class is now MediaControlTimeDisplayElement, not MediaControlElement.
+        (WebCore::RenderMedia::shouldShowTimeDisplayControls):
+            New, decide if time display elements should be visible or not.
+        * rendering/RenderMedia.h:
+
+        * rendering/RenderThemeMac.mm:
+        (WebCore::):
+        (WebCore::RenderThemeMac::paintMediaFullscreenButton):
+        (WebCore::RenderThemeMac::paintMediaMuteButton):
+        (WebCore::RenderThemeMac::paintMediaPlayButton):
+        (WebCore::RenderThemeMac::paintMediaSeekBackButton):
+        (WebCore::RenderThemeMac::paintMediaSeekForwardButton):
+        (WebCore::RenderThemeMac::paintMediaSliderTrack):
+        (WebCore::RenderThemeMac::paintMediaSliderThumb):
+        (WebCore::RenderThemeMac::paintMediaRewindButton):
+        (WebCore::RenderThemeMac::paintMediaReturnToRealtimeButton):
+        (WebCore::RenderThemeMac::paintMediaControlsBackground):
+        (WebCore::RenderThemeMac::paintMediaCurrentTime):
+        (WebCore::RenderThemeMac::paintMediaTimeRemaining):
+            The 'state' parameter to wkDrawMediaUIPart is now an unsigned bitfield.
+
 2009-07-06  David Kilzer  <ddkilzer@apple.com>
 
         Bug 27000: Minor clean up to runtime_root.{cpp|h}
index e644bbf31fa01e9229aa05acf22635a3cd67748f..768899e60cf9543cdc9d8166b8b67986a38c160d 100644 (file)
@@ -104,8 +104,9 @@ extern void (*wkDrawFocusRing)(CGContextRef, CGColorRef, int radius);
 extern NSFont* (*wkGetFontInLanguageForRange)(NSFont*, NSString*, NSRange);
 extern NSFont* (*wkGetFontInLanguageForCharacter)(NSFont*, UniChar);
 extern BOOL (*wkGetGlyphTransformedAdvances)(CGFontRef, NSFont*, CGAffineTransform*, ATSGlyphRef*, CGSize* advance);
-extern void (*wkDrawMediaSliderTrack)(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration);
-extern void (*wkDrawMediaUIPart)(int part, int themeStyle, CGContextRef context, CGRect rect, int state);
+extern void (*wkDrawMediaSliderTrack)(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, 
+    float duration, unsigned state);
+extern void (*wkDrawMediaUIPart)(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
 extern NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*);
 extern NSArray* (*wkGetExtensionsForMIMEType)(NSString*);
 extern NSString* (*wkGetMIMETypeForExtension)(NSString*);
index 974411a328c60556cc711e023becf772643ef588..d0e276f21bf9a8b5b9cffeca16029bdbe880dc85 100644 (file)
@@ -39,9 +39,10 @@ void (*wkDrawFocusRing)(CGContextRef, CGColorRef, int radius);
 NSFont* (*wkGetFontInLanguageForRange)(NSFont*, NSString*, NSRange);
 NSFont* (*wkGetFontInLanguageForCharacter)(NSFont*, UniChar);
 BOOL (*wkGetGlyphTransformedAdvances)(CGFontRef, NSFont*, CGAffineTransform*, ATSGlyphRef*, CGSize* advance);
-void (*wkDrawMediaSliderTrack)(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration);
+void (*wkDrawMediaSliderTrack)(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, 
+    float duration, unsigned state);
 BOOL (*wkHitTestMediaUIPart)(int part, int themeStyle, CGRect bounds, CGPoint point);
-void (*wkDrawMediaUIPart)(int part, int themeStyle, CGContextRef context, CGRect rect, int state);
+void (*wkDrawMediaUIPart)(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
 void (*wkMeasureMediaUIPart)(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
 NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*);
 NSArray* (*wkGetExtensionsForMIMEType)(NSString*);
index fbf8132ca1a8d2006f56a1b7050049b616dc1ac4..9046dfa845bb5c5a3b86d21eaef93cc742c9d239 100644 (file)
@@ -470,5 +470,27 @@ bool MediaControlFullscreenButtonElement::rendererIsNeeded(RenderStyle* style)
 
 // ----------------------------
 
+MediaControlTimeDisplayElement::MediaControlTimeDisplayElement(Document* doc, PseudoId pseudo, HTMLMediaElement* element)
+    : MediaControlElement(doc, pseudo, element)
+    , m_cachedWidth(Length(0, Fixed))
+{
+}
+
+void MediaControlTimeDisplayElement::setVisible(bool visible)
+{
+    if (!renderer() || !renderer()->style())
+        return;
+
+    if (!m_cachedWidth.value()) {
+        RenderStyle* style = m_mediaElement->renderer()->getCachedPseudoStyle(m_pseudoStyleId);
+        if (!style)
+            return;
+        m_cachedWidth = style->width();
+    }
+
+    renderer()->style()->setWidth(visible ? m_cachedWidth : Length(0, Fixed));
+}
+
+
 } //namespace WebCore
 #endif // enable(video)
index df78583a90a7e09bb468e5487e595f63c50016cd..4b8ca6405a53df34b167db13338b4f49ad5104a4 100644 (file)
@@ -200,6 +200,16 @@ public:
 
 // ----------------------------
 
+class MediaControlTimeDisplayElement : public MediaControlElement {
+public:
+    MediaControlTimeDisplayElement(Document*, PseudoId, HTMLMediaElement*);
+    void setVisible(bool);
+private:
+    Length m_cachedWidth;
+};
+
+// ----------------------------
+
 class RenderMediaControlShadowRoot : public RenderBlock {
 public:
     RenderMediaControlShadowRoot(Element* e) : RenderBlock(e) { }
@@ -208,6 +218,7 @@ public:
     
 // ----------------------------
 
+
 } //namespace WebCore
 #endif // enable(video)
 #endif // MediaControlElements_h
index 82e0876c3fd7e5f1628a11f9b39198444e8def68..b2cff39934e435316d4ab10f8d0312921cf8436e 100644 (file)
@@ -67,6 +67,7 @@ RenderMedia::RenderMedia(HTMLMediaElement* video, const IntSize& intrinsicSize)
     , m_opacityAnimationStartTime(0)
     , m_opacityAnimationFrom(0)
     , m_opacityAnimationTo(1.0f)
+    , m_previousVisible(VISIBLE)
 {
 }
 
@@ -131,6 +132,13 @@ void RenderMedia::layout()
         return;
     IntSize newSize = contentBoxRect().size();
     if (newSize != oldSize || controlsRenderer->needsLayout()) {
+
+        if (m_currentTimeDisplay && m_timeRemainingDisplay) {
+            bool shouldShowTimeDisplays = shouldShowTimeDisplayControls();
+            m_currentTimeDisplay->setVisible(shouldShowTimeDisplays);
+            m_timeRemainingDisplay->setVisible(shouldShowTimeDisplays);
+        }
+
         controlsRenderer->setLocation(borderLeft() + paddingLeft(), borderTop() + paddingTop());
         controlsRenderer->style()->setHeight(Length(newSize.height(), Fixed));
         controlsRenderer->style()->setWidth(Length(newSize.width(), Fixed));
@@ -221,14 +229,14 @@ void RenderMedia::createTimeline()
 void RenderMedia::createCurrentTimeDisplay()
 {
     ASSERT(!m_currentTimeDisplay);
-    m_currentTimeDisplay = new MediaControlElement(document(), MEDIA_CONTROLS_CURRENT_TIME_DISPLAY, mediaElement());
+    m_currentTimeDisplay = new MediaControlTimeDisplayElement(document(), MEDIA_CONTROLS_CURRENT_TIME_DISPLAY, mediaElement());
     m_currentTimeDisplay->attachToParent(m_timelineContainer.get());
 }
 
 void RenderMedia::createTimeRemainingDisplay()
 {
     ASSERT(!m_timeRemainingDisplay);
-    m_timeRemainingDisplay = new MediaControlElement(document(), MEDIA_CONTROLS_TIME_REMAINING_DISPLAY, mediaElement());
+    m_timeRemainingDisplay = new MediaControlTimeDisplayElement(document(), MEDIA_CONTROLS_TIME_REMAINING_DISPLAY, mediaElement());
     m_timeRemainingDisplay->attachToParent(m_timelineContainer.get());
 }
 
@@ -497,6 +505,19 @@ int RenderMedia::leftmostPosition(bool includeOverflowInterior, bool includeSelf
     return min(left, m_controlsShadowRoot->renderBox()->x() +  m_controlsShadowRoot->renderBox()->leftmostPosition(includeOverflowInterior, includeSelf));
 }
 
+
+// We want the timeline slider to be at least 100 pixels wide.
+static const int minWidthToDisplayTimeDisplays = 16 + 16 + 45 + 100 + 45 + 16 + 1;
+
+bool RenderMedia::shouldShowTimeDisplayControls() const
+{
+    if (!m_currentTimeDisplay && !m_timeRemainingDisplay)
+        return false;
+
+    int width = mediaElement()->renderBox()->width();
+    return width >= minWidthToDisplayTimeDisplays;
+}
+
 } // namespace WebCore
 
 #endif
index be9b38a2ad82e4964a9b5165b2cef56965c48602..4081b7d9e04d40b23a8cff3558de1a1cc506de85 100644 (file)
@@ -71,6 +71,8 @@ public:
 
     static String formatTime(float time);
 
+    bool shouldShowTimeDisplayControls() const;
+
     void updateFromElement();
     void updatePlayer();
     void updateControls();
@@ -118,8 +120,8 @@ private:
     RefPtr<MediaControlTimelineElement> m_timeline;
     RefPtr<MediaControlFullscreenButtonElement> m_fullscreenButton;
     RefPtr<MediaControlTimelineContainerElement> m_timelineContainer;
-    RefPtr<MediaControlElement> m_currentTimeDisplay;
-    RefPtr<MediaControlElement> m_timeRemainingDisplay;
+    RefPtr<MediaControlTimeDisplayElement> m_currentTimeDisplay;
+    RefPtr<MediaControlTimeDisplayElement> m_timeRemainingDisplay;
     RefPtr<MediaControlStatusDisplayElement> m_statusDisplay;
     RenderObjectChildList m_children;
     Node* m_lastUnderNode;
index e9ac2b57d12645c8a7d90652621802052f6a6aee..94a27e28001cf920bd6859ace75fb5ec39280841 100644 (file)
@@ -34,6 +34,7 @@
 #import "Image.h"
 #import "LocalCurrentGraphicsContext.h"
 #import "MediaControlElements.h"
+#import "RenderMedia.h"
 #import "RenderSlider.h"
 #import "RenderView.h"
 #import "SharedBuffer.h"
@@ -1477,6 +1478,13 @@ void RenderThemeMac::adjustSliderThumbSize(RenderObject* o) const
 
 #if ENABLE(VIDEO)
 
+enum WKMediaControllerThemeState { 
+    MediaUIPartDisbledFlag = 1 << 0,
+    MediaUIPartPressedFlag = 1 << 1,
+    MediaUIPartDrawEndCapsFlag = 1 << 3,
+};
+
+
 // Utility to scale when the UI part are not scaled by wkDrawMediaUIPart
 static FloatRect getUnzoomedRectAndAdjustCurrentContext(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect &originalRect)
 {
@@ -1492,6 +1500,7 @@ static FloatRect getUnzoomedRectAndAdjustCurrentContext(RenderObject* o, const R
     return unzoomedRect;
 }
 
+
 bool RenderThemeMac::paintMediaFullscreenButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
 {
     Node* node = o->node();
@@ -1499,7 +1508,8 @@ bool RenderThemeMac::paintMediaFullscreenButton(RenderObject* o, const RenderObj
         return false;
 
     LocalCurrentGraphicsContext localContext(paintInfo.context);
-    wkDrawMediaUIPart(MediaFullscreenButton, mediaControllerTheme(), paintInfo.context->platformContext(), r, node->active());
+    wkDrawMediaUIPart(MediaFullscreenButton, mediaControllerTheme(), paintInfo.context->platformContext(), r, 
+        node->active() ? MediaUIPartPressedFlag : 0);
     return false;
 }
 
@@ -1512,7 +1522,9 @@ bool RenderThemeMac::paintMediaMuteButton(RenderObject* o, const RenderObject::P
 
     if (MediaControlPlayButtonElement* btn = static_cast<MediaControlPlayButtonElement*>(node)) {
         LocalCurrentGraphicsContext localContext(paintInfo.context);
-        wkDrawMediaUIPart(btn->displayType(), mediaControllerTheme(), paintInfo.context->platformContext(), r, node->active());
+        wkDrawMediaUIPart(btn->displayType(), mediaControllerTheme(), paintInfo.context->platformContext(), r, 
+            node->active() ? MediaUIPartPressedFlag : 0);
+
     }
     return false;
 }
@@ -1526,7 +1538,8 @@ bool RenderThemeMac::paintMediaPlayButton(RenderObject* o, const RenderObject::P
 
     if (MediaControlPlayButtonElement* btn = static_cast<MediaControlPlayButtonElement*>(node)) {
         LocalCurrentGraphicsContext localContext(paintInfo.context);
-        wkDrawMediaUIPart(btn->displayType(), mediaControllerTheme(), paintInfo.context->platformContext(), r, node->active());
+        wkDrawMediaUIPart(btn->displayType(), mediaControllerTheme(), paintInfo.context->platformContext(), r, 
+            node->active() ? MediaUIPartPressedFlag : 0);
     }
     return false;
 }
@@ -1538,8 +1551,9 @@ bool RenderThemeMac::paintMediaSeekBackButton(RenderObject* o, const RenderObjec
         return false;
 
     LocalCurrentGraphicsContext localContext(paintInfo.context);
-    wkDrawMediaUIPart(MediaSeekBackButton, mediaControllerTheme(), paintInfo.context->platformContext(), r, node->active());
-    return false;
+    wkDrawMediaUIPart(MediaSeekBackButton, mediaControllerTheme(), paintInfo.context->platformContext(), r, 
+        node->active() ? MediaUIPartPressedFlag : 0);
+     return false;
 }
 
 bool RenderThemeMac::paintMediaSeekForwardButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
@@ -1549,8 +1563,9 @@ bool RenderThemeMac::paintMediaSeekForwardButton(RenderObject* o, const RenderOb
         return false;
 
     LocalCurrentGraphicsContext localContext(paintInfo.context);
-    wkDrawMediaUIPart(MediaSeekForwardButton, mediaControllerTheme(), paintInfo.context->platformContext(), r, node->active());
-    return false;
+    wkDrawMediaUIPart(MediaSeekForwardButton, mediaControllerTheme(), paintInfo.context->platformContext(), r, 
+        node->active() ? MediaUIPartPressedFlag : 0);
+     return false;
 }
 
 bool RenderThemeMac::paintMediaSliderTrack(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
@@ -1575,7 +1590,9 @@ bool RenderThemeMac::paintMediaSliderTrack(RenderObject* o, const RenderObject::
  
     paintInfo.context->save();
     FloatRect unzoomedRect = getUnzoomedRectAndAdjustCurrentContext(o, paintInfo, r);
-    wkDrawMediaSliderTrack(mediaControllerTheme(), paintInfo.context->platformContext(), unzoomedRect, timeLoaded, currentTime, duration);
+    bool shouldDrawEndCaps = !static_cast<RenderMedia*>(mediaElement->renderer())->shouldShowTimeDisplayControls();
+    wkDrawMediaSliderTrack(mediaControllerTheme(), paintInfo.context->platformContext(), unzoomedRect, 
+        timeLoaded, currentTime, duration, shouldDrawEndCaps ? MediaUIPartDrawEndCapsFlag : 0);
     paintInfo.context->restore();
     return false;
 }
@@ -1587,8 +1604,9 @@ bool RenderThemeMac::paintMediaSliderThumb(RenderObject* o, const RenderObject::
         return false;
 
     LocalCurrentGraphicsContext localContext(paintInfo.context);
-    wkDrawMediaUIPart(MediaSliderThumb, mediaControllerTheme(), paintInfo.context->platformContext(), r, node->active());
-    return false;
+    wkDrawMediaUIPart(MediaSliderThumb, mediaControllerTheme(), paintInfo.context->platformContext(), r, 
+        node->active() ? MediaUIPartPressedFlag : 0);
+     return false;
 }
     
 bool RenderThemeMac::paintMediaRewindButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
@@ -1598,8 +1616,9 @@ bool RenderThemeMac::paintMediaRewindButton(RenderObject* o, const RenderObject:
         return false;
     
     LocalCurrentGraphicsContext localContext(paintInfo.context);
-    wkDrawMediaUIPart(MediaRewindButton, mediaControllerTheme(), paintInfo.context->platformContext(), r, node->active());
-    return false;
+    wkDrawMediaUIPart(MediaRewindButton, mediaControllerTheme(), paintInfo.context->platformContext(), r, 
+        node->active() ? MediaUIPartPressedFlag : 0);
+     return false;
 }
 
 bool RenderThemeMac::paintMediaReturnToRealtimeButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
@@ -1609,8 +1628,9 @@ bool RenderThemeMac::paintMediaReturnToRealtimeButton(RenderObject* o, const Ren
         return false;
     
     LocalCurrentGraphicsContext localContext(paintInfo.context);
-    wkDrawMediaUIPart(MediaReturnToRealtimeButton, mediaControllerTheme(), paintInfo.context->platformContext(), r, node->active());
-    return false;
+    wkDrawMediaUIPart(MediaReturnToRealtimeButton, mediaControllerTheme(), paintInfo.context->platformContext(), r, 
+        node->active() ? MediaUIPartPressedFlag : 0);
+     return false;
 }
 
 
@@ -1621,8 +1641,9 @@ bool RenderThemeMac::paintMediaControlsBackground(RenderObject* o, const RenderO
         return false;
 
     LocalCurrentGraphicsContext localContext(paintInfo.context);
-    wkDrawMediaUIPart(MediaTimelineContainer, mediaControllerTheme(), paintInfo.context->platformContext(), r, node->active());
-    return false;
+    wkDrawMediaUIPart(MediaTimelineContainer, mediaControllerTheme(), paintInfo.context->platformContext(), r, 
+        node->active() ? MediaUIPartPressedFlag : 0);
+     return false;
 }
 
 bool RenderThemeMac::paintMediaCurrentTime(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
@@ -1633,7 +1654,8 @@ bool RenderThemeMac::paintMediaCurrentTime(RenderObject* o, const RenderObject::
 
     paintInfo.context->save();
     FloatRect unzoomedRect = getUnzoomedRectAndAdjustCurrentContext(o, paintInfo, r);
-    wkDrawMediaUIPart(MediaCurrentTimeDisplay, mediaControllerTheme(), paintInfo.context->platformContext(), unzoomedRect, node->active());
+    wkDrawMediaUIPart(MediaCurrentTimeDisplay, mediaControllerTheme(), paintInfo.context->platformContext(), unzoomedRect, 
+        node->active() ? MediaUIPartPressedFlag : 0);
     paintInfo.context->restore();
     return false;
 }
@@ -1646,7 +1668,8 @@ bool RenderThemeMac::paintMediaTimeRemaining(RenderObject* o, const RenderObject
 
     paintInfo.context->save();
     FloatRect unzoomedRect = getUnzoomedRectAndAdjustCurrentContext(o, paintInfo, r);
-    wkDrawMediaUIPart(MediaTimeRemainingDisplay, mediaControllerTheme(), paintInfo.context->platformContext(), unzoomedRect, node->active());
+    wkDrawMediaUIPart(MediaTimeRemainingDisplay, mediaControllerTheme(), paintInfo.context->platformContext(), unzoomedRect, 
+         node->active() ? MediaUIPartPressedFlag : 0);
     paintInfo.context->restore();
     return false;
 }
index fef845622d4845cafe60a0f0ff6f76be4b049006..b37ce98480c9e05d69c9a37b055881d2a44d32b7 100644 (file)
@@ -1,3 +1,12 @@
+2009-07-06  Eric Carlson  <eric.carlson@apple.com>
+
+        Update WebKitSystemInterface for <rdar://problem/7008093>.
+
+        * WebKitSystemInterface.h:
+        * libWebKitSystemInterfaceLeopard.a:
+        * libWebKitSystemInterfaceSnowLeopard.a:
+        * libWebKitSystemInterfaceTiger.a:
+
 2009-07-06  Anders Carlsson  <andersca@apple.com>
 
         Update WebKitSystemInterface.
index 38cb1ba90a2cf75cd2517213d50cec1fa30981db..453bf8b29e1292805a04b4fafe6cdd77efc61148 100644 (file)
@@ -220,15 +220,15 @@ typedef enum {
 } WKMediaControllerThemeStyle;
 
 typedef enum {
-    WKMediaControllerStateNormal     = 0,
-    WKMediaControllerStateActivated  = 1,
-    WKMediaControllerStateDisabled   = 2
+    WKMediaControllerFlagDisbled = 1 << 0,
+    WKMediaControllerFlagPressed = 1 << 1,
+    WKMediaControllerFlagDrawEndCaps = 1 << 3,
 } WKMediaControllerThemeState;
 
 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
-void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, int state);
-void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration);
+void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
+void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
 
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && defined(__x86_64__)
 mach_port_t WKInitializeRenderServer(void);
index 47dad9fe1fbe25fa4fbf1d3606041b983150d4dd..f99e1732c1d51ee08d028d1165380f7e5c4bc407 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
index 75310b996b9c68ef85a99ee148259788af8b01a2..e9b919353fd23e369dc680325bada76746ff0ced 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a differ
index fdf317029ad7f6e2f1209b80999ccb4be607d6a1..b46034cdba0d5bc61aec6d774d1d878e7d19f2d4 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceTiger.a and b/WebKitLibraries/libWebKitSystemInterfaceTiger.a differ