Changeset 47110 in webkit
- Timestamp:
- Aug 12, 2009 9:20:34 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 41 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r47107 r47110 1 2009-08-12 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 <video> and <audio> controller should be accessible 6 https://bugs.webkit.org/show_bug.cgi?id=28081 7 8 * accessibility/media-element.html: Added. 9 * platform/mac-leopard/accessibility/media-element-expected.txt: 10 * platform/mac-leopard/media/controls-strict-expected.txt: 11 * platform/mac/accessibility/media-element-expected.txt: 12 Added. 13 14 * platform/mac-leopard/media/controls-after-reload-expected.txt: 15 * platform/mac-leopard/media/controls-styling-expected.txt: 16 * platform/mac-leopard/media/video-empty-source-expected.txt: 17 * platform/mac-leopard/media/video-zoom-controls-expected.txt: 18 * media/video-controls-visible-audio-only.html: 19 * platform/mac-leopard/media/audio-controls-rendering-expected.txt: 20 * platform/mac/media/audio-controls-rendering-expected.txt: 21 * platform/mac/media/controls-after-reload-expected.txt: 22 * platform/mac/media/controls-styling-expected.txt: 23 * platform/mac/media/video-controls-rendering-expected.txt: 24 * platform/mac/media/video-display-toggle-expected.txt: 25 * platform/mac/media/video-empty-source-expected.txt: 26 * platform/mac/media/video-zoom-controls-expected.txt: 27 Update for controller element tab order change. 28 1 29 2009-08-12 Brady Eidson <beidson@apple.com> 2 30 -
trunk/LayoutTests/media/video-controls-visible-audio-only.html
r40219 r47110 34 34 35 35 // start playback 36 eventSender.mouseMoveTo(left + 16 +8, bottom - 8);36 eventSender.mouseMoveTo(left + 8, bottom - 8); 37 37 eventSender.mouseDown(); 38 38 eventSender.mouseUp(); -
trunk/LayoutTests/platform/mac-leopard/media/audio-controls-rendering-expected.txt
r46288 r47110 20 20 RenderFlexibleBox (positioned) {DIV} at (0,0) size 200x16 21 21 RenderButton {INPUT} at (0,0) size 16x16 22 RenderButton {INPUT} at (16,0) size 16x16 23 RenderFlexibleBox {DIV} at (32,0) size 136x16 22 RenderFlexibleBox {DIV} at (16,0) size 136x16 24 23 RenderSlider {INPUT} at (0,0) size 136x16 25 24 RenderBlock {DIV} at (2,1) size 13x14 25 RenderButton {INPUT} at (152,0) size 16x16 26 26 RenderButton {INPUT} at (168,0) size 16x16 27 27 RenderButton {INPUT} at (184,0) size 16x16 … … 31 31 RenderFlexibleBox (positioned) {DIV} at (0,0) size 320x16 32 32 RenderButton {INPUT} at (0,0) size 16x16 33 RenderButton {INPUT} at (16,0) size 16x16 34 RenderFlexibleBox {DIV} at (32,0) size 256x16 33 RenderFlexibleBox {DIV} at (16,0) size 256x16 35 34 RenderSlider {INPUT} at (0,0) size 256x16 36 35 RenderBlock {DIV} at (2,1) size 13x14 36 RenderButton {INPUT} at (272,0) size 16x16 37 37 RenderButton {INPUT} at (288,0) size 16x16 38 38 RenderButton {INPUT} at (304,0) size 16x16 … … 44 44 RenderFlexibleBox (positioned) {DIV} at (0,84) size 320x16 45 45 RenderButton {INPUT} at (0,0) size 16x16 46 RenderButton {INPUT} at (16,0) size 16x16 47 RenderFlexibleBox {DIV} at (32,0) size 256x16 46 RenderFlexibleBox {DIV} at (16,0) size 256x16 48 47 RenderSlider {INPUT} at (0,0) size 256x16 49 48 RenderBlock {DIV} at (2,1) size 13x14 49 RenderButton {INPUT} at (272,0) size 16x16 50 50 RenderButton {INPUT} at (288,0) size 16x16 51 51 RenderButton {INPUT} at (304,0) size 16x16 -
trunk/LayoutTests/platform/mac-leopard/media/controls-after-reload-expected.txt
r45628 r47110 18 18 RenderFlexibleBox (positioned) {DIV} at (0,224) size 320x16 19 19 RenderButton {INPUT} at (0,0) size 16x16 20 RenderButton {INPUT} at (16,0) size 16x16 21 RenderFlexibleBox {DIV} at (32,0) size 256x16 20 RenderFlexibleBox {DIV} at (16,0) size 256x16 22 21 RenderSlider {INPUT} at (0,0) size 256x16 23 22 RenderBlock {DIV} at (2,1) size 13x14 23 RenderButton {INPUT} at (272,0) size 16x16 24 24 RenderButton {INPUT} at (288,0) size 16x16 25 25 RenderButton {INPUT} at (304,0) size 16x16 -
trunk/LayoutTests/platform/mac-leopard/media/controls-styling-expected.txt
r45610 r47110 22 22 RenderFlexibleBox (positioned) {DIV} at (0,224) size 320x16 23 23 RenderButton {INPUT} at (0,0) size 16x16 24 RenderButton {INPUT} at (16,0) size 16x16 25 RenderFlexibleBox {DIV} at (32,0) size 256x16 24 RenderFlexibleBox {DIV} at (16,0) size 256x16 26 25 RenderSlider {INPUT} at (0,0) size 256x16 27 26 RenderBlock {DIV} at (2,1) size 13x14 27 RenderButton {INPUT} at (272,0) size 16x16 28 28 RenderButton {INPUT} at (288,0) size 16x16 29 29 RenderButton {INPUT} at (304,0) size 16x16 … … 33 33 RenderFlexibleBox (positioned) {DIV} at (0,224) size 320x16 34 34 RenderButton {INPUT} at (0,0) size 16x16 35 RenderButton {INPUT} at (16,0) size 16x16 36 RenderFlexibleBox {DIV} at (32,0) size 256x16 35 RenderFlexibleBox {DIV} at (16,0) size 256x16 37 36 RenderSlider {INPUT} at (0,0) size 256x16 38 37 RenderBlock {DIV} at (2,1) size 13x14 38 RenderButton {INPUT} at (272,0) size 16x16 39 39 RenderButton {INPUT} at (288,0) size 16x16 40 40 RenderButton {INPUT} at (304,0) size 16x16 -
trunk/LayoutTests/platform/mac-leopard/media/video-empty-source-expected.txt
r45655 r47110 18 18 RenderFlexibleBox (positioned) {DIV} at (0,134) size 300x16 19 19 RenderButton {INPUT} at (0,0) size 16x16 20 RenderButton {INPUT} at (16,0) size 16x16 21 RenderFlexibleBox {DIV} at (32,0) size 236x16 20 RenderFlexibleBox {DIV} at (16,0) size 236x16 22 21 RenderSlider {INPUT} at (0,0) size 236x16 23 22 RenderBlock {DIV} at (2,1) size 13x14 23 RenderButton {INPUT} at (252,0) size 16x16 24 24 RenderButton {INPUT} at (268,0) size 16x16 25 25 RenderButton {INPUT} at (284,0) size 16x16 -
trunk/LayoutTests/platform/mac-leopard/media/video-zoom-controls-expected.txt
r45687 r47110 14 14 RenderFlexibleBox (positioned) {DIV} at (0,156) size 240x24 15 15 RenderButton {INPUT} at (0,0) size 24x24 16 RenderButton {INPUT} at (24,0) size 24x24 17 RenderFlexibleBox {DIV} at (48,0) size 144x24 16 RenderFlexibleBox {DIV} at (24,0) size 144x24 18 17 RenderSlider {INPUT} at (0,0) size 144x24 19 18 RenderBlock {DIV} at (3,1) size 19x21 19 RenderButton {INPUT} at (168,0) size 24x24 20 20 RenderButton {INPUT} at (192,0) size 24x24 21 21 RenderButton {INPUT} at (216,0) size 24x24 … … 27 27 RenderFlexibleBox (positioned) {DIV} at (0,156) size 240x24 28 28 RenderButton {INPUT} at (0,0) size 24x24 29 RenderButton {INPUT} at (24,0) size 24x24 30 RenderFlexibleBox {DIV} at (48,0) size 144x24 29 RenderFlexibleBox {DIV} at (24,0) size 144x24 31 30 RenderSlider {INPUT} at (0,0) size 144x24 32 31 RenderBlock {DIV} at (3,1) size 19x21 32 RenderButton {INPUT} at (168,0) size 24x24 33 33 RenderButton {INPUT} at (192,0) size 24x24 34 34 RenderButton {INPUT} at (216,0) size 24x24 -
trunk/LayoutTests/platform/mac/media/audio-controls-rendering-expected.txt
r46279 r47110 20 20 RenderFlexibleBox (positioned) {DIV} at (0,0) size 200x25 21 21 RenderButton {INPUT} at (6,3) size 18x18 22 RenderButton {INPUT} at (177,5) size 15x1423 22 RenderButton {INPUT} at (32,4) size 16x16 24 23 RenderFlexibleBox {DIV} at (49,1) size 126x22 25 24 RenderSlider {INPUT} at (0,5) size 126x13 26 25 RenderBlock {DIV} at (0,1) size 12x10 26 RenderButton {INPUT} at (177,5) size 15x14 27 27 layer at (8,85) size 320x25 28 28 RenderBlock (relative positioned) {DIV} at (0,0) size 320x25 … … 30 30 RenderFlexibleBox (positioned) {DIV} at (0,0) size 320x25 31 31 RenderButton {INPUT} at (6,3) size 18x18 32 RenderButton {INPUT} at (297,5) size 15x1433 32 RenderButton {INPUT} at (32,4) size 16x16 34 33 RenderFlexibleBox {DIV} at (49,5) size 246x15 35 34 RenderSlider {INPUT} at (45,2) size 156x13 36 35 RenderBlock {DIV} at (0,1) size 12x10 36 RenderButton {INPUT} at (297,5) size 15x14 37 37 layer at (57,92) size 45x11 scrollHeight 13 38 38 RenderFlexibleBox {DIV} at (0,2) size 45x11 [color=#FFFFFF] … … 52 52 RenderFlexibleBox (positioned) {DIV} at (0,75) size 320x25 53 53 RenderButton {INPUT} at (6,3) size 18x18 54 RenderButton {INPUT} at (297,5) size 15x1455 54 RenderButton {INPUT} at (32,4) size 16x16 56 55 RenderFlexibleBox {DIV} at (49,5) size 246x15 57 56 RenderSlider {INPUT} at (45,2) size 156x13 58 57 RenderBlock {DIV} at (0,1) size 12x10 58 RenderButton {INPUT} at (297,5) size 15x14 59 59 layer at (57,210) size 45x11 scrollHeight 13 60 60 RenderFlexibleBox {DIV} at (0,2) size 45x11 [color=#FFFFFF] -
trunk/LayoutTests/platform/mac/media/controls-after-reload-expected.txt
r46140 r47110 18 18 RenderFlexibleBox (positioned) {DIV} at (0,215) size 320x25 19 19 RenderButton {INPUT} at (6,3) size 18x18 20 RenderButton {INPUT} at (297,5) size 15x1421 20 RenderButton {INPUT} at (32,4) size 16x16 22 21 RenderFlexibleBox {DIV} at (49,5) size 246x15 23 22 RenderSlider {INPUT} at (45,2) size 156x13 24 23 RenderBlock {DIV} at (0,1) size 12x10 24 RenderButton {INPUT} at (297,5) size 15x14 25 25 layer at (57,264) size 45x11 scrollHeight 13 26 26 RenderFlexibleBox {DIV} at (0,2) size 45x11 [color=#FFFFFF] -
trunk/LayoutTests/platform/mac/media/controls-styling-expected.txt
r46140 r47110 22 22 RenderFlexibleBox (positioned) {DIV} at (0,215) size 320x25 23 23 RenderButton {INPUT} at (6,3) size 18x18 24 RenderButton {INPUT} at (297,5) size 15x1425 24 RenderButton {INPUT} at (32,4) size 16x16 26 25 RenderFlexibleBox {DIV} at (49,5) size 246x15 27 26 RenderSlider {INPUT} at (45,2) size 156x13 28 27 RenderBlock {DIV} at (0,1) size 12x10 28 RenderButton {INPUT} at (297,5) size 15x14 29 29 layer at (67,264) size 45x11 scrollHeight 13 30 30 RenderFlexibleBox {DIV} at (0,2) size 45x11 [color=#FFFFFF] … … 42 42 RenderFlexibleBox (positioned) {DIV} at (0,215) size 320x25 43 43 RenderButton {INPUT} at (6,3) size 18x18 44 RenderButton {INPUT} at (297,5) size 15x1445 44 RenderButton {INPUT} at (32,4) size 16x16 46 45 RenderFlexibleBox {DIV} at (49,5) size 246x15 47 46 RenderSlider {INPUT} at (45,2) size 156x13 48 47 RenderBlock {DIV} at (0,1) size 12x10 48 RenderButton {INPUT} at (297,5) size 15x14 49 49 layer at (57,504) size 45x11 scrollHeight 13 50 50 RenderFlexibleBox {DIV} at (0,2) size 45x11 [color=#FFFFFF] -
trunk/LayoutTests/platform/mac/media/video-controls-rendering-expected.txt
r45271 r47110 21 21 RenderFlexibleBox (positioned) {DIV} at (0,224) size 320x16 22 22 RenderButton {INPUT} at (0,0) size 16x16 23 RenderButton {INPUT} at (16,0) size 16x16 24 RenderFlexibleBox {DIV} at (32,0) size 256x16 23 RenderFlexibleBox {DIV} at (16,0) size 256x16 25 24 RenderSlider {INPUT} at (0,0) size 256x16 26 25 RenderBlock {DIV} at (2,1) size 13x14 26 RenderButton {INPUT} at (272,0) size 16x16 27 27 RenderButton {INPUT} at (288,0) size 16x16 28 28 RenderButton {INPUT} at (304,0) size 16x16 … … 32 32 RenderFlexibleBox (positioned) {DIV} at (0,224) size 320x16 33 33 RenderButton {INPUT} at (0,0) size 16x16 34 RenderButton {INPUT} at (16,0) size 16x16 35 RenderFlexibleBox {DIV} at (32,0) size 256x16 34 RenderFlexibleBox {DIV} at (16,0) size 256x16 36 35 RenderSlider {INPUT} at (0,0) size 256x16 37 36 RenderBlock {DIV} at (2,1) size 13x14 37 RenderButton {INPUT} at (272,0) size 16x16 38 38 RenderButton {INPUT} at (288,0) size 16x16 39 39 RenderButton {INPUT} at (304,0) size 16x16 … … 45 45 RenderFlexibleBox (positioned) {DIV} at (0,224) size 320x16 46 46 RenderButton {INPUT} at (0,0) size 16x16 47 RenderButton {INPUT} at (16,0) size 16x16 48 RenderFlexibleBox {DIV} at (32,0) size 256x16 47 RenderFlexibleBox {DIV} at (16,0) size 256x16 49 48 RenderSlider {INPUT} at (0,0) size 256x16 50 49 RenderBlock {DIV} at (2,1) size 13x14 50 RenderButton {INPUT} at (272,0) size 16x16 51 51 RenderButton {INPUT} at (288,0) size 16x16 52 52 RenderButton {INPUT} at (304,0) size 16x16 -
trunk/LayoutTests/platform/mac/media/video-display-toggle-expected.txt
r45271 r47110 17 17 RenderFlexibleBox (positioned) {DIV} at (0,224) size 320x16 18 18 RenderButton {INPUT} at (0,0) size 16x16 19 RenderButton {INPUT} at (16,0) size 16x16 20 RenderFlexibleBox {DIV} at (32,0) size 256x16 19 RenderFlexibleBox {DIV} at (16,0) size 256x16 21 20 RenderSlider {INPUT} at (0,0) size 256x16 22 21 RenderBlock {DIV} at (2,1) size 13x14 22 RenderButton {INPUT} at (272,0) size 16x16 23 23 RenderButton {INPUT} at (288,0) size 16x16 24 24 RenderButton {INPUT} at (304,0) size 16x16 -
trunk/LayoutTests/platform/mac/media/video-empty-source-expected.txt
r45744 r47110 18 18 RenderFlexibleBox (positioned) {DIV} at (0,125) size 300x25 19 19 RenderButton {INPUT} at (6,3) size 18x18 20 RenderButton {INPUT} at (32,4) size 16x16 20 21 RenderButton {INPUT} at (277,5) size 15x14 21 RenderButton {INPUT} at (32,4) size 16x16 -
trunk/LayoutTests/platform/mac/media/video-zoom-controls-expected.txt
r46140 r47110 14 14 RenderFlexibleBox (positioned) {DIV} at (0,143) size 240x37 15 15 RenderButton {INPUT} at (9,4) size 27x27 16 RenderButton {INPUT} at (206,8) size 22x2117 16 RenderButton {INPUT} at (48,6) size 24x24 18 17 RenderFlexibleBox {DIV} at (73,1) size 130x34 19 18 RenderSlider {INPUT} at (0,9) size 130x19 20 19 RenderBlock {DIV} at (0,2) size 18x15 20 RenderButton {INPUT} at (206,8) size 22x21 21 21 layer at (57,310) size 240x180 22 22 RenderVideo {VIDEO} at (45,298) size 240x180 … … 26 26 RenderFlexibleBox (positioned) {DIV} at (0,143) size 240x37 27 27 RenderButton {INPUT} at (9,4) size 27x27 28 RenderButton {INPUT} at (206,8) size 22x2129 28 RenderButton {INPUT} at (48,6) size 24x24 30 29 RenderFlexibleBox {DIV} at (73,1) size 130x34 31 30 RenderSlider {INPUT} at (0,9) size 130x19 32 31 RenderBlock {DIV} at (0,2) size 18x15 32 RenderButton {INPUT} at (206,8) size 22x21 -
trunk/WebCore/ChangeLog
r47108 r47110 1 2009-08-12 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 <video> and <audio> controller should be accessible 6 https://bugs.webkit.org/show_bug.cgi?id=28081 7 8 Test: accessibility/media-element.html 9 10 * GNUmakefile.am: 11 * WebCore.gypi: 12 * WebCore.pro: 13 * WebCore.vcproj/WebCore.vcproj: 14 * WebCore.xcodeproj/project.pbxproj: 15 * WebCoreSources.bkl: 16 Add AccessibilityMediaControls.cpp/.h 17 18 * accessibility/AXObjectCache.cpp: 19 * accessibility/AXObjectCache.h: 20 (WebCore::AXObjectCache::getOrCreate): 21 Create AccessibilityMediaControl. Update Copyright 22 23 * accessibility/AccessibilityMediaControls.cpp: 24 * accessibility/AccessibilityMediaControls.h: 25 Added. 26 27 * accessibility/AccessibilityObject.cpp: 28 * accessibility/AccessibilityObject.h: 29 Add isMediaTimeline. Update Copyright. 30 31 * accessibility/AccessibilitySlider.h: 32 Make constructor protected instead of private so AccessibilityMediaTimeline can 33 call it. 34 35 * accessibility/mac/AccessibilityObjectWrapper.mm: 36 (-[AccessibilityObjectWrapper accessibilityAttributeNames]): 37 Add NSAccessibilityValueDescriptionAttribute to range attributes. 38 (-[AccessibilityObjectWrapper subrole]): 39 Return NSAccessibilityTimelineSubrole for AccessibilityMediaTimeline. 40 41 * dom/Node.h: 42 add isMediaControlElement. 43 44 * page/mac/WebCoreViewFactory.h: 45 * platform/LocalizedStrings.h: 46 * platform/mac/LocalizedStringsMac.mm: 47 (WebCore::localizedMediaControlElementString): 48 (WebCore::localizedMediaControlElementHelpText): 49 (WebCore::localizedMediaTimeDescription): 50 New, return localized media controller strings. 51 52 * rendering/MediaControlElements.cpp: 53 (WebCore::MediaControlElement::MediaControlElement): 54 Initialize m_displayType. 55 (WebCore::MediaControlElement::MediaControlElement): 56 (WebCore::MediaControlStatusDisplayElement::MediaControlStatusDisplayElement): 57 Fix style. 58 (WebCore::MediaControlInputElement::MediaControlInputElement): 59 Set m_displayType based on pseudo style ID. 60 (WebCore::MediaControlInputElement::MediaControlInputElement): 61 rename local "o" to "object". 62 (WebCore::MediaControlMuteButtonElement::MediaControlMuteButtonElement): 63 (WebCore::MediaControlPlayButtonElement::MediaControlPlayButtonElement): 64 (WebCore::MediaControlSeekButtonElement::MediaControlSeekButtonElement): 65 (WebCore::MediaControlRewindButtonElement::MediaControlRewindButtonElement): 66 (WebCore::MediaControlReturnToRealtimeButtonElement::MediaControlReturnToRealtimeButtonElement): 67 (WebCore::MediaControlTimelineElement::MediaControlTimelineElement): 68 (WebCore::MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement): 69 (WebCore::MediaControlTimelineElement::MediaControlTimelineElement): 70 (WebCore::MediaControlTimelineElement::MediaControlTimelineElement): 71 (WebCore::MediaControlTimelineElement::MediaControlTimelineElement): 72 Update for MediaControlInputElement constructor change. 73 (WebCore::MediaControlTimeDisplayElement::formatTime): 74 New, moved here from RenderMedia so AccessibilityMediaTimeDisplay can use it. 75 (WebCore::MediaControlTimeDisplayElement::setCurrentValue): 76 New, set text to current time. 77 * rendering/MediaControlElements.h: 78 79 * rendering/RenderMedia.cpp: 80 (WebCore::RenderMedia::updateControls): 81 Create controls in tab order. 82 (WebCore::RenderMedia::formatTime): 83 Moved to MediaControlTimeDisplayElement::formatTime. 84 (WebCore::RenderMedia::updateTimeDisplay): 85 Call MediaControlTimeDisplayElement::setCurrentValue. 86 * rendering/RenderMedia.h: 87 1 88 2009-08-12 Viet-Trung Luu <viettrungluu@gmail.com> 2 89 -
trunk/WebCore/GNUmakefile.am
r47100 r47110 289 289 WebCore/accessibility/AccessibilityListBoxOption.cpp \ 290 290 WebCore/accessibility/AccessibilityListBoxOption.h \ 291 WebCore/accessibility/AccessibilityMediaControls.cpp \ 292 WebCore/accessibility/AccessibilityMediaControls.h \ 291 293 WebCore/accessibility/AccessibilityObject.cpp \ 292 294 WebCore/accessibility/AccessibilityObject.h \ -
trunk/WebCore/WebCore.gypi
r47081 r47110 370 370 'accessibility/AccessibilityListBoxOption.cpp', 371 371 'accessibility/AccessibilityListBoxOption.h', 372 'accessibility/AccessibilityMediaControls.cpp', 373 'accessibility/AccessibilityMediaControls.h', 372 374 'accessibility/AccessibilityObject.cpp', 373 375 'accessibility/AccessibilityObject.h', -
trunk/WebCore/WebCore.pro
r47094 r47110 608 608 SOURCES += \ 609 609 accessibility/AccessibilityImageMapLink.cpp \ 610 accessibility/AccessibilityMediaControls.cpp \ 610 611 accessibility/AccessibilityObject.cpp \ 611 612 accessibility/AccessibilityList.cpp \ … … 1295 1296 accessibility/AccessibilityListBoxOption.h \ 1296 1297 accessibility/AccessibilityList.h \ 1298 accessibility/AccessibilityMediaControls.h \ 1297 1299 accessibility/AccessibilityObject.h \ 1298 1300 accessibility/AccessibilityRenderObject.h \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r47073 r47110 16583 16583 <File 16584 16584 RelativePath="..\accessibility\AccessibilityListBoxOption.h" 16585 > 16586 </File> 16587 <File 16588 RelativePath="..\accessibility\AccessibilityMediaControls.cpp" 16589 > 16590 </File> 16591 <File 16592 RelativePath="..\accessibility\AccessibilityMediaControls.h" 16585 16593 > 16586 16594 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r47056 r47110 39 39 0709FC4E1025DEE30059CDBA /* AccessibilitySlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 0709FC4D1025DEE30059CDBA /* AccessibilitySlider.h */; }; 40 40 0735EE6A0F40C5E4004A2604 /* MediaPlayerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */; settings = {ATTRIBUTES = (Private, ); }; }; 41 07B0113D1032241900FBDC33 /* AccessibilityMediaControls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07B0113C1032241900FBDC33 /* AccessibilityMediaControls.cpp */; }; 42 07B0113F1032242200FBDC33 /* AccessibilityMediaControls.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B0113E1032242200FBDC33 /* AccessibilityMediaControls.h */; }; 41 43 080081960ED3B2DD00C53BC0 /* WMLAnchorElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 080081940ED3B2DD00C53BC0 /* WMLAnchorElement.cpp */; }; 42 44 080081970ED3B2DD00C53BC0 /* WMLAnchorElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 080081950ED3B2DD00C53BC0 /* WMLAnchorElement.h */; }; … … 645 647 3390CA550FFC157B00921962 /* NotificationCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3390CA510FFC157B00921962 /* NotificationCenter.cpp */; }; 646 648 3390CA560FFC157B00921962 /* NotificationCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3390CA520FFC157B00921962 /* NotificationCenter.h */; }; 647 3390CA570FFC157B00921962 /* NotificationCenter.idl in Resources */ = {isa = PBXBuildFile; fileRef = 3390CA530FFC157B00921962 /* NotificationCenter.idl */; };648 649 3390CA580FFC157B00921962 /* NotificationContents.h in Headers */ = {isa = PBXBuildFile; fileRef = 3390CA540FFC157B00921962 /* NotificationContents.h */; }; 649 650 371F4F400D25B9AF00ECE0D5 /* FontData.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4F3E0D25B9AF00ECE0D5 /* FontData.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5009 5010 079F5E4B0F3BEBEA005E0782 /* MediaPlayerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerPrivate.h; sourceTree = "<group>"; }; 5010 5011 07AFE5900F1446BD00841617 /* mediaControlsQT.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mediaControlsQT.css; sourceTree = "<group>"; }; 5012 07B0113C1032241900FBDC33 /* AccessibilityMediaControls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityMediaControls.cpp; sourceTree = "<group>"; }; 5013 07B0113E1032242200FBDC33 /* AccessibilityMediaControls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityMediaControls.h; sourceTree = "<group>"; }; 5011 5014 080081940ED3B2DD00C53BC0 /* WMLAnchorElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLAnchorElement.cpp; sourceTree = "<group>"; }; 5012 5015 080081950ED3B2DD00C53BC0 /* WMLAnchorElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLAnchorElement.h; sourceTree = "<group>"; }; … … 9985 9988 29A8121F0FBB9C1D00510293 /* AccessibilityListBoxOption.cpp */, 9986 9989 29A812240FBB9C1D00510293 /* AccessibilityListBoxOption.h */, 9990 07B0113C1032241900FBDC33 /* AccessibilityMediaControls.cpp */, 9991 07B0113E1032242200FBDC33 /* AccessibilityMediaControls.h */, 9987 9992 29A8121E0FBB9C1D00510293 /* AccessibilityObject.cpp */, 9988 9993 29A812180FBB9C1D00510293 /* AccessibilityObject.h */, … … 17248 17253 49484FCE102CF23C00187DD3 /* CanvasStyle.h in Headers */, 17249 17254 416E29A6102FA962007FC14E /* WorkerReportingProxy.h in Headers */, 17255 07B0113F1032242200FBDC33 /* AccessibilityMediaControls.h in Headers */, 17250 17256 ); 17251 17257 runOnlyForDeploymentPostprocessing = 0; … … 19304 19310 49484FCA102CF23C00187DD3 /* CanvasRenderingContext2D.cpp in Sources */, 19305 19311 49484FCD102CF23C00187DD3 /* CanvasStyle.cpp in Sources */, 19312 07B0113D1032241900FBDC33 /* AccessibilityMediaControls.cpp in Sources */, 19306 19313 ); 19307 19314 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/WebCoreSources.bkl
r46937 r47110 38 38 accessibility/AccessibilityARIAGridRow.cpp 39 39 accessibility/AccessibilityImageMapLink.cpp 40 accessibility/AccessibilityMediaControls.cpp 40 41 accessibility/AccessibilityObject.cpp 41 42 accessibility/AccessibilityList.cpp -
trunk/WebCore/accessibility/AXObjectCache.cpp
r46878 r47110 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 37 37 #include "AccessibilityListBoxOption.h" 38 38 #include "AccessibilityImageMapLink.h" 39 #include "AccessibilityMediaControls.h" 39 40 #include "AccessibilityRenderObject.h" 40 41 #include "AccessibilitySlider.h" … … 46 47 #include "InputElement.h" 47 48 #include "HTMLNames.h" 49 #if ENABLE(VIDEO) 50 #include "MediaControlElements.h" 51 #endif 48 52 #include "RenderObject.h" 49 53 #include "RenderView.h" … … 127 131 else if (renderer->isTableCell()) 128 132 newObj = AccessibilityTableCell::create(renderer); 133 134 #if ENABLE(VIDEO) 135 // media controls 136 else if (renderer->node() && renderer->node()->isMediaControlElement()) 137 newObj = AccessibilityMediaControl::create(renderer); 138 #endif 129 139 130 140 // input type=range -
trunk/WebCore/accessibility/AXObjectCache.h
r46604 r47110 1 1 /* 2 * Copyright (C) 2003, 2006, 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without -
trunk/WebCore/accessibility/AccessibilityObject.cpp
r47076 r47110 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without -
trunk/WebCore/accessibility/AccessibilityObject.h
r47076 r47110 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2008 Nuanti Ltd. 4 4 * … … 222 222 virtual bool isCheckboxOrRadio() const { return false; }; 223 223 virtual bool isListBox() const { return roleValue() == ListBoxRole; }; 224 virtual bool isMediaTimeline() const { return false; } 224 225 virtual bool isMenuRelated() const { return false; } 225 226 virtual bool isMenu() const { return false; } -
trunk/WebCore/accessibility/AccessibilitySlider.h
r46783 r47110 62 62 virtual void decrement(); 63 63 64 protected: 65 AccessibilitySlider(RenderObject*); 66 64 67 private: 65 AccessibilitySlider(RenderObject*);66 68 void changeValue(float /*percentChange*/); 67 69 HTMLInputElement* element() const; -
trunk/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
r47076 r47110 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 679 679 [tempArray addObject:NSAccessibilityMaxValueAttribute]; 680 680 [tempArray addObject:NSAccessibilityOrientationAttribute]; 681 [tempArray addObject:NSAccessibilityValueDescriptionAttribute]; 681 682 rangeAttrs = [[NSArray alloc] initWithArray:tempArray]; 682 683 [tempArray release]; … … 980 981 { DefinitionListTermRole, NSAccessibilityGroupRole }, 981 982 982 { SliderThumbRole, NSAccessibilityValueIndicatorRole }, 983 984 983 { SliderThumbRole, NSAccessibilityValueIndicatorRole } 985 984 }; 986 985 AccessibilityRoleMap& roleMap = *new AccessibilityRoleMap; … … 1029 1028 } 1030 1029 1030 if (m_object->isMediaTimeline()) 1031 return NSAccessibilityTimelineSubrole; 1032 1031 1033 return nil; 1032 1034 } … … 1120 1122 if ([axRole isEqualToString:NSAccessibilityToolbarRole]) 1121 1123 return NSAccessibilityRoleDescription(NSAccessibilityToolbarRole, [self subrole]); 1122 1124 1123 1125 return NSAccessibilityRoleDescription(NSAccessibilityUnknownRole, nil); 1124 1126 } … … 1254 1256 return m_object->accessibilityDescription(); 1255 1257 } 1256 1258 1257 1259 if ([attributeName isEqualToString: NSAccessibilityValueAttribute]) { 1258 1260 if (m_object->isAttachment()) { -
trunk/WebCore/dom/Node.h
r45251 r47110 183 183 #endif 184 184 185 virtual bool isMediaControlElement() const { return false; } 185 186 virtual bool isStyledElement() const { return false; } 186 187 virtual bool isFrameOwnerElement() const { return false; } -
trunk/WebCore/page/mac/WebCoreViewFactory.h
r45474 r47110 1 1 /* 2 * Copyright (C) 2003, 2005 Apple Computer, Inc. All rights reserved.2 * Copyright (C) 2003, 2005, 2009 Apple Computer, Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 144 144 - (NSString *)mediaElementLoadingStateText; 145 145 - (NSString *)mediaElementLiveBroadcastStateText; 146 - (NSString*)localizedMediaControlElementString:(NSString*)name; 147 - (NSString*)localizedMediaControlElementHelpText:(NSString*)name; 148 - (NSString*)localizedMediaTimeDescription:(float)time; 149 146 150 147 151 @end -
trunk/WebCore/platform/LocalizedStrings.h
r45474 r47110 1 1 /* 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved.2 * Copyright (C) 2003, 2006, 2009 Apple Computer, Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 136 136 String mediaElementLoadingStateText(); 137 137 String mediaElementLiveBroadcastStateText(); 138 String localizedMediaControlElementString(const String&); 139 String localizedMediaControlElementHelpText(const String&); 140 String localizedMediaTimeDescription(float); 138 141 } 139 142 -
trunk/WebCore/platform/mac/LocalizedStringsMac.mm
r45474 r47110 1 1 /* 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved.2 * Copyright (C) 2003, 2006, 2009 Apple Computer, Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 714 714 } 715 715 716 } 716 String localizedMediaControlElementString(const String& controlName) 717 { 718 BEGIN_BLOCK_OBJC_EXCEPTIONS; 719 return [[WebCoreViewFactory sharedFactory] localizedMediaControlElementString:controlName]; 720 END_BLOCK_OBJC_EXCEPTIONS; 721 return String(); 722 } 723 724 String localizedMediaControlElementHelpText(const String& controlName) 725 { 726 BEGIN_BLOCK_OBJC_EXCEPTIONS; 727 return [[WebCoreViewFactory sharedFactory] localizedMediaControlElementHelpText:controlName]; 728 END_BLOCK_OBJC_EXCEPTIONS; 729 return String(); 730 } 731 732 String localizedMediaTimeDescription(float time) 733 { 734 BEGIN_BLOCK_OBJC_EXCEPTIONS; 735 return [[WebCoreViewFactory sharedFactory] localizedMediaTimeDescription:time]; 736 END_BLOCK_OBJC_EXCEPTIONS; 737 return String(); 738 } 739 740 741 } -
trunk/WebCore/rendering/MediaControlElements.cpp
r46915 r47110 33 33 #include "MediaControlElements.h" 34 34 35 #include "LocalizedStrings.h"36 35 #include "EventNames.h" 37 36 #include "FloatConversion.h" 38 37 #include "Frame.h" 39 38 #include "HTMLNames.h" 39 #include "LocalizedStrings.h" 40 40 #include "MouseEvent.h" 41 41 #include "RenderMedia.h" … … 79 79 80 80 81 MediaControlElement::MediaControlElement(Document* doc, PseudoId pseudo, HTMLMediaElement* mediaElement) 81 MediaControlElement::MediaControlElement(Document* doc, PseudoId pseudo, HTMLMediaElement* mediaElement) 82 82 : HTMLDivElement(divTag, doc) 83 83 , m_mediaElement(mediaElement) … … 85 85 { 86 86 setInDocument(true); 87 switch (pseudo) { 88 case MEDIA_CONTROLS_CURRENT_TIME_DISPLAY: 89 m_displayType = MediaCurrentTimeDisplay; 90 break; 91 case MEDIA_CONTROLS_TIME_REMAINING_DISPLAY: 92 m_displayType = MediaTimeRemainingDisplay; 93 break; 94 case MEDIA_CONTROLS_TIMELINE_CONTAINER: 95 m_displayType = MediaTimelineContainer; 96 break; 97 case MEDIA_CONTROLS_STATUS_DISPLAY: 98 m_displayType = MediaStatusDisplay; 99 break; 100 case MEDIA_CONTROLS_PANEL: 101 m_displayType = MediaControlsPanel; 102 break; 103 default: 104 ASSERT_NOT_REACHED(); 105 break; 106 } 87 107 } 88 108 … … 167 187 168 188 MediaControlTimelineContainerElement::MediaControlTimelineContainerElement(Document* doc, HTMLMediaElement* element) 169 : MediaControlElement(doc, MEDIA_CONTROLS_TIMELINE_CONTAINER, element)189 : MediaControlElement(doc, MEDIA_CONTROLS_TIMELINE_CONTAINER, element) 170 190 { 171 191 } … … 190 210 191 211 MediaControlStatusDisplayElement::MediaControlStatusDisplayElement(Document* doc, HTMLMediaElement* element) 192 : MediaControlElement(doc, MEDIA_CONTROLS_STATUS_DISPLAY, element)193 , m_stateBeingDisplayed(Nothing)212 : MediaControlElement(doc, MEDIA_CONTROLS_STATUS_DISPLAY, element) 213 , m_stateBeingDisplayed(Nothing) 194 214 { 195 215 } … … 236 256 // ---------------------------- 237 257 238 MediaControlInputElement::MediaControlInputElement(Document* doc, PseudoId pseudo, const String& type, HTMLMediaElement* mediaElement , MediaControlElementType displayType)258 MediaControlInputElement::MediaControlInputElement(Document* doc, PseudoId pseudo, const String& type, HTMLMediaElement* mediaElement) 239 259 : HTMLInputElement(inputTag, doc) 240 260 , m_mediaElement(mediaElement) 241 261 , m_pseudoStyleId(pseudo) 242 , m_displayType(displayType)243 262 { 244 263 setInputType(type); 245 264 setInDocument(true); 265 266 switch (pseudo) { 267 case MEDIA_CONTROLS_MUTE_BUTTON: 268 m_displayType = MediaMuteButton; 269 break; 270 case MEDIA_CONTROLS_PLAY_BUTTON: 271 m_displayType = MediaPlayButton; 272 break; 273 case MEDIA_CONTROLS_SEEK_FORWARD_BUTTON: 274 m_displayType = MediaSeekForwardButton; 275 break; 276 case MEDIA_CONTROLS_SEEK_BACK_BUTTON: 277 m_displayType = MediaSeekBackButton; 278 break; 279 case MEDIA_CONTROLS_FULLSCREEN_BUTTON: 280 m_displayType = MediaFullscreenButton; 281 break; 282 case MEDIA_CONTROLS_TIMELINE: 283 m_displayType = MediaSlider; 284 break; 285 case MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON: 286 m_displayType = MediaReturnToRealtimeButton; 287 break; 288 case MEDIA_CONTROLS_REWIND_BUTTON: 289 m_displayType = MediaRewindButton; 290 break; 291 default: 292 ASSERT_NOT_REACHED(); 293 break; 294 } 246 295 } 247 296 … … 325 374 326 375 m_displayType = displayType; 327 if (RenderObject* o = renderer())328 o ->repaint();376 if (RenderObject* object = renderer()) 377 object->repaint(); 329 378 } 330 379 … … 332 381 333 382 MediaControlMuteButtonElement::MediaControlMuteButtonElement(Document* doc, HTMLMediaElement* element) 334 : MediaControlInputElement(doc, MEDIA_CONTROLS_MUTE_BUTTON, "button", element , element->muted() ? MediaUnMuteButton : MediaMuteButton)383 : MediaControlInputElement(doc, MEDIA_CONTROLS_MUTE_BUTTON, "button", element) 335 384 { 336 385 } … … 353 402 354 403 MediaControlPlayButtonElement::MediaControlPlayButtonElement(Document* doc, HTMLMediaElement* element) 355 : MediaControlInputElement(doc, MEDIA_CONTROLS_PLAY_BUTTON, "button", element , element->canPlay() ? MediaPlayButton : MediaPauseButton)404 : MediaControlInputElement(doc, MEDIA_CONTROLS_PLAY_BUTTON, "button", element) 356 405 { 357 406 } … … 375 424 MediaControlSeekButtonElement::MediaControlSeekButtonElement(Document* doc, HTMLMediaElement* element, bool forward) 376 425 : MediaControlInputElement(doc, forward ? MEDIA_CONTROLS_SEEK_FORWARD_BUTTON : MEDIA_CONTROLS_SEEK_BACK_BUTTON, 377 "button", element , forward ? MediaSeekForwardButton : MediaSeekBackButton)426 "button", element) 378 427 , m_forward(forward) 379 428 , m_seeking(false) … … 434 483 435 484 MediaControlRewindButtonElement::MediaControlRewindButtonElement(Document* doc, HTMLMediaElement* element) 436 : MediaControlInputElement(doc, MEDIA_CONTROLS_REWIND_BUTTON, "button", element, MediaRewindButton)485 : MediaControlInputElement(doc, MEDIA_CONTROLS_REWIND_BUTTON, "button", element) 437 486 { 438 487 } … … 456 505 457 506 MediaControlReturnToRealtimeButtonElement::MediaControlReturnToRealtimeButtonElement(Document* doc, HTMLMediaElement* element) 458 : MediaControlInputElement(doc, MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON, "button", element , MediaReturnToRealtimeButton)507 : MediaControlInputElement(doc, MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON, "button", element) 459 508 { 460 509 } … … 477 526 478 527 MediaControlTimelineElement::MediaControlTimelineElement(Document* document, HTMLMediaElement* element) 479 : MediaControlInputElement(document, MEDIA_CONTROLS_TIMELINE, "range", element , MediaTimelineContainer)480 { 528 : MediaControlInputElement(document, MEDIA_CONTROLS_TIMELINE, "range", element) 529 { 481 530 } 482 531 … … 518 567 MediaControlInputElement::update(); 519 568 } 520 521 569 // ---------------------------- 522 570 523 571 MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement(Document* doc, HTMLMediaElement* element) 524 : MediaControlInputElement(doc, MEDIA_CONTROLS_FULLSCREEN_BUTTON, "button", element , MediaFullscreenButton)572 : MediaControlInputElement(doc, MEDIA_CONTROLS_FULLSCREEN_BUTTON, "button", element) 525 573 { 526 574 } … … 544 592 MediaControlTimeDisplayElement::MediaControlTimeDisplayElement(Document* doc, PseudoId pseudo, HTMLMediaElement* element) 545 593 : MediaControlElement(doc, pseudo, element) 594 , m_currentValue(0) 546 595 , m_isVisible(true) 547 596 { … … 573 622 } 574 623 624 String MediaControlTimeDisplayElement::formatTime(float time) 625 { 626 if (!isfinite(time)) 627 time = 0; 628 int seconds = (int)fabsf(time); 629 int hours = seconds / (60 * 60); 630 int minutes = (seconds / 60) % 60; 631 seconds %= 60; 632 if (hours) { 633 if (hours > 9) 634 return String::format("%s%02d:%02d:%02d", (time < 0 ? "-" : ""), hours, minutes, seconds); 635 636 return String::format("%s%01d:%02d:%02d", (time < 0 ? "-" : ""), hours, minutes, seconds); 637 } 638 639 return String::format("%s%02d:%02d", (time < 0 ? "-" : ""), minutes, seconds); 640 } 641 642 void MediaControlTimeDisplayElement::setCurrentValue(float time) 643 { 644 m_currentValue = time; 645 646 ExceptionCode ec; 647 setInnerText(formatTime(m_currentValue), ec); 648 } 649 575 650 576 651 } //namespace WebCore -
trunk/WebCore/rendering/MediaControlElements.h
r45744 r47110 90 90 virtual void updateStyle(); 91 91 92 MediaControlElementType displayType() const { return m_displayType; } 93 94 HTMLMediaElement* mediaElement() const { return m_mediaElement; } 95 virtual bool isMediaControlElement() const { return true; } 96 92 97 protected: 93 98 HTMLMediaElement* m_mediaElement; 94 99 PseudoId m_pseudoStyleId; 100 MediaControlElementType m_displayType; // some elements can show multiple types (e.g. play/pause) 95 101 }; 96 102 … … 119 125 class MediaControlInputElement : public HTMLInputElement { 120 126 public: 121 MediaControlInputElement(Document*, PseudoId, const String& type, HTMLMediaElement* , MediaControlElementType);127 MediaControlInputElement(Document*, PseudoId, const String& type, HTMLMediaElement*); 122 128 virtual void attach(); 123 129 virtual bool rendererIsNeeded(RenderStyle*); … … 131 137 MediaControlElementType displayType() const { return m_displayType; } 132 138 139 HTMLMediaElement* mediaElement() const { return m_mediaElement; } 140 virtual bool isMediaControlElement() const { return true; } 141 133 142 protected: 134 143 virtual void updateDisplayType() { } … … 137 146 HTMLMediaElement* m_mediaElement; 138 147 PseudoId m_pseudoStyleId; 139 MediaControlElementType m_displayType; // some elements can show multiple types (e.g. play/pause)148 MediaControlElementType m_displayType; 140 149 }; 141 150 … … 218 227 virtual PassRefPtr<RenderStyle> styleForElement(); 219 228 220 private: 229 void setCurrentValue(float); 230 float currentValue() const { return m_currentValue; } 231 232 private: 233 String formatTime(float time); 234 235 float m_currentValue; 221 236 bool m_isVisible; 222 237 }; -
trunk/WebCore/rendering/RenderMedia.cpp
r45687 r47110 299 299 if (m_panel) { 300 300 createRewindButton(); 301 createMuteButton();302 301 createPlayButton(); 303 302 createReturnToRealtimeButton(); 304 303 createStatusDisplay(); 305 304 createTimelineContainer(); 306 createSeekBackButton();307 createSeekForwardButton();308 305 createFullscreenButton(); 309 306 if (m_timelineContainer) { … … 312 309 createTimeRemainingDisplay(); 313 310 } 311 createSeekBackButton(); 312 createSeekForwardButton(); 313 createMuteButton(); 314 314 m_panel->attach(); 315 315 } … … 367 367 } 368 368 369 String RenderMedia::formatTime(float time)370 {371 if (!isfinite(time))372 time = 0;373 int seconds = (int)fabsf(time);374 int hours = seconds / (60 * 60);375 int minutes = (seconds / 60) % 60;376 seconds %= 60;377 if (hours) {378 if (hours > 9)379 return String::format("%s%02d:%02d:%02d", (time < 0 ? "-" : ""), hours, minutes, seconds);380 else381 return String::format("%s%01d:%02d:%02d", (time < 0 ? "-" : ""), hours, minutes, seconds);382 }383 else384 return String::format("%s%02d:%02d", (time < 0 ? "-" : ""), minutes, seconds);385 }386 387 369 void RenderMedia::updateTimeDisplay() 388 370 { … … 392 374 float duration = mediaElement()->duration(); 393 375 394 String timeString = formatTime(now); 395 ExceptionCode ec; 396 m_currentTimeDisplay->setInnerText(timeString, ec); 397 398 timeString = formatTime(now - duration); 399 m_timeRemainingDisplay->setInnerText(timeString, ec); 376 m_currentTimeDisplay->setCurrentValue(now); 377 m_timeRemainingDisplay->setCurrentValue(now - duration); 400 378 } 401 379 -
trunk/WebCore/rendering/RenderMedia.h
r46815 r47110 60 60 HTMLMediaElement* mediaElement() const; 61 61 MediaPlayer* player() const; 62 63 static String formatTime(float time);64 62 65 63 bool shouldShowTimeDisplayControls() const; -
trunk/WebKit/ChangeLog
r46876 r47110 1 2009-08-12 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 <video> and <audio> controller should be accessible 6 https://bugs.webkit.org/show_bug.cgi?id=28081 7 8 Add localized strings for media controller accessiblility. 9 10 * English.lproj/Localizable.strings: 11 1 12 2009-08-06 Mark Rowe <mrowe@apple.com> 2 13 -
trunk/WebKit/English.lproj/Localizable.strings
r45484 r47110 227 227 "Paste Ruler (Undo action name)" = "Paste Ruler"; 228 228 229 /* accessibility help text for enter fullscreen button */ 230 "Play movie in fullscreen mode" = "Play movie in fullscreen mode"; 231 229 232 /* WebKitErrorPlugInCancelledConnection description */ 230 233 "Plug-in cancelled" = "Plug-in cancelled"; … … 443 446 "activate" = "activate"; 444 447 448 /* accessibility role description for audio element controller */ 449 "audio element controller" = "audio element controller"; 450 451 /* accessibility role description for audio element controller */ 452 "audio element playback controls and status display" = "audio element playback controls and status display"; 453 454 /* accessibility role description for seek back 30 seconds button */ 455 "back 30 seconds" = "back 30 seconds"; 456 445 457 /* HTTP result code string */ 446 458 "bad gateway" = "bad gateway"; … … 448 460 /* HTTP result code string */ 449 461 "bad request" = "bad request"; 462 463 /* accessibility help text for play button */ 464 "begin playback" = "begin playback"; 450 465 451 466 /* Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility */ … … 464 479 "created" = "created"; 465 480 481 /* accessibility help text for movie status display */ 482 "current movie status" = "current movie status"; 483 484 /* accessibility help text for elapsed time display */ 485 "current movie time in seconds" = "current movie time in seconds"; 486 487 /* string for days, hours, minutes & seconds */ 488 "date.format.for.days" = "date.format.for.days"; 489 490 /* string for hours, minutes & seconds */ 491 "date.format.for.hours" = "date.format.for.hours"; 492 493 /* string for minutes & seconds */ 494 "date.format.for.minutes" = "date.format.for.minutes"; 495 496 /* string for seconds */ 497 "date.format.for.seconds" = "date.format.for.seconds"; 498 466 499 /* definition phrase */ 467 500 "definition" = "definition"; 468 501 502 /* accessibility role description for elapsed time display */ 503 "elapsed time" = "elapsed time"; 504 469 505 /* HTTP result code string */ 470 506 "expectation failed" = "expectation failed"; 471 507 508 /* accessibility role description for fast forward button */ 509 "fast forward" = "fast forward"; 510 511 /* accessibility role description for fast reverse button */ 512 "fast reverse" = "fast reverse"; 513 472 514 /* HTTP result code string */ 473 515 "forbidden" = "forbidden"; … … 475 517 /* HTTP result code string */ 476 518 "found" = "found"; 519 520 /* accessibility role description for enter fullscreen button */ 521 "fullscreen" = "fullscreen"; 477 522 478 523 /* HTTP result code string */ … … 485 530 "image map" = "image map"; 486 531 532 /* string for an indefinite movie time */ 533 "indefinite time" = "indefinite time"; 534 487 535 /* HTTP result code string */ 488 536 "informational" = "informational"; … … 509 557 "moved permanently" = "moved permanently"; 510 558 559 /* accessibility role description for timeline slider */ 560 "movie time" = "movie time"; 561 562 /* accessibility help text for timeline slider */ 563 "movie time scrubber" = "movie time scrubber"; 564 565 /* accessibility help text for timeline slider thumb */ 566 "movie time scrubber thumb" = "movie time scrubber thumb"; 567 511 568 /* HTTP result code string */ 512 569 "multiple choices" = "multiple choices"; 570 571 /* accessibility role description for mute button */ 572 "mute" = "mute"; 573 574 /* accessibility help text for mute button */ 575 "mute audio tracks" = "mute audio tracks"; 513 576 514 577 /* HTTP result code string */ … … 536 599 "not modified" = "not modified"; 537 600 601 /* accessibility help text for remaining time display */ 602 "number of seconds of movie remaining" = "number of seconds of movie remaining"; 603 538 604 /* HTTP result code string */ 539 605 "partial content" = "partial content"; 540 606 607 /* accessibility role description for pause button */ 608 "pause" = "pause"; 609 610 /* accessibility help text for pause button */ 611 "pause playback" = "pause playback"; 612 541 613 /* HTTP result code string */ 542 614 "payment required" = "payment required"; 615 616 /* accessibility role description for play button */ 617 "play" = "play"; 543 618 544 619 /* HTTP result code string */ … … 554 629 "redirected" = "redirected"; 555 630 631 /* accessibility role description for time remaining display */ 632 "remaining time" = "remaining time"; 633 556 634 /* HTTP result code string */ 557 635 "request timed out" = "request timed out"; … … 569 647 "reset content" = "reset content"; 570 648 649 /* accessibility help text for return streaming movie to real time button */ 650 "return streaming movie to real time" = "return streaming movie to real time"; 651 652 /* accessibility role description for return to real time button */ 653 "return to realtime" = "return to realtime"; 654 571 655 /* HTTP result code string */ 572 656 "see other" = "see other"; 657 658 /* accessibility help text for jump back 30 seconds button */ 659 "seek movie back 30 seconds" = "seek movie back 30 seconds"; 660 661 /* accessibility help text for fast rewind button */ 662 "seek quickly back" = "seek quickly back"; 663 664 /* accessibility help text for fast forward button */ 665 "seek quickly forward" = "seek quickly forward"; 573 666 574 667 /* Verb stating the action that will occur when a radio button is clicked, as used by accessibility */ … … 581 674 "service unavailable" = "service unavailable"; 582 675 676 /* accessibility role description for movie status */ 677 "status" = "status"; 678 583 679 /* HTTP result code string */ 584 680 "success" = "success"; … … 593 689 "term" = "term"; 594 690 691 /* accessibility role description for timeline thumb */ 692 "timeline slider thumb" = "timeline slider thumb"; 693 595 694 /* HTTP result code string */ 596 695 "unacceptable" = "unacceptable"; … … 608 707 "unknown" = "unknown"; 609 708 709 /* accessibility role description for turn mute off button */ 710 "unmute" = "unmute"; 711 712 /* accessibility help text for un mute button */ 713 "unmute audio tracks" = "unmute audio tracks"; 714 610 715 /* HTTP result code string */ 611 716 "unsupported media type" = "unsupported media type"; … … 613 718 /* HTTP result code string */ 614 719 "unsupported version" = "unsupported version"; 720 721 /* accessibility role description for video element controller */ 722 "video element controller" = "video element controller"; 723 724 /* accessibility role description for video element controller */ 725 "video element playback controls and status display" = "video element playback controls and status display"; 615 726 616 727 /* accessibility role description for web area */ -
trunk/WebKit/mac/ChangeLog
r47056 r47110 1 2009-08-12 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 <video> and <audio> controller should be accessible 6 https://bugs.webkit.org/show_bug.cgi?id=28081 7 8 * WebCoreSupport/WebViewFactory.mm: 9 (-[WebViewFactory localizedMediaControlElementString:]): 10 (-[WebViewFactory localizedMediaControlElementHelpText:]): 11 (-[WebViewFactory localizedMediaTimeDescription:]): 12 New. 13 1 14 2009-08-11 John Gregg <johnnyg@google.com> 2 15 -
trunk/WebKit/mac/WebCoreSupport/WebViewFactory.mm
r45484 r47110 1 1 /* 2 * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.2 * Copyright (C) 2005, 2009 Apple Computer, Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 609 609 } 610 610 611 - (NSString*)localizedMediaControlElementString:(NSString*)name 612 { 613 if ([name isEqualToString:@"AudioElement"]) 614 return UI_STRING("audio element controller", "accessibility role description for audio element controller"); 615 if ([name isEqualToString:@"VideoElement"]) 616 return UI_STRING("video element controller", "accessibility role description for video element controller"); 617 618 if ([name isEqualToString:@"MuteButton"]) 619 return UI_STRING("mute", "accessibility role description for mute button"); 620 if ([name isEqualToString:@"UnMuteButton"]) 621 return UI_STRING("unmute", "accessibility role description for turn mute off button"); 622 if ([name isEqualToString:@"PlayButton"]) 623 return UI_STRING("play", "accessibility role description for play button"); 624 if ([name isEqualToString:@"PauseButton"]) 625 return UI_STRING("pause", "accessibility role description for pause button"); 626 if ([name isEqualToString:@"Slider"]) 627 return UI_STRING("movie time", "accessibility role description for timeline slider"); 628 if ([name isEqualToString:@"SliderThumb"]) 629 return UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb"); 630 if ([name isEqualToString:@"RewindButton"]) 631 return UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button"); 632 if ([name isEqualToString:@"ReturnToRealtimeButton"]) 633 return UI_STRING("return to realtime", "accessibility role description for return to real time button"); 634 if ([name isEqualToString:@"CurrentTimeDisplay"]) 635 return UI_STRING("elapsed time", "accessibility role description for elapsed time display"); 636 if ([name isEqualToString:@"TimeRemainingDisplay"]) 637 return UI_STRING("remaining time", "accessibility role description for time remaining display"); 638 if ([name isEqualToString:@"StatusDisplay"]) 639 return UI_STRING("status", "accessibility role description for movie status"); 640 if ([name isEqualToString:@"FullscreenButton"]) 641 return UI_STRING("fullscreen", "accessibility role description for enter fullscreen button"); 642 if ([name isEqualToString:@"SeekForwardButton"]) 643 return UI_STRING("fast forward", "accessibility role description for fast forward button"); 644 if ([name isEqualToString:@"SeekBackButton"]) 645 return UI_STRING("fast reverse", "accessibility role description for fast reverse button"); 646 ASSERT_NOT_REACHED(); 647 return @""; 648 } 649 650 - (NSString*)localizedMediaControlElementHelpText:(NSString*)name 651 { 652 if ([name isEqualToString:@"AudioElement"]) 653 return UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller"); 654 if ([name isEqualToString:@"VideoElement"]) 655 return UI_STRING("video element playback controls and status display", "accessibility role description for video element controller"); 656 657 if ([name isEqualToString:@"MuteButton"]) 658 return UI_STRING("mute audio tracks", "accessibility help text for mute button"); 659 if ([name isEqualToString:@"UnMuteButton"]) 660 return UI_STRING("unmute audio tracks", "accessibility help text for un mute button"); 661 if ([name isEqualToString:@"PlayButton"]) 662 return UI_STRING("begin playback", "accessibility help text for play button"); 663 if ([name isEqualToString:@"PauseButton"]) 664 return UI_STRING("pause playback", "accessibility help text for pause button"); 665 if ([name isEqualToString:@"Slider"]) 666 return UI_STRING("movie time scrubber", "accessibility help text for timeline slider"); 667 if ([name isEqualToString:@"SliderThumb"]) 668 return UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb"); 669 if ([name isEqualToString:@"RewindButton"]) 670 return UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button"); 671 if ([name isEqualToString:@"ReturnToRealtimeButton"]) 672 return UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button"); 673 if ([name isEqualToString:@"CurrentTimeDisplay"]) 674 return UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display"); 675 if ([name isEqualToString:@"TimeRemainingDisplay"]) 676 return UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display"); 677 if ([name isEqualToString:@"StatusDisplay"]) 678 return UI_STRING("current movie status", "accessibility help text for movie status display"); 679 if ([name isEqualToString:@"SeekBackButton"]) 680 return UI_STRING("seek quickly back", "accessibility help text for fast rewind button"); 681 if ([name isEqualToString:@"SeekForwardButton"]) 682 return UI_STRING("seek quickly forward", "accessibility help text for fast forward button"); 683 if ([name isEqualToString:@"FullscreenButton"]) 684 return UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button"); 685 ASSERT_NOT_REACHED(); 686 return @""; 687 } 688 689 - (NSString*)localizedMediaTimeDescription:(float)time 690 { 691 if (!isfinite(time)) 692 return UI_STRING("indefinite time", "string for an indefinite movie time"); 693 694 int seconds = (int)fabsf(time); 695 int days = seconds / (60 * 60 * 24); 696 int hours = seconds / (60 * 60); 697 int minutes = (seconds / 60) % 60; 698 seconds %= 60; 699 700 if (days) 701 return [NSString stringWithFormat:UI_STRING("date.format.for.days", "string for days, hours, minutes & seconds"), days, hours, minutes, seconds]; 702 else if (hours) 703 return [NSString stringWithFormat:UI_STRING("date.format.for.hours", "string for hours, minutes & seconds"), hours, minutes, seconds]; 704 else if (minutes) 705 return [NSString stringWithFormat:UI_STRING("date.format.for.minutes", "string for minutes & seconds"), minutes, seconds]; 706 707 return [NSString stringWithFormat:UI_STRING("date.format.for.seconds", "string for seconds"), seconds]; 708 } 709 611 710 @end -
trunk/WebKit/win/ChangeLog
r47084 r47110 1 2009-08-12 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 <video> and <audio> controller should be accessible 6 https://bugs.webkit.org/show_bug.cgi?id=28081 7 8 * WebCoreLocalizedStrings.cpp: 9 (WebCore::localizedMediaControlElementString): 10 (WebCore::localizedMediaControlElementHelpText): 11 (WebCore::localizedMediaTimeDescription): 12 New. 13 1 14 2009-08-11 John Gregg <johnnyg@google.com> 2 15 -
trunk/WebKit/win/WebCoreLocalizedStrings.cpp
r46245 r47110 115 115 return result.get(); 116 116 } 117 118 String WebCore::localizedMediaControlElementString(const String& name) 119 { 120 if (name == "AudioElement") 121 return String(LPCTSTR_UI_STRING("audio element controller", "accessibility role description for audio element controller")); 122 if (name == "VideoElement") 123 return String(LPCTSTR_UI_STRING("video element controller", "accessibility role description for video element controller")); 124 if (name == "MuteButton") 125 return String(LPCTSTR_UI_STRING("mute", "accessibility role description for mute button")); 126 if (name == "UnMuteButton") 127 return String(LPCTSTR_UI_STRING("unmute", "accessibility role description for turn mute off button")); 128 if (name == "PlayButton") 129 return String(LPCTSTR_UI_STRING("play", "accessibility role description for play button")); 130 if (name == "PauseButton") 131 return String(LPCTSTR_UI_STRING("pause", "accessibility role description for pause button")); 132 if (name == "Slider") 133 return String(LPCTSTR_UI_STRING("movie time", "accessibility role description for timeline slider")); 134 if (name == "SliderThumb") 135 return String(LPCTSTR_UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb")); 136 if (name == "RewindButton") 137 return String(LPCTSTR_UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button")); 138 if (name == "ReturnToRealtimeButton") 139 return String(LPCTSTR_UI_STRING("return to realtime", "accessibility role description for return to real time button")); 140 if (name == "CurrentTimeDisplay") 141 return String(LPCTSTR_UI_STRING("elapsed time", "accessibility role description for elapsed time display")); 142 if (name == "TimeRemainingDisplay") 143 return String(LPCTSTR_UI_STRING("remaining time", "accessibility role description for time remaining display")); 144 if (name == "StatusDisplay") 145 return String(LPCTSTR_UI_STRING("status", "accessibility role description for movie status")); 146 if (name == "FullscreenButton") 147 return String(LPCTSTR_UI_STRING("fullscreen", "accessibility role description for enter fullscreen button")); 148 if (name == "SeekForwardButton") 149 return String(LPCTSTR_UI_STRING("fast forward", "accessibility role description for fast forward button")); 150 if (name == "SeekBackButton") 151 return String(LPCTSTR_UI_STRING("fast reverse", "accessibility role description for fast reverse button")); 152 153 ASSERT_NOT_REACHED(); 154 return String(); 155 } 156 157 String WebCore::localizedMediaControlElementHelpText(const String& name) 158 { 159 if (name == "AudioElement") 160 return String(LPCTSTR_UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller")); 161 if (name == "VideoElement") 162 return String(LPCTSTR_UI_STRING("video element playback controls and status display", "accessibility role description for video element controller")); 163 if (name == "MuteButton") 164 return String(LPCTSTR_UI_STRING("mute audio tracks", "accessibility help text for mute button")); 165 if (name == "UnMuteButton") 166 return String(LPCTSTR_UI_STRING("unmute audio tracks", "accessibility help text for un mute button")); 167 if (name == "PlayButton") 168 return String(LPCTSTR_UI_STRING("begin playback", "accessibility help text for play button")); 169 if (name == "PauseButton") 170 return String(LPCTSTR_UI_STRING("pause playback", "accessibility help text for pause button")); 171 if (name == "Slider") 172 return String(LPCTSTR_UI_STRING("movie time scrubber", "accessibility help text for timeline slider")); 173 if (name == "SliderThumb") 174 return String(LPCTSTR_UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb")); 175 if (name == "RewindButton") 176 return String(LPCTSTR_UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button")); 177 if (name == "ReturnToRealtimeButton") 178 return String(LPCTSTR_UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button")); 179 if (name == "CurrentTimeDisplay") 180 return String(LPCTSTR_UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display")); 181 if (name == "TimeRemainingDisplay") 182 return String(LPCTSTR_UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display")); 183 if (name == "StatusDisplay") 184 return String(LPCTSTR_UI_STRING("current movie status", "accessibility help text for movie status display")); 185 if (name == "SeekBackButton") 186 return String(LPCTSTR_UI_STRING("seek quickly back", "accessibility help text for fast rewind button")); 187 if (name == "SeekForwardButton") 188 return String(LPCTSTR_UI_STRING("seek quickly forward", "accessibility help text for fast forward button")); 189 if (name == "FullscreenButton") 190 return String(LPCTSTR_UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button")); 191 192 ASSERT_NOT_REACHED(); 193 return String(); 194 } 195 196 String WebCore::localizedMediaTimeDescription(float time) 197 { 198 if (!isfinite(time)) 199 return return String(LPCTSTR_UI_STRING("indefinite time", "string for an indefinite movie time")); 200 201 int seconds = (int)fabsf(time); 202 int days = seconds / (60 * 60 * 24); 203 int hours = seconds / (60 * 60); 204 int minutes = (seconds / 60) % 60; 205 seconds %= 60; 206 207 if (days) { 208 static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("date.format.for.days", "string for days, hours, minutes & seconds")); 209 RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), days, hours, minutes, seconds)); 210 return result.get(); 211 } 212 else if (hours) { 213 static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("date.format.for.hours", "string for hours, minutes & seconds")); 214 RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), hours, minutes, seconds)); 215 return result.get(); 216 } 217 else if (minutes) { 218 static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("date.format.for.minutes", "string for minutes & seconds")); 219 RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), minutes, seconds)); 220 return result.get(); 221 } 222 223 static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("date.format.for.seconds", "string for seconds")); 224 RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), seconds)); 225 return result.get(); 226 } 227
Note: See TracChangeset
for help on using the changeset viewer.