Changeset 207436 in webkit
- Timestamp:
- Oct 17, 2016 3:03:16 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 10 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207435 r207436 1 2016-10-17 Antoine Quint <graouts@apple.com> 2 3 [Modern Media Controls] Basic MediaController 4 https://bugs.webkit.org/show_bug.cgi?id=163539 5 <rdar://problem/28797542> 6 7 Reviewed by Darin Adler. 8 9 Testing the properties of the new MediaController class and the availability and behavior of the 10 createControls() global function. 11 12 * media/modern-media-controls/media-controller/media-controller-click-to-start-expected.txt: Added. 13 * media/modern-media-controls/media-controller/media-controller-click-to-start.html: Added. 14 * media/modern-media-controls/media-controller/media-controller-constructor-expected.txt: Added. 15 * media/modern-media-controls/media-controller/media-controller-constructor.html: Added. 16 * media/modern-media-controls/media-controller/media-controller-resize-expected.txt: Added. 17 * media/modern-media-controls/media-controller/media-controller-resize.html: Added. 18 1 19 2016-10-17 Michael Catanzaro <mcatanzaro@igalia.com> 2 20 -
trunk/Source/WebCore/ChangeLog
r207431 r207436 1 2016-10-17 Antoine Quint <graouts@apple.com> 2 3 [Modern Media Controls] Basic MediaController 4 https://bugs.webkit.org/show_bug.cgi?id=163539 5 <rdar://problem/28797542> 6 7 Reviewed by Darin Adler. 8 9 We add a new main.js file which acts as the entry point by implementing the createControls() 10 function that HTMLMediaElement::ensureMediaControlsInjectedScript() once the shadow root has 11 been created. That functions creates an instance of the new MediaController class, which is 12 the controller object that will handle communication between the media controls and the media 13 element. At first, this MediaController class is very limited and assumes macOS inline 14 layout traits and forces a start button to be shown over the media, which can be played 15 to start the media and show the full controls. More functionality will be added by future patches. 16 17 Tests: media/modern-media-controls/media-controller/media-controller-click-to-start.html 18 media/modern-media-controls/media-controller/media-controller-constructor.html 19 media/modern-media-controls/media-controller/media-controller-resize.html 20 21 * Modules/modern-media-controls/main.js: Added. 22 (createControls): 23 * Modules/modern-media-controls/media/media-controller.js: Added. 24 (MediaController): 25 (MediaController.prototype.set pageScaleFactor): 26 (MediaController.prototype.set usesLTRUserInterfaceLayoutDirection): 27 (MediaController.prototype.handleEvent): 28 (MediaController.prototype.buttonWasClicked): 29 (MediaController.prototype._updateControlsSize): 30 * WebCore.xcodeproj/project.pbxproj: 31 * rendering/RenderThemeMac.mm: 32 (WebCore::RenderThemeMac::mediaControlsStyleSheet): 33 (WebCore::RenderThemeMac::mediaControlsScript): 34 1 35 2016-10-17 Anders Carlsson <andersca@apple.com> 2 36 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r207420 r207436 7316 7316 0F4966A11DB4090100A274BB /* DOMPointInit.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = DOMPointInit.idl; sourceTree = "<group>"; }; 7317 7317 0F4966A21DB4091000A274BB /* DOMPointInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMPointInit.h; sourceTree = "<group>"; }; 7318 0F4966A41DB40C4300A274BB /* JSDOMPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMPoint.cpp;path = JSDOMPoint.cpp; sourceTree = "<group>"; };7319 0F4966A51DB40C4300A274BB /* JSDOMPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSDOMPoint.h;path = JSDOMPoint.h; sourceTree = "<group>"; };7320 0F4966A61DB40C4300A274BB /* JSDOMPointInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMPointInit.cpp;path = JSDOMPointInit.cpp; sourceTree = "<group>"; };7321 0F4966A71DB40C4300A274BB /* JSDOMPointInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSDOMPointInit.h;path = JSDOMPointInit.h; sourceTree = "<group>"; };7322 0F4966A81DB40C4300A274BB /* JSDOMPointReadOnly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMPointReadOnly.cpp;path = JSDOMPointReadOnly.cpp; sourceTree = "<group>"; };7323 0F4966A91DB40C4300A274BB /* JSDOMPointReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSDOMPointReadOnly.h;path = JSDOMPointReadOnly.h; sourceTree = "<group>"; };7318 0F4966A41DB40C4300A274BB /* JSDOMPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMPoint.cpp; sourceTree = "<group>"; }; 7319 0F4966A51DB40C4300A274BB /* JSDOMPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMPoint.h; sourceTree = "<group>"; }; 7320 0F4966A61DB40C4300A274BB /* JSDOMPointInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMPointInit.cpp; sourceTree = "<group>"; }; 7321 0F4966A71DB40C4300A274BB /* JSDOMPointInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMPointInit.h; sourceTree = "<group>"; }; 7322 0F4966A81DB40C4300A274BB /* JSDOMPointReadOnly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMPointReadOnly.cpp; sourceTree = "<group>"; }; 7323 0F4966A91DB40C4300A274BB /* JSDOMPointReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMPointReadOnly.h; sourceTree = "<group>"; }; 7324 7324 0F4E57161313276200CF85AF /* RenderSVGAllInOne.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGAllInOne.cpp; sourceTree = "<group>"; }; 7325 7325 0F54DCCC1880C6AB003EEDBB /* ios-encodings.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = "ios-encodings.txt"; sourceTree = "<group>"; }; … … 9789 9789 71C916071D1483A300ACA47D /* UserInterfaceLayoutDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInterfaceLayoutDirection.h; sourceTree = "<group>"; }; 9790 9790 71CC7A1F152A0BFE009EEAF9 /* SVGAnimatedEnumeration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedEnumeration.cpp; sourceTree = "<group>"; }; 9791 71D02D901DB55C4E00DD5CF5 /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = main.js; sourceTree = "<group>"; }; 9792 71D02D921DB55C4E00DD5CF5 /* media-controller.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "media-controller.js"; sourceTree = "<group>"; }; 9791 9793 71D6AA711DA4EAF700B23969 /* airplay-placard@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "airplay-placard@1x.png"; sourceTree = "<group>"; }; 9792 9794 71D6AA721DA4EAF700B23969 /* airplay-placard@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "airplay-placard@2x.png"; sourceTree = "<group>"; }; … … 17669 17671 sourceTree = SOURCE_ROOT; 17670 17672 }; 17673 71D02D911DB55C4E00DD5CF5 /* media */ = { 17674 isa = PBXGroup; 17675 children = ( 17676 71D02D921DB55C4E00DD5CF5 /* media-controller.js */, 17677 ); 17678 path = media; 17679 sourceTree = "<group>"; 17680 }; 17671 17681 71D6AA391DA4EAF700B23969 /* modern-media-controls */ = { 17672 17682 isa = PBXGroup; 17673 17683 children = ( 17684 71D02D901DB55C4E00DD5CF5 /* main.js */, 17674 17685 716FA0D71DB26591007323CC /* controls */, 17675 17686 71D6AA6F1DA4EAF700B23969 /* images */, 17687 71D02D911DB55C4E00DD5CF5 /* media */, 17676 17688 ); 17677 17689 path = "modern-media-controls"; -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r207423 r207436 238 238 StringBuilder styleSheetBuilder; 239 239 if (RuntimeEnabledFeatures::sharedFeatures().modernMediaControlsEnabled()) { 240 NSArray *paths = @[@"airplay-button", @"button", @"buttons-container", @"icon-button", @"macos-inline-media-controls", @"media-controls", @"placard", @"scrubber", @"slider", @"start-button", @"time-label", @"volume-slider"];241 for (NSString *path in paths)240 NSArray *paths = @[@"airplay-button", @"button", @"buttons-container", @"icon-button", @"macos-inline-media-controls", @"media-controls", @"placard", @"scrubber", @"slider", @"start-button", @"time-label", @"volume-slider"]; 241 for (NSString *path in paths) 242 242 styleSheetBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:path ofType:@"css" inDirectory:@"modern-media-controls/controls"] encoding:NSUTF8StringEncoding error:nil]); 243 243 } else … … 256 256 if (m_mediaControlsScript.isEmpty()) { 257 257 StringBuilder scriptBuilder; 258 NSBundle *bundle = [NSBundle bundleForClass:[WebCoreRenderThemeBundle class]];258 NSBundle *bundle = [NSBundle bundleForClass:[WebCoreRenderThemeBundle class]]; 259 259 if (RuntimeEnabledFeatures::sharedFeatures().modernMediaControlsEnabled()) { 260 NSArray *controlsPaths = @[@"scheduler", @"layout-node", @"layout-item", @"icon-service", @"time-control", @"time-label", @"slider", @"volume-slider", @"scrubber", @"button", @"start-button", @"icon-button", @"play-pause-button", @"skip-back-button", @"mute-button", @"airplay-button", @"pip-button", @"tracks-button", @"fullscreen-button", @"aspect-ratio-button", @"rewind-button", @"forward-button", @"media-controls", @"macos-media-controls", @"macos-inline-media-controls", @"buttons-container", @"placard", @"airplay-placard", @"pip-placard"];261 for (NSString *path in controlsPaths)260 NSArray *controlsPaths = @[@"scheduler", @"layout-node", @"layout-item", @"icon-service", @"time-control", @"time-label", @"slider", @"volume-slider", @"scrubber", @"button", @"start-button", @"icon-button", @"play-pause-button", @"skip-back-button", @"mute-button", @"airplay-button", @"pip-button", @"tracks-button", @"fullscreen-button", @"aspect-ratio-button", @"rewind-button", @"forward-button", @"media-controls", @"macos-media-controls", @"macos-inline-media-controls", @"buttons-container", @"placard", @"airplay-placard", @"pip-placard"]; 261 for (NSString *path in controlsPaths) 262 262 scriptBuilder.append([NSString stringWithContentsOfFile:[bundle pathForResource:path ofType:@"js" inDirectory:@"modern-media-controls/controls"] encoding:NSUTF8StringEncoding error:nil]); 263 scriptBuilder.append([NSString stringWithContentsOfFile:[bundle pathForResource:@"media-controller" ofType:@"js" inDirectory:@"modern-media-controls/media"] encoding:NSUTF8StringEncoding error:nil]); 264 scriptBuilder.append([NSString stringWithContentsOfFile:[bundle pathForResource:@"main" ofType:@"js" inDirectory:@"modern-media-controls"] encoding:NSUTF8StringEncoding error:nil]); 263 265 } else { 264 266 scriptBuilder.append([NSString stringWithContentsOfFile:[bundle pathForResource:@"mediaControlsLocalizedStrings" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]);
Note: See TracChangeset
for help on using the changeset viewer.