+2008-01-07 Adele Peterson <adele@apple.com>
+
+ Reviewed by Antti, Adam, and Mitz.
+
+ Updated results for:
+ <rdar://problem/5619073> Updated look for <video> controls
+ <rdar://problem/5619057> Add volume control 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-07 Alice Liu <alice.liu@apple.com>
Reviewed by Sam.
-73ef9fddb8d97b62acaa265d2ed0668b
\ No newline at end of file
+543d9e24ff0b46122a92e5cb6c81e891
\ No newline at end of file
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 153x18
text run at (0,0) width 153: "Test controls placement."
- RenderBlock (anonymous) at (0,34) size 784x174
- RenderMedia {AUDIO} at (0,0) size 234x69 [bgcolor=#0000FF]
- RenderBR {BR} at (234,69) size 0x0
- RenderBR {BR} at (0,69) size 0x18
- RenderMedia {AUDIO} at (0,87) size 320x69 [bgcolor=#0000FF]
- RenderBR {BR} at (320,156) size 0x0
- RenderBR {BR} at (0,156) size 0x18
- RenderBlock (anonymous) at (0,208) size 784x18
+ RenderBlock (anonymous) at (0,34) size 784x68
+ RenderMedia {AUDIO} at (0,0) size 200x16 [bgcolor=#0000FF]
+ RenderBR {BR} at (200,16) size 0x0
+ RenderBR {BR} at (0,16) size 0x18
+ RenderMedia {AUDIO} at (0,34) size 320x16 [bgcolor=#0000FF]
+ RenderBR {BR} at (320,50) size 0x0
+ RenderBR {BR} at (0,50) size 0x18
+ RenderBlock (anonymous) at (0,102) size 784x18
RenderBR {BR} at (0,0) size 0x18
-layer at (8,42) size 234x69
- RenderBlock (positioned) {DIV} at (8,42) size 234x69
-layer at (8,42) size 234x69
- RenderBlock (positioned) {DIV} at (0,0) size 234x69 [bgcolor=#00000099] [border: (2px solid #EEEEEE)]
-layer at (92,49) size 66x40
- RenderButton {INPUT} at (84,7) size 66x40 [color=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 66x40
- RenderText at (23,0) size 19x38
- text run at (23,0) width 19: ">"
-layer at (15,88) size 220x16
- RenderBlock (positioned) {DIV} at (7,46) size 220x16 [bgcolor=#EEEEEE]
- RenderText {#text} at (165,0) size 50x15
- text run at (165,0) width 50: "00:00:00"
-layer at (8,129) size 320x69
- RenderBlock (positioned) {DIV} at (8,129) size 320x69
-layer at (51,129) size 234x69
- RenderBlock (positioned) {DIV} at (43,0) size 234x69 [bgcolor=#00000099] [border: (2px solid #EEEEEE)]
-layer at (135,136) size 66x40
- RenderButton {INPUT} at (84,7) size 66x40 [color=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 66x40
- RenderText at (23,0) size 19x38
- text run at (23,0) width 19: ">"
-layer at (58,175) size 220x16
- RenderBlock (positioned) {DIV} at (7,46) size 220x16 [bgcolor=#EEEEEE]
- RenderText {#text} at (165,0) size 50x15
- text run at (165,0) width 50: "00:00:00"
-layer at (8,216) size 320x100
- RenderMedia {AUDIO} at (8,216) size 320x100 [bgcolor=#0000FF]
-layer at (8,216) size 320x100
- RenderBlock (positioned) {DIV} at (0,0) size 320x100
-layer at (51,231) size 234x69
- RenderBlock (positioned) {DIV} at (43,15) size 234x69 [bgcolor=#00000099] [border: (2px solid #EEEEEE)]
-layer at (135,238) size 66x40
- RenderButton {INPUT} at (84,7) size 66x40 [color=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 66x40
- RenderText at (23,0) size 19x38
- text run at (23,0) width 19: ">"
-layer at (58,277) size 220x16
- RenderBlock (positioned) {DIV} at (7,46) size 220x16 [bgcolor=#EEEEEE]
- RenderText {#text} at (165,0) size 50x15
- text run at (165,0) width 50: "00:00:00"
-layer at (20,87) size 142x17
- RenderSlider zI: 1 {INPUT} at (12,45) size 142x16 [border: (2px solid #FFFFFF)]
-layer at (22,90) size 15x15
- RenderBlock (relative positioned) {DIV} at (2,2) size 15x15
-layer at (63,174) size 142x17
- RenderSlider zI: 1 {INPUT} at (12,45) size 142x16 [border: (2px solid #FFFFFF)]
-layer at (65,177) size 15x15
- RenderBlock (relative positioned) {DIV} at (2,2) size 15x15
-layer at (63,276) size 142x17
- RenderSlider zI: 1 {INPUT} at (12,45) size 142x16 [border: (2px solid #FFFFFF)]
-layer at (65,279) size 15x15
- RenderBlock (relative positioned) {DIV} at (2,2) size 15x15
+layer at (8,42) size 200x16
+ RenderBlock (relative positioned) {DIV} at (0,0) size 200x16
+layer at (8,42) size 200x18
+ RenderBlock (positioned) {DIV} at (0,0) size 200x16
+ RenderButton {INPUT} at (0,0) size 200x18
+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 (175,42) size 17x16
+ RenderButton {INPUT} at (167,0) size 17x16
+layer at (191,42) size 17x16
+ RenderButton {INPUT} at (183,0) size 17x16
+layer at (8,76) size 320x16
+ RenderBlock (relative positioned) {DIV} at (0,0) size 320x16
+layer at (8,76) size 320x18
+ RenderBlock (positioned) {DIV} at (0,0) size 320x16
+ RenderButton {INPUT} at (0,0) size 320x18
+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 (295,76) size 17x16
+ RenderButton {INPUT} at (287,0) size 17x16
+layer at (311,76) size 17x16
+ RenderButton {INPUT} at (303,0) size 17x16
+layer at (8,110) size 320x100
+ RenderMedia {AUDIO} at (8,110) size 320x100 [bgcolor=#0000FF]
+layer at (8,110) size 320x100
+ RenderBlock (relative positioned) {DIV} at (0,0) size 320x100
+layer at (8,194) size 320x18
+ RenderBlock (positioned) {DIV} at (0,84) size 320x16
+ RenderButton {INPUT} at (0,0) size 320x18
+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 (295,194) size 17x16
+ RenderButton {INPUT} at (287,0) size 17x16
+layer at (311,194) size 17x16
+ RenderButton {INPUT} at (303,0) size 17x16
-743910ccf010e7b8bf0835d51979124f
\ No newline at end of file
+7b3f3dcbdcc080767b89400162bd90cf
\ No newline at end of file
RenderBlock (anonymous) at (0,514) size 769x18
RenderBR {BR} at (0,0) size 0x18
layer at (8,42) size 320x240
- RenderBlock (positioned) {DIV} at (8,42) size 320x240
-layer at (51,189) size 234x69
- RenderBlock (positioned) {DIV} at (43,147) size 234x69 [bgcolor=#00000099] [border: (2px solid #EEEEEE)]
-layer at (135,196) size 66x40
- RenderButton {INPUT} at (84,7) size 66x40 [color=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 66x40
- RenderText at (23,0) size 19x38
- text run at (23,0) width 19: ">"
-layer at (58,235) size 220x16
- RenderBlock (positioned) {DIV} at (7,46) size 220x16 [bgcolor=#EEEEEE]
- RenderText {#text} at (165,0) size 50x15
- text run at (165,0) width 50: "00:00:00"
+ RenderBlock (relative positioned) {DIV} at (0,0) size 320x240
+layer at (8,266) size 320x18
+ RenderBlock (positioned) {DIV} at (0,224) size 320x16
+ RenderButton {INPUT} at (0,0) size 320x18
+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 (295,266) size 17x16
+ RenderButton {INPUT} at (287,0) size 17x16
+layer at (311,266) size 17x16
+ RenderButton {INPUT} at (303,0) size 17x16
layer at (8,282) size 320x240
- RenderBlock (positioned) {DIV} at (8,282) size 320x240
-layer at (51,429) size 234x69
- RenderBlock (positioned) {DIV} at (43,147) size 234x69 [bgcolor=#00000099] [border: (2px solid #EEEEEE)]
-layer at (135,436) size 66x40
- RenderButton {INPUT} at (84,7) size 66x40 [color=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 66x40
- RenderText at (23,0) size 19x38
- text run at (23,0) width 19: ">"
-layer at (58,475) size 220x16
- RenderBlock (positioned) {DIV} at (7,46) size 220x16 [bgcolor=#EEEEEE]
- RenderText {#text} at (165,0) size 50x15
- text run at (165,0) width 50: "00:00:00"
+ RenderBlock (relative positioned) {DIV} at (0,0) size 320x240
+layer at (8,506) size 320x18
+ RenderBlock (positioned) {DIV} at (0,224) size 320x16
+ RenderButton {INPUT} at (0,0) size 320x18
+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 (295,506) size 17x16
+ RenderButton {INPUT} at (287,0) size 17x16
+layer at (311,506) size 17x16
+ RenderButton {INPUT} at (303,0) size 17x16
layer at (8,522) size 320x240
RenderVideo {VIDEO} at (8,522) size 320x240
layer at (8,522) size 320x240
- RenderBlock (positioned) {DIV} at (0,0) size 320x240
-layer at (51,669) size 234x69
- RenderBlock (positioned) {DIV} at (43,147) size 234x69 [bgcolor=#00000099] [border: (2px solid #EEEEEE)]
-layer at (135,676) size 66x40
- RenderButton {INPUT} at (84,7) size 66x40 [color=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 66x40
- RenderText at (23,0) size 19x38
- text run at (23,0) width 19: ">"
-layer at (58,715) size 220x16
- RenderBlock (positioned) {DIV} at (7,46) size 220x16 [bgcolor=#EEEEEE]
- RenderText {#text} at (165,0) size 50x15
- text run at (165,0) width 50: "00:00:00"
-layer at (63,234) size 142x17
- RenderSlider zI: 1 {INPUT} at (12,45) size 142x16 [border: (2px solid #FFFFFF)]
-layer at (65,237) size 15x15
- RenderBlock (relative positioned) {DIV} at (2,2) size 15x15
-layer at (63,474) size 142x17
- RenderSlider zI: 1 {INPUT} at (12,45) size 142x16 [border: (2px solid #FFFFFF)]
-layer at (65,477) size 15x15
- RenderBlock (relative positioned) {DIV} at (2,2) size 15x15
-layer at (63,714) size 142x17
- RenderSlider zI: 1 {INPUT} at (12,45) size 142x16 [border: (2px solid #FFFFFF)]
-layer at (65,717) size 15x15
- RenderBlock (relative positioned) {DIV} at (2,2) size 15x15
+ RenderBlock (relative positioned) {DIV} at (0,0) size 320x240
+layer at (8,746) size 320x18 backgroundClip at (0,0) size 785x762 clip at (0,0) size 785x762 outlineClip at (0,0) size 785x762
+ RenderBlock (positioned) {DIV} at (0,224) size 320x16
+ RenderButton {INPUT} at (0,0) size 320x18
+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 (295,746) size 17x16
+ RenderButton {INPUT} at (287,0) size 17x16
+layer at (311,746) size 17x16
+ RenderButton {INPUT} at (303,0) size 17x16
-0789af559988bfaa1c506059f5ac52e3
\ No newline at end of file
+3a4a9d54dc06beb8c235c812b8309e75
\ No newline at end of file
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
layer at (8,26) size 320x240
- RenderBlock (positioned) {DIV} at (8,26) size 320x240
-layer at (51,173) size 234x69
- RenderBlock (positioned) {DIV} at (43,147) size 234x69 [bgcolor=#00000099] [border: (2px solid #EEEEEE)]
-layer at (135,180) size 66x40
- RenderButton {INPUT} at (84,7) size 66x40 [color=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 66x40
- RenderText at (23,0) size 19x38
- text run at (23,0) width 19: ">"
-layer at (58,219) size 220x16
- RenderBlock (positioned) {DIV} at (7,46) size 220x16 [bgcolor=#EEEEEE]
- RenderText {#text} at (165,0) size 50x15
- text run at (165,0) width 50: "00:00:00"
-layer at (63,218) size 142x17
- RenderSlider zI: 1 {INPUT} at (12,45) size 142x16 [border: (2px solid #FFFFFF)]
-layer at (65,221) size 15x15
- RenderBlock (relative positioned) {DIV} at (2,2) size 15x15
+ RenderBlock (relative positioned) {DIV} at (0,0) size 320x240
+layer at (8,250) size 320x18
+ RenderBlock (positioned) {DIV} at (0,224) size 320x16
+ RenderButton {INPUT} at (0,0) size 320x18
+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 (295,250) size 17x16
+ RenderButton {INPUT} at (287,0) size 17x16
+layer at (311,250) size 17x16
+ RenderButton {INPUT} at (303,0) size 17x16
+2008-01-07 Adele Peterson <adele@apple.com>
+
+ Reviewed by Antti, Adam, and Mitz.
+
+ WebCore part of fix for
+ <rdar://problem/5619073> Updated look for <video> controls
+ <rdar://problem/5619057> Add volume control to video controls
+
+ * WebCore.base.exp: Added symbols for WebKitSystemInterface drawing methods.
+ * WebCore.xcodeproj/project.pbxproj: Added MediaControlElements.h/cpp
+ * WebCore.vcproj/WebCore.vcproj: ditto.
+
+ * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added cases for new appearances.
+ * css/CSSSelector.cpp: (WebCore::CSSSelector::extractPseudoType): Added cases for new types.
+ * css/CSSSelector.h: (WebCore::CSSSelector::): Added new pseudo elements.
+ * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::checkOneSelector): ditto.
+ * css/CSSValueKeywords.in: Added keywords for new control appearance styles.
+ * css/html4.css: Added new styles for new controls.
+
+ * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::canPlay): Added. Takes loading state into account.
+ * html/HTMLMediaElement.h:
+
+ * page/EventHandler.cpp: (WebCore::EventHandler::updateMouseEventTargetNode): Make sure the events always go to the capturing node, if there is one.
+
+ * platform/mac/WebCoreSystemInterface.h: Added drawing methods for controls.
+ * platform/mac/WebCoreSystemInterface.mm: ditto.
+
+ * rendering/MediaControlElements.cpp: Added.
+ (WebCore::MediaControlShadowRootElement::MediaControlShadowRootElement): Moved from RenderMedia. Made this relatively positioned, instead of absolute.
+ (WebCore::MediaControlInputElement::MediaControlInputElement): Moved from RenderMedia. Removed call to updateFromElement,
+ since its too early to do this here, and causes crashes for the slider.
+ (WebCore::MediaControlInputElement::attachToParent): Moved from RenderMedia.
+ (WebCore::MediaControlInputElement::update): ditto.
+ (WebCore::MediaControlMuteButtonElement::MediaControlMuteButtonElement): Added.
+ (WebCore::MediaControlMuteButtonElement::defaultEventHandler): ditto.
+ (WebCore::MediaControlPlayButtonElement::MediaControlPlayButtonElement): Moved from RenderMedia.
+ (WebCore::MediaControlPlayButtonElement::defaultEventHandler): ditto.
+ (WebCore::MediaControlSeekButtonElement::MediaControlSeekButtonElement): Added.
+ (WebCore::MediaControlSeekButtonElement::defaultEventHandler): ditto.
+ (WebCore::MediaControlSeekButtonElement::seekTimerFired): ditto.
+ (WebCore::MediaControlTimelineElement::MediaControlTimelineElement): Moved from RenderMedia.
+ (WebCore::MediaControlTimelineElement::defaultEventHandler): ditto.
+ (WebCore::MediaControlTimelineElement::update): ditto.
+ (WebCore::MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement): Added.
+ (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler): ditto.
+ * rendering/MediaControlElements.h: Added. Moved from RenderMedia.
+ (WebCore::MediaControlShadowRootElement::isShadowNode):
+ (WebCore::MediaControlShadowRootElement::shadowParentNode):
+ (WebCore::RenderMediaControlShadowRoot::RenderMediaControlShadowRoot):
+ (WebCore::RenderMediaControlShadowRoot::setParent):
+
+ * rendering/RenderMedia.cpp: Moved control element classes to MediaControlElements files.
+ (WebCore::RenderMedia::RenderMedia): No need to initialize RefPtrs.
+ (WebCore::RenderMedia::layout): Set the position for the controlsRenderer.
+ (WebCore::RenderMedia::createPanel): Added nil check for the renderer.
+ (WebCore::RenderMedia::createMuteButton): Added.
+ (WebCore::RenderMedia::createSeekBackButton): ditto.
+ (WebCore::RenderMedia::createSeekForwardButton): ditto.
+ (WebCore::RenderMedia::createTimeDisplay): Added nil check for the renderer.
+ (WebCore::RenderMedia::createFullscreenButton): Added.
+ (WebCore::RenderMedia::updateControls): Create, delete, and update new controls when appropriate.
+ (WebCore::RenderMedia::updateControlVisibility): Don't fade controls for audio controls.
+ (WebCore::RenderMedia::forwardEvent): Forward events for new controls.
+ * rendering/RenderMedia.h: Added new methods for creating new controls.
+
+ * rendering/RenderObject.cpp: (WebCore::RenderObject::containingBlock): Updated special case for media elements, which are replaced elements,
+ but also can contain children (the controls' container) that may need to look for the containing block.
+
+ * rendering/RenderSlider.cpp: (WebCore::RenderSlider::createThumbStyle): Added case for MediaSliderAppearance.
+
+ * rendering/RenderStyle.h: Added appearance constants and pseudo ids for new controls.
+ (WebCore::):
+ (WebCore::RenderStyle::):
+
+ * rendering/RenderTheme.cpp:
+ (WebCore::RenderTheme::adjustStyle): Added cases for new appearances.
+ (WebCore::RenderTheme::paint): ditto.
+ * rendering/RenderTheme.h: Added new methods for painting new appearances.
+ (WebCore::RenderTheme::paintMediaBackground):
+ (WebCore::RenderTheme::paintMediaFullscreenButton):
+ (WebCore::RenderTheme::paintMediaPlayButton):
+ (WebCore::RenderTheme::paintMediaMuteButton):
+ (WebCore::RenderTheme::paintMediaSeekBackButton):
+ (WebCore::RenderTheme::paintMediaSeekForwardButton):
+ (WebCore::RenderTheme::paintMediaSliderThumb):
+ * rendering/RenderThemeMac.h:
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::RenderThemeMac): Initialize m_mediaControlBackgroundImage.
+ (WebCore::RenderThemeMac::~RenderThemeMac): Delete m_mediaControlBackgroundImage.
+ (WebCore::RenderThemeMac::paintCapsLockIndicator): Use LocalCurrentGraphicsContext here too, since we use it in all other painting methods.
+ (WebCore::RenderThemeMac::paintSliderTrack): Added case for MediaSliderAppearance.
+ (WebCore::RenderThemeMac::adjustSliderThumbSize): Added case for MediaSliderThumbAppearance.
+ (WebCore::RenderThemeMac::paintMediaBackground): Draws the new artwork for the controls.
+ (WebCore::RenderThemeMac::paintMediaFullscreenButton): ditto.
+ (WebCore::RenderThemeMac::paintMediaMuteButton): ditto.
+ (WebCore::RenderThemeMac::paintMediaPlayButton): ditto.
+ (WebCore::RenderThemeMac::paintMediaSeekBackButton): ditto.
+ (WebCore::RenderThemeMac::paintMediaSeekForwardButton): ditto.
+ (WebCore::RenderThemeMac::paintMediaSliderThumb): ditto.
+ * rendering/RenderThemeSafari.cpp: Draws the new artwork on Windows.
+ (WebCore::RenderThemeSafari::paintSliderTrack):
+ (WebCore::RenderThemeSafari::adjustSliderThumbSize):
+ (WebCore::RenderThemeSafari::paintMediaBackground):
+ (WebCore::RenderThemeSafari::paintMediaFullscreenButton):
+ (WebCore::RenderThemeSafari::paintMediaMuteButton):
+ (WebCore::RenderThemeSafari::paintMediaPlayButton):
+ (WebCore::RenderThemeSafari::paintMediaSeekBackButton):
+ (WebCore::RenderThemeSafari::paintMediaSeekForwardButton):
+ (WebCore::RenderThemeSafari::paintMediaSliderThumb):
+ * rendering/RenderThemeSafari.h:
+
2008-01-07 Timothy Hatcher <timothy@apple.com>
Reviewed by Darin Adler.
+
.objc_class_name_DOMAbstractView
.objc_class_name_DOMAttr
.objc_class_name_DOMCDATASection
_wkGetGlyphVectorNumGlyphs
_wkGetGlyphVectorRecordSize
_wkGetMIMETypeForExtension
+_wkGetMediaControlBackgroundImageData
+_wkDrawMediaFullscreenButton
+_wkDrawMediaMuteButton
+_wkDrawMediaPauseButton
+_wkDrawMediaPlayButton
+_wkDrawMediaSeekBackButton
+_wkDrawMediaSeekForwardButton
+_wkDrawMediaSliderThumb
+_wkDrawMediaUnMuteButton
_wkGetNSFontATSUFontId
_wkGetNSURLResponseCalculatedExpiration
_wkGetNSURLResponseLastModifiedDate
RelativePath="..\rendering\ListMarkerBox.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath="..\rendering\MediaControlElements.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\rendering\MediaControlElements.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\rendering\PointerEventsHitRules.cpp"\r
>\r
ABC128770B33AA6D00C693D5 /* PopupMenuClient.h in Headers */ = {isa = PBXBuildFile; fileRef = ABC128760B33AA6D00C693D5 /* PopupMenuClient.h */; };
ABDDFE790A5C6E7000A3E11D /* RenderMenuList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ABDDFE730A5C6E6F00A3E11D /* RenderMenuList.cpp */; };
ABDDFE7A0A5C6E7000A3E11D /* RenderMenuList.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDDFE740A5C6E7000A3E11D /* RenderMenuList.h */; };
+ ABFE7E120D32FAF60066F4D2 /* MediaControlElements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ABFE7E100D32FAF50066F4D2 /* MediaControlElements.cpp */; };
+ ABFE7E130D32FAF60066F4D2 /* MediaControlElements.h in Headers */ = {isa = PBXBuildFile; fileRef = ABFE7E110D32FAF50066F4D2 /* MediaControlElements.h */; };
B20111070AB7740500DB0E68 /* JSSVGAElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B20111050AB7740500DB0E68 /* JSSVGAElement.cpp */; };
B20111080AB7740500DB0E68 /* JSSVGAElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B20111060AB7740500DB0E68 /* JSSVGAElement.h */; };
B21127A60B3186770009BE53 /* JSSVGPODTypeWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = B21127A50B3186770009BE53 /* JSSVGPODTypeWrapper.h */; };
ABC128760B33AA6D00C693D5 /* PopupMenuClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PopupMenuClient.h; sourceTree = "<group>"; };
ABDDFE730A5C6E6F00A3E11D /* RenderMenuList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMenuList.cpp; sourceTree = "<group>"; };
ABDDFE740A5C6E7000A3E11D /* RenderMenuList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderMenuList.h; sourceTree = "<group>"; };
+ ABFE7E100D32FAF50066F4D2 /* MediaControlElements.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaControlElements.cpp; sourceTree = "<group>"; };
+ ABFE7E110D32FAF50066F4D2 /* MediaControlElements.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaControlElements.h; sourceTree = "<group>"; };
B20111050AB7740500DB0E68 /* JSSVGAElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGAElement.cpp; sourceTree = "<group>"; };
B20111060AB7740500DB0E68 /* JSSVGAElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGAElement.h; sourceTree = "<group>"; };
B21127A50B3186770009BE53 /* JSSVGPODTypeWrapper.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGPODTypeWrapper.h; sourceTree = "<group>"; };
935C476009AC4CD100A6AAB4 /* Length.h */,
A8EA7A4D0A191A5200A8EF5F /* ListMarkerBox.cpp */,
A8EA7A490A191A5200A8EF5F /* ListMarkerBox.h */,
+ ABFE7E100D32FAF50066F4D2 /* MediaControlElements.cpp */,
+ ABFE7E110D32FAF50066F4D2 /* MediaControlElements.h */,
B2B1F7140D00CAA8004AEA64 /* PointerEventsHitRules.cpp */,
B2B1F7150D00CAA8004AEA64 /* PointerEventsHitRules.h */,
BCEA481C097D93020094C9E4 /* RenderApplet.cpp */,
371F4FFC0D25E7F300ECE0D5 /* SegmentedFontData.h in Headers */,
371F51A10D262FA000ECE0D5 /* CSSSegmentedFontFace.h in Headers */,
371F53E90D2704F900ECE0D5 /* CSSUnicodeRangeValue.h in Headers */,
+ ABFE7E130D32FAF60066F4D2 /* MediaControlElements.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
371F4FFD0D25E7F300ECE0D5 /* SegmentedFontData.cpp in Sources */,
371F51A20D262FA000ECE0D5 /* CSSSegmentedFontFace.cpp in Sources */,
371F53EA0D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp in Sources */,
+ ABFE7E120D32FAF60066F4D2 /* MediaControlElements.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/*
* Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
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;
+ case MediaPlayButtonAppearance:
+ m_value.ident = CSS_VAL_MEDIA_PLAY_BUTTON;
+ break;
+ case MediaMuteButtonAppearance:
+ m_value.ident = CSS_VAL_MEDIA_MUTE_BUTTON;
+ break;
+ case MediaSeekBackButtonAppearance:
+ m_value.ident = CSS_VAL_MEDIA_SEEK_BACK_BUTTON;
+ break;
+ case MediaSeekForwardButtonAppearance:
+ m_value.ident = CSS_VAL_MEDIA_SEEK_FORWARD_BUTTON;
+ break;
+ case MediaSliderAppearance:
+ m_value.ident = CSS_VAL_MEDIA_SLIDER;
+ break;
+ case MediaSliderThumbAppearance:
+ m_value.ident = CSS_VAL_MEDIA_SLIDERTHUMB;
+ break;
case MenulistAppearance:
m_value.ident = CSS_VAL_MENULIST;
break;
* 1999 Waldo Bastian (bastian@kde.org)
* 2001 Andreas Schlapbach (schlpbch@iam.unibe.ch)
* 2001-2003 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2002, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2002, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
static AtomicString mediaControlsPlayButton("-webkit-media-controls-play-button");
static AtomicString mediaControlsTimeDisplay("-webkit-media-controls-time-display");
static AtomicString mediaControlsTimeline("-webkit-media-controls-timeline");
+ static AtomicString mediaControlsSeekBackButton("-webkit-media-controls-seek-back-button");
+ static AtomicString mediaControlsSeekForwardButton("-webkit-media-controls-seek-forward-button");
+ static AtomicString mediaControlsFullscreenButton("-webkit-media-controls-fullscreen-button");
static AtomicString notStr("not(");
static AtomicString root("root");
static AtomicString searchCancelButton("-webkit-search-cancel-button");
} else if (m_value == mediaControlsTimeline) {
m_pseudoType = PseudoMediaControlsTimeline;
element = true;
+ } else if (m_value == mediaControlsSeekBackButton) {
+ m_pseudoType = PseudoMediaControlsSeekBackButton;
+ element = true;
+ } else if (m_value == mediaControlsSeekForwardButton) {
+ m_pseudoType = PseudoMediaControlsSeekForwardButton;
+ element = true;
+ } else if (m_value == mediaControlsFullscreenButton) {
+ m_pseudoType = PseudoMediaControlsFullscreenButton;
+ element = true;
} else if (m_value == notStr)
m_pseudoType = PseudoNot;
else if (m_value == root)
*
* Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
* 1999 Waldo Bastian (bastian@kde.org)
- * Copyright (C) 2004, 2006 Apple Computer, Inc.
+ * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
PseudoMediaControlsMuteButton,
PseudoMediaControlsPlayButton,
PseudoMediaControlsTimeDisplay,
- PseudoMediaControlsTimeline
+ PseudoMediaControlsTimeline,
+ PseudoMediaControlsSeekBackButton,
+ PseudoMediaControlsSeekForwardButton,
+ PseudoMediaControlsFullscreenButton
};
PseudoType pseudoType() const
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
* (C) 2006 Nicholas Shanks (webkit@nickshanks.com)
- * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
*
* This library is free software; you can redistribute it and/or
case CSSSelector::PseudoMediaControlsTimeline:
dynamicPseudo = RenderStyle::MEDIA_CONTROLS_TIMELINE;
return true;
+ case CSSSelector::PseudoMediaControlsSeekBackButton:
+ dynamicPseudo = RenderStyle::MEDIA_CONTROLS_SEEK_BACK_BUTTON;
+ return true;
+ case CSSSelector::PseudoMediaControlsSeekForwardButton:
+ dynamicPseudo = RenderStyle::MEDIA_CONTROLS_SEEK_FORWARD_BUTTON;
+ return true;
+ case CSSSelector::PseudoMediaControlsFullscreenButton:
+ dynamicPseudo = RenderStyle::MEDIA_CONTROLS_FULLSCREEN_BUTTON;
+ return true;
case CSSSelector::PseudoUnknown:
case CSSSelector::PseudoNotParsed:
default:
button-bevel
listbox
listitem
+media-background
+media-fullscreen-button
+media-mute-button
+media-play-button
+media-seek-back-button
+media-seek-forward-button
+media-slider
+media-sliderthumb
menulist
menulist-button
menulist-text
* The default style sheet used to render HTML.
*
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
/* FIXME this is not the final styling */
audio {
- width: 234px;
- height: 69px;
+ width: 200px;
+ height: 16px;
}
audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel {
+ -webkit-appearance: media-background;
position: absolute;
- left: 0; right: 0; top: 0; bottom: 0;
- margin: auto;
- width: 230px;
- height: 65px;
- border: 2px solid #eee;
- background: rgba(0,0,0,0.6);
- -webkit-border-radius: 10px;
+ bottom: 0;
+ width: 100%;
+ height: 16px;
-webkit-user-select: none;
}
-video::-webkit-media-controls-panel {
- margin-bottom: 10%;
+audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button {
+ -webkit-appearance: media-mute-button;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 17px;
+ height: 16px;
}
audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-button {
- -webkit-appearance: none;
+ -webkit-appearance: media-play-button;
position: absolute;
- margin: 5px auto auto auto;
- left: 0; right: 0; top: 0; bottom: 0;
- border: 0;
- color: white;
- background: transparent;
- cursor: pointer;
- text-align: center;
- font-size: 25pt;
- width: 2em;
- height: 1.2em;
+ top: 0;
+ left: 16px;
+ width: 17px;
+ height: 16px;
+}
+
+audio::-webkit-media-controls-time-display, video::-webkit-media-controls-time-display {
+ display: none;
}
audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline {
- -webkit-appearance: slider-horizontal;
+ -webkit-appearance: media-slider;
position: absolute;
- margin: auto auto 5px 10px;
- left: 0; right: 0; top: 0; bottom: 1px;
- width: 60%;
- height: 12px;
- border: 2px solid white;
- -webkit-border-radius: 6px;
- z-index: 1;
+ top: 0;
+ left: 32px;
+ right: 32px;
+ height: 16px;
+ margin: 0px 5px;
}
-audio::-webkit-media-controls-time-display, video::-webkit-media-controls-time-display {
+audio::-webkit-media-controls-seek-back-button, video::-webkit-media-controls-seek-back-button {
+ -webkit-appearance: media-seek-back-button;
position: absolute;
- margin: auto 5px 5px 5px;
- left: 0; right: 0; top: 0; bottom: 0px;
- height: 1.2em;
- text-align: right;
- padding-right: 5px;
- -webkit-border-radius: 7px;
- background-color: #eee;
- color: black;
- font-size: 10pt;
+ top: 0;
+ right: 16px;
+ width: 17px;
+ height: 16px;
+}
+
+
+audio::-webkit-media-controls-seek-forward-button, video::-webkit-media-controls-seek-forward-button {
+ -webkit-appearance: media-seek-forward-button;
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 17px;
+ height: 16px;
+}
+
+audio::-webkit-media-controls-fullscreen-button, video::-webkit-media-controls-fullscreen-button {
+ display: none;
}
/* noscript is handled internally, as it depends on settings */
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
}
}
-bool HTMLMediaElement::ended()
+bool HTMLMediaElement::ended() const
{
return endedPlayback();
}
}
}
+bool HTMLMediaElement::canPlay() const
+{
+ return paused() || ended() || networkState() < LOADED_METADATA;
+}
+
String HTMLMediaElement::pickMedia()
{
// 3.14.9.2. Location of the media resource
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
void setPlaybackRate(float, ExceptionCode&);
PassRefPtr<TimeRanges> played() const;
PassRefPtr<TimeRanges> seekable() const;
- bool ended();
+ bool ended() const;
bool autoplay() const;
void setAutoplay(bool b);
void play(ExceptionCode&);
bool muted() const;
void setMuted(bool);
+ bool canPlay() const;
+
protected:
float getTimeOffsetAttribute(const QualifiedName&, float valueOnError) const;
void setTimeOffsetAttribute(const QualifiedName&, float value);
/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
*
* Redistribution and use in source and binary forms, with or without
// If we're capturing, we always go right to that node.
if (m_capturingMouseEventsNode)
result = m_capturingMouseEventsNode.get();
-
- // If the target node is a text node, dispatch on the parent node - rdar://4196646
- if (result && result->isTextNode())
- result = result->parentNode();
- if (result)
- result = result->shadowAncestorNode();
-
+ else {
+ // If the target node is a text node, dispatch on the parent node - rdar://4196646
+ if (result && result->isTextNode())
+ result = result->parentNode();
+ if (result)
+ result = result->shadowAncestorNode();
+ }
m_nodeUnderMouse = result;
// Fire mouseout/mouseover if the mouse has shifted to a different node.
/*
- * Copyright 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#endif
#ifdef __OBJC__
+@class NSData;
@class NSEvent;
@class NSFont;
@class NSMutableURLRequest;
@class QTMovieView;
#else
typedef struct NSArray NSArray;
+typedef struct NSData NSData;
typedef struct NSDate NSDate;
typedef struct NSEvent NSEvent;
typedef struct NSFont NSFont;
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 (*wkDrawMediaSliderThumb)(CGContextRef context, CGRect rect, BOOL active);
+extern void (*wkDrawMediaUnMuteButton)(CGContextRef context, CGRect rect, BOOL active);
extern NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*);
extern NSArray* (*wkGetExtensionsForMIMEType)(NSString*);
extern NSString* (*wkGetMIMETypeForExtension)(NSString*);
/*
- * Copyright 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright 2006, 2007, 2008 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
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 (*wkDrawMediaSliderThumb)(CGContextRef context, CGRect rect, BOOL active);
+void (*wkDrawMediaUnMuteButton)(CGContextRef context, CGRect rect, BOOL active);
NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*);
NSArray* (*wkGetExtensionsForMIMEType)(NSString*);
NSString* (*wkGetMIMETypeForExtension)(NSString*);
--- /dev/null
+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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"
+#include "MediaControlElements.h"
+
+#include "Event.h"
+#include "EventNames.h"
+#include "EventHandler.h"
+#include "FloatConversion.h"
+#include "Frame.h"
+#include "HTMLNames.h"
+
+namespace WebCore {
+
+using namespace EventNames;
+using namespace HTMLNames;
+
+// FIXME: These constants may need to be tweaked to better match the seeking in the QT plugin
+static const float cSeekRepeatDelay = 0.1f;
+static const float cStepTime = 0.07f;
+static const float cSeekTime = 0.2f;
+
+MediaControlShadowRootElement::MediaControlShadowRootElement(Document* doc, HTMLMediaElement* mediaElement)
+ : HTMLDivElement(doc)
+ , m_mediaElement(mediaElement)
+{
+ RenderStyle* rootStyle = new (mediaElement->renderer()->renderArena()) RenderStyle();
+ rootStyle->setDisplay(BLOCK);
+ rootStyle->setPosition(RelativePosition);
+ RenderMediaControlShadowRoot* renderer = new (mediaElement->renderer()->renderArena()) RenderMediaControlShadowRoot(this);
+ renderer->setParent(mediaElement->renderer());
+ renderer->setStyle(rootStyle);
+ setRenderer(renderer);
+ setAttached();
+ setInDocument(true);
+}
+
+// ----------------------------
+
+MediaControlInputElement::MediaControlInputElement(Document* doc, RenderStyle::PseudoId pseudo, String type, HTMLMediaElement* mediaElement)
+ : HTMLInputElement(doc)
+ , m_mediaElement(mediaElement)
+{
+ setInputType(type);
+ RenderStyle* style = m_mediaElement->renderer()->getPseudoStyle(pseudo);
+ RenderObject* renderer = createRenderer(m_mediaElement->renderer()->renderArena(), style);
+ if (renderer) {
+ setRenderer(renderer);
+ renderer->setStyle(style);
+ }
+ setAttached();
+ setInDocument(true);
+}
+
+void MediaControlInputElement::attachToParent(Element* parent)
+{
+ parent->addChild(this);
+ parent->renderer()->addChild(renderer());
+}
+
+void MediaControlInputElement::update()
+{
+ if (renderer())
+ renderer()->updateFromElement();
+}
+
+// ----------------------------
+
+MediaControlMuteButtonElement::MediaControlMuteButtonElement(Document* doc, HTMLMediaElement* element)
+ : MediaControlInputElement(doc, RenderStyle::MEDIA_CONTROLS_MUTE_BUTTON, "button", element)
+{
+}
+
+void MediaControlMuteButtonElement::defaultEventHandler(Event* event)
+{
+ if (event->type() == clickEvent) {
+ m_mediaElement->setMuted(!m_mediaElement->muted());
+ event->defaultHandled();
+ }
+ HTMLInputElement::defaultEventHandler(event);
+}
+
+// ----------------------------
+
+MediaControlPlayButtonElement::MediaControlPlayButtonElement(Document* doc, HTMLMediaElement* element)
+ : MediaControlInputElement(doc, RenderStyle::MEDIA_CONTROLS_PLAY_BUTTON, "button", element)
+{
+}
+
+void MediaControlPlayButtonElement::defaultEventHandler(Event* event)
+{
+ if (event->type() == clickEvent) {
+ ExceptionCode ec;
+ if (m_mediaElement->canPlay())
+ m_mediaElement->play(ec);
+ else
+ m_mediaElement->pause(ec);
+ event->defaultHandled();
+ }
+ HTMLInputElement::defaultEventHandler(event);
+}
+
+// ----------------------------
+
+MediaControlSeekButtonElement::MediaControlSeekButtonElement(Document* doc, HTMLMediaElement* element, bool forward)
+ : MediaControlInputElement(doc, forward ? RenderStyle::MEDIA_CONTROLS_SEEK_FORWARD_BUTTON : RenderStyle::MEDIA_CONTROLS_SEEK_BACK_BUTTON, "button", element)
+ , m_forward(forward)
+ , m_seeking(false)
+ , m_capturing(false)
+ , m_seekTimer(this, &MediaControlSeekButtonElement::seekTimerFired)
+{
+}
+
+void MediaControlSeekButtonElement::defaultEventHandler(Event* event)
+{
+ if (event->type() == mousedownEvent) {
+ if (Frame* frame = document()->frame()) {
+ m_capturing = true;
+ frame->eventHandler()->setCapturingMouseEventsNode(this);
+ }
+ m_seekTimer.startRepeating(cSeekRepeatDelay);
+ event->defaultHandled();
+ } else if (event->type() == mouseupEvent) {
+ if (m_capturing)
+ if (Frame* frame = document()->frame()) {
+ m_capturing = false;
+ frame->eventHandler()->setCapturingMouseEventsNode(0);
+ }
+ ExceptionCode ec;
+ if (m_seeking || m_seekTimer.isActive()) {
+ if (!m_seeking) {
+ float stepTime = m_forward ? cStepTime : -cStepTime;
+ m_mediaElement->setCurrentTime(m_mediaElement->currentTime() + stepTime, ec);
+ }
+ m_seekTimer.stop();
+ m_mediaElement->pause(ec);
+ m_seeking = false;
+ event->defaultHandled();
+ }
+ }
+ HTMLInputElement::defaultEventHandler(event);
+}
+
+void MediaControlSeekButtonElement::seekTimerFired(Timer<MediaControlSeekButtonElement>*)
+{
+ ExceptionCode ec;
+ m_seeking = true;
+ float seekTime = m_forward ? cSeekTime : -cSeekTime;
+ m_mediaElement->setCurrentTime(m_mediaElement->currentTime() + seekTime, ec);
+}
+
+// ----------------------------
+
+MediaControlTimelineElement::MediaControlTimelineElement(Document* doc, HTMLMediaElement* element)
+ : MediaControlInputElement(doc, RenderStyle::MEDIA_CONTROLS_TIMELINE, "range", element)
+{
+ setAttribute(precisionAttr, "float");
+}
+
+void MediaControlTimelineElement::defaultEventHandler(Event* event)
+{
+ float oldTime = narrowPrecisionToFloat(value().toDouble());
+ HTMLInputElement::defaultEventHandler(event);
+ float time = narrowPrecisionToFloat(value().toDouble());
+ if (oldTime != time || event->type() == inputEvent) {
+ ExceptionCode ec;
+ m_mediaElement->setCurrentTime(time, ec);
+ }
+}
+
+void MediaControlTimelineElement::update(bool updateDuration)
+{
+ if (updateDuration) {
+ float dur = m_mediaElement->duration();
+ setAttribute(maxAttr, String::number(isfinite(dur) ? dur : 0));
+ }
+ setValue(String::number(m_mediaElement->currentTime()));
+}
+
+// ----------------------------
+
+MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement(Document* doc, HTMLMediaElement* element)
+ : MediaControlInputElement(doc, RenderStyle::MEDIA_CONTROLS_FULLSCREEN_BUTTON, "button", element)
+{
+}
+
+void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event)
+{
+ if (event->type() == clickEvent) {
+ event->defaultHandled();
+ }
+ HTMLInputElement::defaultEventHandler(event);
+}
+
+// ----------------------------
+
+} //namespace WebCore
--- /dev/null
+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 MediaControlElements_h
+#define MediaControlElements_h
+
+#include "HTMLDivElement.h"
+#include "HTMLInputElement.h"
+#include "HTMLMediaElement.h"
+#include "RenderBlock.h"
+
+// These are the shadow elements used in RenderMedia
+
+namespace WebCore {
+
+class Event;
+class Frame;
+
+class MediaControlShadowRootElement : public HTMLDivElement {
+public:
+ MediaControlShadowRootElement(Document*, HTMLMediaElement*);
+
+ virtual bool isShadowNode() const { return true; }
+ virtual Node* shadowParentNode() { return m_mediaElement; }
+
+private:
+ HTMLMediaElement* m_mediaElement;
+};
+
+// ----------------------------
+
+class MediaControlInputElement : public HTMLInputElement {
+public:
+ MediaControlInputElement(Document*, RenderStyle::PseudoId, String type, HTMLMediaElement*);
+ void attachToParent(Element*);
+ void update();
+protected:
+ HTMLMediaElement* m_mediaElement;
+};
+
+// ----------------------------
+
+class MediaControlMuteButtonElement : public MediaControlInputElement {
+public:
+ MediaControlMuteButtonElement(Document*, HTMLMediaElement*);
+ virtual void defaultEventHandler(Event*);
+};
+
+// ----------------------------
+
+class MediaControlPlayButtonElement : public MediaControlInputElement {
+public:
+ MediaControlPlayButtonElement(Document*, HTMLMediaElement*);
+ virtual void defaultEventHandler(Event*);
+};
+
+// ----------------------------
+
+class MediaControlSeekButtonElement : public MediaControlInputElement {
+public:
+ MediaControlSeekButtonElement(Document*, HTMLMediaElement*, bool forward);
+ virtual void defaultEventHandler(Event*);
+ void seekTimerFired(Timer<MediaControlSeekButtonElement>*);
+
+private:
+ bool m_forward;
+ bool m_seeking;
+ bool m_capturing;
+ Timer<MediaControlSeekButtonElement> m_seekTimer;
+};
+
+// ----------------------------
+
+class MediaControlTimelineElement : public MediaControlInputElement {
+public:
+ MediaControlTimelineElement(Document*, HTMLMediaElement*);
+ virtual void defaultEventHandler(Event*);
+ void update(bool updateDuration = true);
+};
+
+// ----------------------------
+
+class MediaControlFullscreenButtonElement : public MediaControlInputElement {
+public:
+ MediaControlFullscreenButtonElement(Document*, HTMLMediaElement*);
+ virtual void defaultEventHandler(Event*);
+};
+
+// ----------------------------
+
+class RenderMediaControlShadowRoot : public RenderBlock {
+public:
+ RenderMediaControlShadowRoot(Element* e) : RenderBlock(e) { }
+ void setParent(RenderObject* p) { RenderObject::setParent(p); }
+};
+
+// ----------------------------
+
+} //namespace WebCore
+
+#endif // MediaControlElements_h
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#include "RenderMedia.h"
#include "CSSStyleSelector.h"
-#include "Document.h"
#include "Event.h"
#include "EventNames.h"
#include "FloatConversion.h"
#include "FrameView.h"
#include "GraphicsContext.h"
-#include "HTMLDivElement.h"
-#include "HTMLInputElement.h"
#include "HTMLMediaElement.h"
-#include "HTMLNames.h"
-#include <wtf/MathExtras.h>
+#include "MediaControlElements.h"
#include "MouseEvent.h"
#include "MediaPlayer.h"
#include "RenderSlider.h"
#include "SystemTime.h"
+#include <wtf/MathExtras.h>
using namespace std;
namespace WebCore {
using namespace EventNames;
-using namespace HTMLNames;
-
+
static const double cTimeUpdateRepeatDelay = 0.2;
static const double cOpacityAnimationRepeatDelay = 0.05;
// FIXME get this from style
static const double cOpacityAnimationDuration = 0.5;
-class RenderMediaControlShadowRoot : public RenderBlock {
-public:
- RenderMediaControlShadowRoot(Element* e) : RenderBlock(e) { }
- void setParent(RenderObject* p) { RenderObject::setParent(p); }
-};
-
-class MediaControlShadowRootElement : public HTMLDivElement {
-public:
- MediaControlShadowRootElement(Document* doc, HTMLMediaElement* mediaElement);
-
- virtual bool isShadowNode() const { return true; }
- virtual Node* shadowParentNode() { return m_mediaElement; }
-
-private:
- HTMLMediaElement* m_mediaElement;
-};
-
-MediaControlShadowRootElement::MediaControlShadowRootElement(Document* doc, HTMLMediaElement* mediaElement)
- : HTMLDivElement(doc)
- , m_mediaElement(mediaElement)
-{
- RenderStyle* rootStyle = new (mediaElement->renderer()->renderArena()) RenderStyle();
- rootStyle->setDisplay(BLOCK);
- rootStyle->setPosition(AbsolutePosition);
- RenderMediaControlShadowRoot* renderer = new (mediaElement->renderer()->renderArena()) RenderMediaControlShadowRoot(this);
- renderer->setParent(mediaElement->renderer());
- renderer->setStyle(rootStyle);
- setRenderer(renderer);
- setAttached();
- setInDocument(true);
-}
-
-// ----------------------------
-
-class MediaControlInputElement : public HTMLInputElement {
-public:
- MediaControlInputElement(Document*, RenderStyle::PseudoId, String type, HTMLMediaElement*);
- void attachToParent(PassRefPtr<Element>);
-protected:
- HTMLMediaElement* m_mediaElement;
-};
-
-MediaControlInputElement::MediaControlInputElement(Document* doc, RenderStyle::PseudoId pseudo, String type, HTMLMediaElement* mediaElement)
-: HTMLInputElement(doc)
-, m_mediaElement(mediaElement)
-{
- setInputType(type);
- RenderStyle* style = m_mediaElement->renderer()->getPseudoStyle(pseudo);
- RenderObject* renderer = createRenderer(m_mediaElement->renderer()->renderArena(), style);
- setRenderer(renderer);
- renderer->setStyle(style);
- renderer->updateFromElement();
- setAttached();
- setInDocument(true);
-}
-
-void MediaControlInputElement::attachToParent(PassRefPtr<Element> parent)
-{
- parent->addChild(this);
- parent->renderer()->addChild(renderer());
-}
-
-// ----------------------------
-
-class MediaControlPlayButtonElement : public MediaControlInputElement {
-public:
- MediaControlPlayButtonElement(Document* doc, HTMLMediaElement* element)
- : MediaControlInputElement(doc, RenderStyle::MEDIA_CONTROLS_PLAY_BUTTON, "button", element) { }
- bool inPausedState() const;
- virtual void defaultEventHandler(Event*);
- void update();
-};
-
-bool MediaControlPlayButtonElement::inPausedState() const
-{
- return m_mediaElement->paused() || m_mediaElement->ended() || m_mediaElement->networkState() < HTMLMediaElement::LOADED_METADATA;
-}
-
-void MediaControlPlayButtonElement::defaultEventHandler(Event* event)
-{
- if (event->type() == clickEvent) {
- ExceptionCode ec;
- if (inPausedState())
- m_mediaElement->play(ec);
- else
- m_mediaElement->pause(ec);
- event->defaultHandled();
- }
- HTMLInputElement::defaultEventHandler(event);
-}
-
-void MediaControlPlayButtonElement::update()
-{
- // FIXME: These are here just for temporary look,
- // switch to using bitmaps
- setValue(inPausedState() ? ">" : "||");
- renderer()->updateFromElement();
-}
-
-// ----------------------------
-
-class MediaControlTimelineElement : public MediaControlInputElement {
-public:
- MediaControlTimelineElement(Document* doc, HTMLMediaElement* element)
- : MediaControlInputElement(doc, RenderStyle::MEDIA_CONTROLS_TIMELINE, "range", element) {
- setAttribute(precisionAttr, "float");
- }
- virtual void defaultEventHandler(Event*);
- void update(bool updateDuration = true);
-};
-
-void MediaControlTimelineElement::defaultEventHandler(Event* event)
-{
- float oldTime = (float)value().toDouble();
- HTMLInputElement::defaultEventHandler(event);
- float time = (float)value().toDouble();
- if (oldTime != time) {
- ExceptionCode ec;
- m_mediaElement->setCurrentTime(time, ec);
- }
-}
-
-void MediaControlTimelineElement::update(bool updateDuration)
-{
- if (updateDuration) {
- float dur = m_mediaElement->duration();
- setAttribute(maxAttr, String::number(isfinite(dur) ? dur : 0));
- }
- setValue(String::number(m_mediaElement->currentTime()));
-}
-
-// ----------------------------
-
RenderMedia::RenderMedia(HTMLMediaElement* video)
: RenderReplaced(video)
- , m_controlsShadowRoot(0)
- , m_panel(0)
- , m_playButton(0)
- , m_timeline(0)
- , m_timeDisplay(0)
, m_timeUpdateTimer(this, &RenderMedia::timeUpdateTimerFired)
, m_opacityAnimationTimer(this, &RenderMedia::opacityAnimationTimerFired)
, m_mouseOver(false)
RenderMedia::RenderMedia(HTMLMediaElement* video, const IntSize& intrinsicSize)
: RenderReplaced(video, intrinsicSize)
- , m_controlsShadowRoot(0)
- , m_panel(0)
- , m_playButton(0)
- , m_timeline(0)
- , m_timeDisplay(0)
, m_timeUpdateTimer(this, &RenderMedia::timeUpdateTimerFired)
, m_opacityAnimationTimer(this, &RenderMedia::opacityAnimationTimerFired)
, m_mouseOver(false)
return;
IntSize newSize = contentBox().size();
if (newSize != oldSize || controlsRenderer->needsLayout()) {
+ controlsRenderer->setPos(borderLeft() + paddingLeft(), borderTop() + paddingTop());
controlsRenderer->style()->setHeight(Length(newSize.height(), Fixed));
controlsRenderer->style()->setWidth(Length(newSize.width(), Fixed));
controlsRenderer->setNeedsLayout(true, false);
RenderStyle* style = getPseudoStyle(RenderStyle::MEDIA_CONTROLS_PANEL);
m_panel = new HTMLDivElement(document());
RenderObject* renderer = m_panel->createRenderer(renderArena(), style);
- m_panel->setRenderer(renderer);
- renderer->setStyle(style);
- m_panel->setAttached();
- m_panel->setInDocument(true);
- m_controlsShadowRoot->addChild(m_panel);
- m_controlsShadowRoot->renderer()->addChild(renderer);
+ if (renderer) {
+ m_panel->setRenderer(renderer);
+ renderer->setStyle(style);
+ m_panel->setAttached();
+ m_panel->setInDocument(true);
+ m_controlsShadowRoot->addChild(m_panel);
+ m_controlsShadowRoot->renderer()->addChild(renderer);
+ }
+}
+
+void RenderMedia::createMuteButton()
+{
+ ASSERT(!m_muteButton);
+ m_muteButton = new MediaControlMuteButtonElement(document(), mediaElement());
+ m_muteButton->attachToParent(m_panel.get());
}
void RenderMedia::createPlayButton()
{
ASSERT(!m_playButton);
m_playButton = new MediaControlPlayButtonElement(document(), mediaElement());
- m_playButton->attachToParent(m_panel);
+ m_playButton->attachToParent(m_panel.get());
+}
+
+void RenderMedia::createSeekBackButton()
+{
+ ASSERT(!m_seekBackButton);
+ m_seekBackButton = new MediaControlSeekButtonElement(document(), mediaElement(), false);
+ m_seekBackButton->attachToParent(m_panel.get());
+}
+
+void RenderMedia::createSeekForwardButton()
+{
+ ASSERT(!m_seekForwardButton);
+ m_seekForwardButton = new MediaControlSeekButtonElement(document(), mediaElement(), true);
+ m_seekForwardButton->attachToParent(m_panel.get());
}
void RenderMedia::createTimeline()
{
ASSERT(!m_timeline);
m_timeline = new MediaControlTimelineElement(document(), mediaElement());
- m_timeline->attachToParent(m_panel);
+ m_timeline->attachToParent(m_panel.get());
}
void RenderMedia::createTimeDisplay()
RenderStyle* style = getPseudoStyle(RenderStyle::MEDIA_CONTROLS_TIME_DISPLAY);
m_timeDisplay = new HTMLDivElement(document());
RenderObject* renderer = m_timeDisplay->createRenderer(renderArena(), style);
- m_timeDisplay->setRenderer(renderer);
- renderer->setStyle(style);
- m_timeDisplay->setAttached();
- m_timeDisplay->setInDocument(true);
- m_panel->addChild(m_timeDisplay);
- m_panel->renderer()->addChild(renderer);
+ if (renderer) {
+ m_timeDisplay->setRenderer(renderer);
+ renderer->setStyle(style);
+ m_timeDisplay->setAttached();
+ m_timeDisplay->setInDocument(true);
+ m_panel->addChild(m_timeDisplay);
+ m_panel->renderer()->addChild(renderer);
+ }
+}
+
+void RenderMedia::createFullscreenButton()
+{
+ ASSERT(!m_fullscreenButton);
+ m_fullscreenButton = new MediaControlFullscreenButtonElement(document(), mediaElement());
+ m_fullscreenButton->attachToParent(m_panel.get());
}
void RenderMedia::updateFromElement()
if (m_controlsShadowRoot) {
m_controlsShadowRoot->detach();
m_panel = 0;
+ m_muteButton = 0;
m_playButton = 0;
m_timeline = 0;
+ m_seekBackButton = 0;
+ m_seekForwardButton = 0;
m_timeDisplay = 0;
+ m_fullscreenButton = 0;
m_controlsShadowRoot = 0;
}
return;
if (!m_controlsShadowRoot) {
createControlsShadowRoot();
createPanel();
+ createMuteButton();
createPlayButton();
createTimeline();
+ createSeekBackButton();
+ createSeekForwardButton();
createTimeDisplay();
+ createFullscreenButton();
}
if (media->paused() || media->ended() || media->networkState() < HTMLMediaElement::LOADED_METADATA)
else
m_timeUpdateTimer.startRepeating(cTimeUpdateRepeatDelay);
+ if (m_muteButton)
+ m_muteButton->update();
if (m_playButton)
m_playButton->update();
if (m_timeline)
m_timeline->update();
+ if (m_seekBackButton)
+ m_seekBackButton->update();
+ if (m_seekForwardButton)
+ m_seekForwardButton->update();
+ if (m_fullscreenButton)
+ m_fullscreenButton->update();
updateTimeDisplay();
updateControlVisibility();
}
void RenderMedia::updateControlVisibility()
{
- if (!m_panel)
+ if (!m_panel || !m_panel->renderer())
return;
// do fading manually, css animations don't work well with shadow trees
HTMLMediaElement* media = mediaElement();
+ // Don't fade for audio controls.
+ if (!media->isVideo())
+ return;
bool visible = m_mouseOver || media->paused() || media->ended() || media->networkState() < HTMLMediaElement::LOADED_METADATA;
if (visible == (m_opacityAnimationTo > 0))
return;
if (event->isMouseEvent() && m_controlsShadowRoot) {
MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
IntPoint point(mouseEvent->pageX(), mouseEvent->pageY());
- if (m_playButton && m_playButton->renderer()->absoluteBoundingBoxRect().contains(point))
+ if (m_muteButton && m_muteButton->renderer() && m_muteButton->renderer()->absoluteBoundingBoxRect().contains(point))
+ m_muteButton->defaultEventHandler(event);
+ if (m_playButton && m_playButton->renderer() && m_playButton->renderer()->absoluteBoundingBoxRect().contains(point))
m_playButton->defaultEventHandler(event);
- if (m_timeline && m_timeline->renderer()->absoluteBoundingBoxRect().contains(point))
+ if (m_seekBackButton && m_seekBackButton->renderer() && m_seekBackButton->renderer()->absoluteBoundingBoxRect().contains(point))
+ m_seekBackButton->defaultEventHandler(event);
+ if (m_seekForwardButton && m_seekForwardButton->renderer() && m_seekForwardButton->renderer()->absoluteBoundingBoxRect().contains(point))
+ m_seekForwardButton->defaultEventHandler(event);
+ if (m_timeline && m_timeline->renderer() && m_timeline->renderer()->absoluteBoundingBoxRect().contains(point))
m_timeline->defaultEventHandler(event);
+ if (m_fullscreenButton && m_fullscreenButton->renderer() && m_fullscreenButton->renderer()->absoluteBoundingBoxRect().contains(point))
+ m_fullscreenButton->defaultEventHandler(event);
if (event->type() == mouseoverEvent) {
m_mouseOver = true;
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
class HTMLInputElement;
class HTMLMediaElement;
+class MediaControlMuteButtonElement;
class MediaControlPlayButtonElement;
+class MediaControlSeekButtonElement;
class MediaControlTimelineElement;
+class MediaControlFullscreenButtonElement;
class MediaPlayer;
class RenderMedia : public RenderReplaced {
private:
void createControlsShadowRoot();
void createPanel();
+ void createMuteButton();
void createPlayButton();
+ void createSeekBackButton();
+ void createSeekForwardButton();
void createTimeline();
void createTimeDisplay();
+ void createFullscreenButton();
void timeUpdateTimerFired(Timer<RenderMedia>*);
void updateTimeDisplay();
RefPtr<HTMLElement> m_controlsShadowRoot;
RefPtr<HTMLElement> m_panel;
+ RefPtr<MediaControlMuteButtonElement> m_muteButton;
RefPtr<MediaControlPlayButtonElement> m_playButton;
+ RefPtr<MediaControlSeekButtonElement> m_seekBackButton;
+ RefPtr<MediaControlSeekButtonElement> m_seekForwardButton;
RefPtr<MediaControlTimelineElement> m_timeline;
+ RefPtr<MediaControlFullscreenButtonElement> m_fullscreenButton;
RefPtr<HTMLElement> m_timeDisplay;
+ EventTargetNode* m_lastUnderNode;
+ EventTargetNode* m_nodeUnderMouse;
Timer<RenderMedia> m_timeUpdateTimer;
Timer<RenderMedia> m_opacityAnimationTimer;
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
* (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
- * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
}
} else {
while (o && ((o->isInline() && !o->isReplaced()) || o->isTableRow() || o->isTableSection()
- || o->isTableCol() || o->isFrameSet()
+ || o->isTableCol() || o->isFrameSet() || o->isMedia()
#if ENABLE(SVG)
|| o->isSVGContainer() || o->isSVGRoot()
#endif
/**
*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
style->setAppearance(SliderThumbVerticalAppearance);
else if (parentStyle->appearance() == SliderHorizontalAppearance)
style->setAppearance(SliderThumbHorizontalAppearance);
+ else if (parentStyle->appearance() == MediaSliderAppearance)
+ style->setAppearance(MediaSliderThumbAppearance);
return style;
}
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* (C) 2000 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2005, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
*
* This library is free software; you can redistribute it and/or
enum EAppearance {
NoAppearance, CheckboxAppearance, RadioAppearance, PushButtonAppearance, SquareButtonAppearance, ButtonAppearance,
- ButtonBevelAppearance, ListboxAppearance, ListItemAppearance, MenulistAppearance,
- MenulistButtonAppearance, MenulistTextAppearance, MenulistTextFieldAppearance,
+ ButtonBevelAppearance, ListboxAppearance, ListItemAppearance,
+ MediaBackgroundAppearance, MediaFullscreenButtonAppearance, MediaMuteButtonAppearance, MediaPlayButtonAppearance,
+ MediaSeekBackButtonAppearance, MediaSeekForwardButtonAppearance, MediaSliderAppearance, MediaSliderThumbAppearance,
+ MenulistAppearance, MenulistButtonAppearance, MenulistTextAppearance, MenulistTextFieldAppearance,
ScrollbarButtonUpAppearance, ScrollbarButtonDownAppearance,
ScrollbarButtonLeftAppearance, ScrollbarButtonRightAppearance,
ScrollbarTrackHorizontalAppearance, ScrollbarTrackVerticalAppearance,
// static pseudo styles. Dynamic ones are produced on the fly.
enum PseudoId { NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, SELECTION, FIRST_LINE_INHERITED, FILE_UPLOAD_BUTTON, SLIDER_THUMB,
SEARCH_CANCEL_BUTTON, SEARCH_DECORATION, SEARCH_RESULTS_DECORATION, SEARCH_RESULTS_BUTTON, MEDIA_CONTROLS_PANEL,
- MEDIA_CONTROLS_PLAY_BUTTON, MEDIA_CONTROLS_MUTE_BUTTON, MEDIA_CONTROLS_TIMELINE, MEDIA_CONTROLS_TIME_DISPLAY };
+ MEDIA_CONTROLS_PLAY_BUTTON, MEDIA_CONTROLS_MUTE_BUTTON, MEDIA_CONTROLS_TIMELINE, MEDIA_CONTROLS_TIME_DISPLAY,
+ MEDIA_CONTROLS_SEEK_BACK_BUTTON, MEDIA_CONTROLS_SEEK_FORWARD_BUTTON , MEDIA_CONTROLS_FULLSCREEN_BUTTON };
static const int FIRST_INTERNAL_PSEUDOID = FILE_UPLOAD_BUTTON;
void ref() { m_ref++; }
/**
* This file is part of the theme implementation for form controls in WebCore.
*
- * Copyright (C) 2005 Apple Computer, Inc.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
return adjustMenuListStyle(selector, style, e);
case MenulistButtonAppearance:
return adjustMenuListButtonStyle(selector, style, e);
+ case MediaSliderAppearance:
case SliderHorizontalAppearance:
case SliderVerticalAppearance:
return adjustSliderTrackStyle(selector, style, e);
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 paintMediaPlayButton(o, paintInfo, r);
+ case MediaMuteButtonAppearance:
+ return paintMediaMuteButton(o, paintInfo, r);
+ case MediaSeekBackButtonAppearance:
+ return paintMediaSeekBackButton(o, paintInfo, r);
+ case MediaSeekForwardButtonAppearance:
+ return paintMediaSeekForwardButton(o, paintInfo, r);
+ case MediaSliderThumbAppearance:
+ if (o->parent()->isSlider())
+ return paintMediaSliderThumb(o, paintInfo, r);
+ break;
case MenulistButtonAppearance:
case TextFieldAppearance:
case TextAreaAppearance:
/*
* This file is part of the theme implementation for form controls in WebCore.
*
- * Copyright (C) 2005 Apple Computer, Inc.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
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 paintMediaSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
+
private:
mutable Color m_activeSelectionColor;
mutable Color m_inactiveSelectionColor;
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 paintMediaSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+
private:
IntRect inflateRect(const IntRect&, const IntSize&, const int* margins) const;
mutable RetainPtr<NSSliderCell> m_sliderThumbHorizontal;
mutable RetainPtr<NSSliderCell> m_sliderThumbVertical;
mutable Image* m_resizeCornerImage;
+ mutable Image* m_mediaControlBackgroundImage;
bool m_isSliderThumbHorizontalPressed;
bool m_isSliderThumbVerticalPressed;
/*
- * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
#import "config.h"
#import "RenderThemeMac.h"
+#import "BitmapImage.h"
#import "CSSStyleSelector.h"
#import "CSSValueKeywords.h"
#import "Document.h"
#import "FrameView.h"
#import "GraphicsContext.h"
#import "HTMLInputElement.h"
+#import "HTMLMediaElement.h"
+#import "HTMLNames.h"
#import "Image.h"
#import "LocalCurrentGraphicsContext.h"
#import "RenderSlider.h"
#import "RenderView.h"
+#import "SharedBuffer.h"
#import "WebCoreSystemInterface.h"
#import <Cocoa/Cocoa.h>
#import <wtf/RetainPtr.h>
namespace WebCore {
+using namespace HTMLNames;
+
enum {
topMargin,
rightMargin,
RenderThemeMac::RenderThemeMac()
: m_resizeCornerImage(0)
+ , m_mediaControlBackgroundImage(0)
, m_isSliderThumbHorizontalPressed(false)
, m_isSliderThumbVerticalPressed(false)
, m_notificationObserver(AdoptNS, [[WebCoreRenderThemeNotificationObserver alloc] initWithTheme:this])
{
[[NSNotificationCenter defaultCenter] removeObserver:m_notificationObserver.get()];
delete m_resizeCornerImage;
+ delete m_mediaControlBackgroundImage;
}
Color RenderThemeMac::platformActiveSelectionBackgroundColor() const
if (paintInfo.context->paintingDisabled())
return true;
+ LocalCurrentGraphicsContext localContext(paintInfo.context);
wkDrawCapsLockIndicator(paintInfo.context->platformContext(), r);
return false;
{
IntRect bounds = r;
- if (o->style()->appearance() == SliderHorizontalAppearance) {
+ if (o->style()->appearance() == SliderHorizontalAppearance || o->style()->appearance() == MediaSliderAppearance) {
bounds.setHeight(trackWidth);
bounds.setY(r.y() + r.height() / 2 - trackWidth / 2);
} else if (o->style()->appearance() == SliderVerticalAppearance) {
void RenderThemeMac::adjustSliderThumbSize(RenderObject* o) const
{
- if (o->style()->appearance() == SliderThumbHorizontalAppearance || o->style()->appearance() == SliderThumbVerticalAppearance) {
+ if (o->style()->appearance() == SliderThumbHorizontalAppearance ||
+ o->style()->appearance() == SliderThumbVerticalAppearance ||
+ o->style()->appearance() == MediaSliderThumbAppearance) {
o->style()->setWidth(Length(sliderThumbWidth, Fixed));
o->style()->setHeight(Length(sliderThumbHeight, 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();
+ if (!node)
+ return false;
+
+ LocalCurrentGraphicsContext localContext(paintInfo.context);
+ wkDrawMediaFullscreenButton(paintInfo.context->platformContext(), r, node->active());
+ return false;
+}
+
+bool RenderThemeMac::paintMediaMuteButton(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;
+
+ LocalCurrentGraphicsContext localContext(paintInfo.context);
+ if (mediaElement->muted())
+ wkDrawMediaUnMuteButton(paintInfo.context->platformContext(), r, node->active());
+ else
+ wkDrawMediaMuteButton(paintInfo.context->platformContext(), r, node->active());
+ return false;
+}
+
+bool RenderThemeMac::paintMediaPlayButton(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;
+
+ LocalCurrentGraphicsContext localContext(paintInfo.context);
+ if (mediaElement->canPlay())
+ wkDrawMediaPlayButton(paintInfo.context->platformContext(), r, node->active());
+ else
+ wkDrawMediaPauseButton(paintInfo.context->platformContext(), r, node->active());
+ return false;
+}
+
+bool RenderThemeMac::paintMediaSeekBackButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+ Node* node = o->element();
+ if (!node)
+ return false;
+
+ LocalCurrentGraphicsContext localContext(paintInfo.context);
+ wkDrawMediaSeekBackButton(paintInfo.context->platformContext(), r, node->active());
+ return false;
+}
+
+bool RenderThemeMac::paintMediaSeekForwardButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+ Node* node = o->element();
+ if (!node)
+ return false;
+
+ LocalCurrentGraphicsContext localContext(paintInfo.context);
+ wkDrawMediaSeekForwardButton(paintInfo.context->platformContext(), r, node->active());
+ return false;
+}
+
+bool RenderThemeMac::paintMediaSliderThumb(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+ Node* node = o->element();
+ if (!node)
+ return false;
+
+ LocalCurrentGraphicsContext localContext(paintInfo.context);
+ wkDrawMediaSliderThumb(paintInfo.context->platformContext(), r, node->active());
+ return false;
+}
+
NSButtonCell* RenderThemeMac::checkbox() const
{
if (!m_checkbox) {
/*
- * Copyright (C) 2007 Apple Inc.
+ * Copyright (C) 2007, 2008 Apple Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
#include "FrameView.h"
#include "GraphicsContext.h"
#include "HTMLInputElement.h"
+#include "HTMLMediaElement.h"
#include "RenderSlider.h"
#include "RenderView.h"
#include "RetainPtr.h"
{
IntRect bounds = r;
- if (o->style()->appearance() == SliderHorizontalAppearance) {
+ if (o->style()->appearance() == SliderHorizontalAppearance ||
+ o->style()->appearance() == MediaSliderAppearance) {
bounds.setHeight(trackWidth);
bounds.setY(r.y() + r.height() / 2 - trackWidth / 2);
} else if (o->style()->appearance() == SliderVerticalAppearance) {
void RenderThemeSafari::adjustSliderThumbSize(RenderObject* o) const
{
- if (o->style()->appearance() == SliderThumbHorizontalAppearance || o->style()->appearance() == SliderThumbVerticalAppearance) {
+ if (o->style()->appearance() == SliderThumbHorizontalAppearance ||
+ o->style()->appearance() == SliderThumbVerticalAppearance ||
+ o->style()->appearance() == MediaSliderThumbAppearance) {
o->style()->setWidth(Length(sliderThumbWidth, Fixed));
o->style()->setHeight(Length(sliderThumbHeight, Fixed));
}
paintThemePart(SearchFieldResultsButtonPart, paintInfo.context->platformContext(), searchRect, controlSizeFromRect(searchRect, searchFieldSizes()), determineState(o));
return false;
}
+#if ENABLE(VIDEO)
+bool RenderThemeSafari::paintMediaBackground(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+ ASSERT(SafariThemeLibrary());
+
+ paintThemePart(MediaBackgroundPart, paintInfo.context->platformContext(), r, NSRegularControlSize, 0);
+
+ return false;
+
+}
+
+bool RenderThemeSafari::paintMediaFullscreenButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+ ASSERT(SafariThemeLibrary());
+
+ paintThemePart(MediaFullscreenButtonPart, paintInfo.context->platformContext(), r, NSRegularControlSize, determineState(o));
+
+ return false;
+}
+
+bool RenderThemeSafari::paintMediaMuteButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+ ASSERT(SafariThemeLibrary());
+
+ Node* node = o->element();
+ HTMLMediaElement* mediaElement = node ? static_cast<HTMLMediaElement*>(node->shadowAncestorNode()) : 0;
+
+ if (!node || !mediaElement)
+ return false;
+
+ paintThemePart(mediaElement->muted() ? MediaUnMuteButtonPart : MediaMuteButtonPart, paintInfo.context->platformContext(), r, NSRegularControlSize, determineState(o));
+
+ return false;
+}
+
+bool RenderThemeSafari::paintMediaPlayButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+ ASSERT(SafariThemeLibrary());
+
+ Node* node = o->element();
+ HTMLMediaElement* mediaElement = node ? static_cast<HTMLMediaElement*>(node->shadowAncestorNode()) : 0;
+ if (!node || !mediaElement)
+ return false;
+
+ paintThemePart(mediaElement->canPlay() ? MediaPlayButtonPart : MediaPauseButtonPart, paintInfo.context->platformContext(), r, NSRegularControlSize, determineState(o));
+
+ return false;
+}
+
+bool RenderThemeSafari::paintMediaSeekBackButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+ ASSERT(SafariThemeLibrary());
+
+ paintThemePart(MediaSeekBackButtonPart, paintInfo.context->platformContext(), r, NSRegularControlSize, determineState(o));
+
+ return false;
+}
+
+bool RenderThemeSafari::paintMediaSeekForwardButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+ ASSERT(SafariThemeLibrary());
+
+ paintThemePart(MediaSeekForwardButtonPart, paintInfo.context->platformContext(), r, NSRegularControlSize, determineState(o));
+
+ return false;
+}
+
+bool RenderThemeSafari::paintMediaSliderThumb(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+ ASSERT(SafariThemeLibrary());
+
+ paintThemePart(MediaSliderThumbPart, paintInfo.context->platformContext(), r, NSRegularControlSize, determineState(o));
+
+ return false;
+}
+#endif
} // namespace WebCore
#endif // defined(USE_SAFARI_THEME)
/*
- * Copyright (C) 2007 Apple Inc.
+ * Copyright (C) 2007, 2008 Apple Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
virtual bool paintSearchFieldResultsButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
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 paintMediaSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+#endif
+
private:
IntRect inflateRect(const IntRect&, const IntSize&, const int* margins) const;
+2008-01-07 Adele Peterson <adele@apple.com>
+
+ Reviewed by Antti, Adam, and Mitz.
+
+ WebKit part of fix for
+ <rdar://problem/5619073> Updated look for <video> controls
+ <rdar://problem/5619057> Add volume control to video controls
+
+ * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface):
+
2008-01-07 Dan Bernstein <mitz@apple.com>
Reviewed by Dave Hyatt.
/*
- * Copyright 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
INIT(DrawBezeledTextArea);
INIT(DrawBezeledTextFieldCell);
INIT(DrawFocusRing);
+ INIT(DrawMediaFullscreenButton);
+ INIT(DrawMediaMuteButton);
+ INIT(DrawMediaPauseButton);
+ INIT(DrawMediaPlayButton);
+ INIT(DrawMediaSeekBackButton);
+ INIT(DrawMediaSeekForwardButton);
+ INIT(DrawMediaSliderThumb);
+ INIT(DrawMediaUnMuteButton);
INIT(DrawTextFieldCellFocusRing);
INIT(FontSmoothingModeIsLCD);
INIT(GetATSStyleGroup);
INIT(GetGlyphVectorFirstRecord);
INIT(GetGlyphVectorNumGlyphs);
INIT(GetGlyphVectorRecordSize);
+ INIT(GetMediaControlBackgroundImageData);
INIT(GetMIMETypeForExtension);
INIT(GetNSFontATSUFontId);
INIT(GetNSURLResponseCalculatedExpiration);
+2008-01-07 Adele Peterson <adele@apple.com>
+
+ Reviewed by Antti, Adam, and Mitz.
+
+ WebKitLibraries part of fix for
+ <rdar://problem/5619073> Updated look for <video> controls
+ <rdar://problem/5619057> Add volume control to video controls
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLeopard.a:
+ * libWebKitSystemInterfaceTiger.a:
+
2008-01-03 Mark Rowe <mrowe@apple.com>
Update Tiger library to a G3-friendly version.
/*
WebKitSystemInterface.h
- Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
+ Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
Public header file.
*/
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 WKDrawMediaSliderThumb(CGContextRef context, CGRect rect, BOOL active);
+void WKDrawMediaUnMuteButton(CGContextRef context, CGRect rect, BOOL active);
+
#ifdef __cplusplus
}
#endif