Rename TextTrackRepresentationiOS to TextTrackRepresentationCocoa and enable on Mac
authoradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Apr 2016 20:04:16 +0000 (20:04 +0000)
committeradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Apr 2016 20:04:16 +0000 (20:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=156245

Reviewed by Eric Carlson.

Source/WebCore:

* Modules/mediacontrols/mediaControlsApple.css:
(::-webkit-media-controls):
Match iOS and specify overflow: hidden on the -webkit-media-controls container.
(video::-webkit-media-text-track-container):
Match iOS and specify z-index: 0 on the text track container.

* WebCore.xcodeproj/project.pbxproj:
TextTrackRepresentationiOS.h/mm have been renamed to TextTrackRepresentationCocoa.h/mm.

* platform/graphics/TextTrackRepresentation.cpp:
* platform/graphics/cocoa/TextTrackRepresentationCocoa.h: Renamed from Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.h.
* platform/graphics/cocoa/TextTrackRepresentationCocoa.mm: Renamed from Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.mm.
(-[WebCoreTextTrackRepresentationCocoaHelper initWithParent:]):
(-[WebCoreTextTrackRepresentationCocoaHelper dealloc]):
(-[WebCoreTextTrackRepresentationCocoaHelper setParent:]):
(-[WebCoreTextTrackRepresentationCocoaHelper parent]):
(-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
(-[WebCoreTextTrackRepresentationCocoaHelper actionForLayer:forKey:]):
(TextTrackRepresentation::create):
(TextTrackRepresentationCocoa::TextTrackRepresentationCocoa):
(TextTrackRepresentationCocoa::~TextTrackRepresentationCocoa):
(TextTrackRepresentationCocoa::update):
(TextTrackRepresentationCocoa::setContentScale):
(TextTrackRepresentationCocoa::bounds):

LayoutTests:

* platform/mac/TestExpectations:
Skip some tests with assertions after changes in MediaControlsApple.css.

* platform/mac/media/media-document-audio-repaint-expected.txt:
* platform/mac/media/video-zoom-controls-expected.txt:
Rebaseline some tests after changes in MediaControlsApple.css.

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

LayoutTests/ChangeLog
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/mac/media/media-document-audio-repaint-expected.txt
LayoutTests/platform/mac/media/video-zoom-controls-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediacontrols/mediaControlsApple.css
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/graphics/TextTrackRepresentation.cpp
Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.h [moved from Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.h with 74% similarity]
Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm [moved from Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.mm with 70% similarity]

index 88eabd6..34a703b 100644 (file)
@@ -1,3 +1,17 @@
+2016-04-06  Ada Chan  <adachan@apple.com>
+
+        Rename TextTrackRepresentationiOS to TextTrackRepresentationCocoa and enable on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=156245
+
+        Reviewed by Eric Carlson.
+
+        * platform/mac/TestExpectations:
+        Skip some tests with assertions after changes in MediaControlsApple.css.
+
+        * platform/mac/media/media-document-audio-repaint-expected.txt:
+        * platform/mac/media/video-zoom-controls-expected.txt:
+        Rebaseline some tests after changes in MediaControlsApple.css.
+
 2016-04-07  Daniel Bates  <dabates@apple.com>
 
         CSP: Remove tests for unimplemented directive referrer
index 0a6b780..472119f 100644 (file)
@@ -1326,3 +1326,13 @@ webkit.org/b/156112 [ ElCapitan ] media/controls-strict.html [ Pass Failure ]
 webkit.org/b/156112 [ ElCapitan ] media/controls-without-preload.html [ Pass Failure ]
 
 webkit.org/b/156351 storage/indexeddb/modern/autoincrement-abort-private.html [ Pass Timeout ]
+
+webkit.org/b/156320 fast/regions/inline-block-inside-anonymous-overflow.html [ ImageOnlyFailure ]
+
+# Assertions in FrameView::scheduleRelayoutOfSubtree()
+webkit.org/b/156349 [ Debug ] http/tests/appcache/video.html [ Skip ]
+webkit.org/b/156349 [ Debug ] media/track/track-active-cues.html [ Skip ]
+webkit.org/b/156349 [ Debug ] media/track/track-in-band.html [ Skip ]
+webkit.org/b/156349 [ Debug ] media/track/video-track-alternate-groups.html [ Skip ]
+webkit.org/b/156349 [ Debug ] media/track/video-track.html [ Skip ]
+webkit.org/b/156349 [ Debug ] media/video-src-empty.html [ Skip ]
index e4ef90c..ee853a5 100644 (file)
@@ -21,38 +21,13 @@ layer at (8,42) size 384x334
       RenderVideo {VIDEO} at (40,164) size 300x2
     layer at (40,165) size 300x1
       RenderFlexibleBox {DIV} at (0,0) size 300x1
-    layer at (40,121) size 300x45
+    layer at (40,121) size 300x45 backgroundClip at (40,165) size 300x1 clip at (40,165) size 300x1
       RenderFlexibleBox {DIV} at (0,-44) size 300x45
-    layer at (40,121) size 300x45 isolatesBlending
+    layer at (40,121) size 300x45 backgroundClip at (40,165) size 300x1 clip at (40,165) size 300x1 isolatesBlending
       RenderBlock (positioned) {DIV} at (0,0) size 300x45
-    layer at (40,121) size 300x45
+    layer at (40,121) size 300x45 backgroundClip at (40,165) size 300x1 clip at (40,165) size 300x1
       RenderBlock (positioned) {DIV} at (0,0) size 300x45 [bgcolor=#1E1E1E73]
-    layer at (40,121) size 300x45 blendMode: lighten
+    layer at (40,121) size 300x45 backgroundClip at (40,165) size 300x1 clip at (40,165) size 300x1 blendMode: lighten
       RenderBlock (positioned) {DIV} at (0,0) size 300x45 [bgcolor=#292929]
-    layer at (48,146) size 12x15 blendMode: plus-lighter
-      RenderButton {BUTTON} at (8,25) size 12x15 [color=#FFFFFF]
-    layer at (76,145) size 16x15 blendMode: plus-lighter
-      RenderButton {BUTTON} at (36,24) size 16x16 [color=#FFFFFF]
-    layer at (100,145) size 210x17
-      RenderFlexibleBox {DIV} at (60,24) size 210x17
-    layer at (108,146) size 32x13 blendMode: plus-lighter
-      RenderFlexibleBox {DIV} at (8,2) size 32x13 [color=#FFFFFF]
-        RenderBlock (anonymous) at (2,0) size 30x13
-          RenderText {#text} at (0,0) size 30x13
-            text run at (0,0) width 30: "00:00"
-    layer at (150,145) size 105x17
-      RenderFlexibleBox {DIV} at (50,0) size 105x17
-    layer at (150,145) size 105x17 blendMode: plus-lighter
-      RenderSlider {INPUT} at (0,0) size 105x17 [color=#909090]
-        RenderFlexibleBox {DIV} at (0,0) size 105x17
-          RenderBlock {DIV} at (0,1) size 105x15
-            RenderBlock {DIV} at (50,0) size 4x15
-    layer at (265,146) size 37x13 blendMode: plus-lighter
-      RenderFlexibleBox {DIV} at (165,2) size 37x13 [color=#FFFFFF]
-        RenderBlock (anonymous) at (0,0) size 35x13
-          RenderText {#text} at (0,0) size 35x13
-            text run at (0,0) width 35: "-00:00"
-    layer at (318,141) size 14x25
+    layer at (318,141) size 14x25 backgroundClip at (40,165) size 300x1 clip at (40,165) size 300x1
       RenderFlexibleBox {DIV} at (278,20) size 14x25
-    layer at (318,146) size 14x15 blendMode: plus-lighter
-      RenderButton {BUTTON} at (0,5) size 14x15 [color=#FFFFFF]
index 4492c85..10de90e 100644 (file)
@@ -12,17 +12,17 @@ layer at (57,85) size 240x180
   RenderFlexibleBox {DIV} at (0,0) size 240x180
 layer at (57,198) size 240x67
   RenderFlexibleBox {DIV} at (0,112) size 240x68
-layer at (57,198) size 240x68 isolatesBlending
+layer at (57,198) size 240x68 backgroundClip at (57,85) size 240x180 clip at (57,85) size 240x180 isolatesBlending
   RenderBlock (positioned) {DIV} at (0,0) size 240x68
-layer at (57,198) size 240x68
+layer at (57,198) size 240x68 backgroundClip at (57,85) size 240x180 clip at (57,85) size 240x180
   RenderBlock (positioned) {DIV} at (0,0) size 240x68 [bgcolor=#1E1E1E73]
-layer at (57,198) size 240x68 blendMode: lighten
+layer at (57,198) size 240x68 backgroundClip at (57,85) size 240x180 clip at (57,85) size 240x180 blendMode: lighten
   RenderBlock (positioned) {DIV} at (0,0) size 240x68 [bgcolor=#292929]
 layer at (69,235) size 18x22 blendMode: plus-lighter
   RenderButton {BUTTON} at (12,37) size 18x23 [color=#FFFFFF]
 layer at (111,234) size 24x22 blendMode: plus-lighter
   RenderButton {BUTTON} at (54,36) size 24x24 [color=#FFFFFF]
-layer at (221,228) size 21x38
+layer at (221,228) size 21x38 backgroundClip at (57,85) size 240x180 clip at (57,85) size 240x180
   RenderFlexibleBox {DIV} at (163,30) size 22x38
 layer at (221,235) size 21x22 blendMode: plus-lighter
   RenderButton {BUTTON} at (0,7) size 21x23 [color=#FFFFFF]
@@ -32,21 +32,21 @@ layer at (57,310) size 240x180 isolatesBlending
   RenderVideo {VIDEO} at (45,298) size 240x180
 layer at (57,310) size 240x180
   RenderFlexibleBox {DIV} at (0,0) size 240x180
-layer at (57,423) size 240x67
+layer at (57,423) size 240x67 backgroundClip at (74,291) size 240x180 clip at (74,291) size 240x180
   RenderFlexibleBox {DIV} at (0,112) size 240x68
-layer at (57,423) size 240x68 isolatesBlending
+layer at (57,423) size 240x68 backgroundClip at (74,291) size 240x180 clip at (74,291) size 240x180 isolatesBlending
   RenderBlock (positioned) {DIV} at (0,0) size 240x68
-layer at (57,423) size 240x68
+layer at (57,423) size 240x68 backgroundClip at (74,291) size 240x180 clip at (74,291) size 240x180
   RenderBlock (positioned) {DIV} at (0,0) size 240x68 [bgcolor=#1E1E1E73]
-layer at (57,423) size 240x68 blendMode: lighten
+layer at (57,423) size 240x68 backgroundClip at (74,291) size 240x180 clip at (74,291) size 240x180 blendMode: lighten
   RenderBlock (positioned) {DIV} at (0,0) size 240x68 [bgcolor=#292929]
-layer at (69,460) size 18x22 blendMode: plus-lighter
+layer at (69,460) size 18x22 backgroundClip at (74,291) size 240x180 clip at (74,291) size 240x180 blendMode: plus-lighter
   RenderButton {BUTTON} at (12,37) size 18x23 [color=#FFFFFF]
-layer at (111,459) size 24x22 blendMode: plus-lighter
+layer at (111,459) size 24x22 backgroundClip at (74,291) size 240x180 clip at (74,291) size 240x180 blendMode: plus-lighter
   RenderButton {BUTTON} at (54,36) size 24x24 [color=#FFFFFF]
-layer at (221,453) size 21x38
+layer at (221,453) size 21x38 backgroundClip at (74,291) size 240x180 clip at (74,291) size 240x180
   RenderFlexibleBox {DIV} at (163,30) size 22x38
-layer at (221,460) size 21x22 blendMode: plus-lighter
+layer at (221,460) size 21x22 backgroundClip at (74,291) size 240x180 clip at (74,291) size 240x180 blendMode: plus-lighter
   RenderButton {BUTTON} at (0,7) size 21x23 [color=#FFFFFF]
-layer at (266,460) size 21x22 blendMode: plus-lighter
+layer at (266,460) size 21x22 backgroundClip at (74,291) size 240x180 clip at (74,291) size 240x180 blendMode: plus-lighter
   RenderButton {BUTTON} at (208,37) size 22x23 [color=#FFFFFF]
index 568d5e8..0d8036b 100644 (file)
@@ -1,3 +1,35 @@
+2016-04-05  Ada Chan  <adachan@apple.com>
+
+        Rename TextTrackRepresentationiOS to TextTrackRepresentationCocoa and enable on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=156245
+
+        Reviewed by Eric Carlson.
+
+        * Modules/mediacontrols/mediaControlsApple.css:
+        (::-webkit-media-controls):
+        Match iOS and specify overflow: hidden on the -webkit-media-controls container.
+        (video::-webkit-media-text-track-container):
+        Match iOS and specify z-index: 0 on the text track container.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        TextTrackRepresentationiOS.h/mm have been renamed to TextTrackRepresentationCocoa.h/mm.
+
+        * platform/graphics/TextTrackRepresentation.cpp:
+        * platform/graphics/cocoa/TextTrackRepresentationCocoa.h: Renamed from Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.h.
+        * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm: Renamed from Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.mm.
+        (-[WebCoreTextTrackRepresentationCocoaHelper initWithParent:]):
+        (-[WebCoreTextTrackRepresentationCocoaHelper dealloc]):
+        (-[WebCoreTextTrackRepresentationCocoaHelper setParent:]):
+        (-[WebCoreTextTrackRepresentationCocoaHelper parent]):
+        (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
+        (-[WebCoreTextTrackRepresentationCocoaHelper actionForLayer:forKey:]):
+        (TextTrackRepresentation::create):
+        (TextTrackRepresentationCocoa::TextTrackRepresentationCocoa):
+        (TextTrackRepresentationCocoa::~TextTrackRepresentationCocoa):
+        (TextTrackRepresentationCocoa::update):
+        (TextTrackRepresentationCocoa::setContentScale):
+        (TextTrackRepresentationCocoa::bounds):
+
 2016-04-07  Brian Burg  <bburg@apple.com>
 
         CookieJar should support adding synthetic cookies for developer tools
index d8eb786..625ef7d 100644 (file)
@@ -59,6 +59,7 @@ video:-webkit-full-page-media::-webkit-media-controls-panel.no-video {
     font: -webkit-small-control;
     white-space: nowrap;
     -webkit-font-smoothing: subpixel-antialiased;
+    overflow: hidden;
 }
 
 video::-webkit-media-text-track-container,
@@ -870,6 +871,7 @@ video::-webkit-media-text-track-container {
     width: 100%;
     overflow: hidden;
     padding-bottom: 5px;
+    z-index: 0;
 
     text-align: center;
     color: rgba(255, 255, 255, 1);
index 99889d0..65f6286 100644 (file)
                52131E5B1C4F15760033F802 /* WebVideoFullscreenInterfaceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52131E5A1C4F15610033F802 /* WebVideoFullscreenInterfaceMac.mm */; };
                521D46F611AEC98100514613 /* KillRingMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 521D46F511AEC98100514613 /* KillRingMac.mm */; };
                521D46F811AEC9B100514613 /* KillRing.h in Headers */ = {isa = PBXBuildFile; fileRef = 521D46F711AEC9B100514613 /* KillRing.h */; };
+               526724F31CB2FEAD0075974D /* TextTrackRepresentationCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 526724F11CB2FDF60075974D /* TextTrackRepresentationCocoa.mm */; };
                52B0D4BE1C57FD1E0077CE53 /* PlatformView.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B0D4BD1C57FD1E0077CE53 /* PlatformView.h */; settings = {ATTRIBUTES = (Private, ); }; };
                52B0D4C01C57FD660077CE53 /* WebVideoFullscreenChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B0D4BF1C57FD660077CE53 /* WebVideoFullscreenChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
                52B0D4C21C57FF910077CE53 /* WebVideoFullscreenInterfaceMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B0D4C11C57FF910077CE53 /* WebVideoFullscreenInterfaceMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CDC8B5AD1804AE5D0016E685 /* SourceBufferPrivateClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC8B5AC1804AE5D0016E685 /* SourceBufferPrivateClient.h */; };
                CDC979F41C498C0900DB50D4 /* WebCoreNSErrorExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC979F21C498C0900DB50D4 /* WebCoreNSErrorExtras.mm */; };
                CDC979F51C498C0900DB50D4 /* WebCoreNSErrorExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC979F31C498C0900DB50D4 /* WebCoreNSErrorExtras.h */; };
-               CDCA82961679100F00875714 /* TextTrackRepresentationIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA82941679100F00875714 /* TextTrackRepresentationIOS.mm */; };
                CDCA98EB18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDCA98EA18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp */; };
                CDCD41E71C3DDB0900965D99 /* ParsedContentRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDCD41E51C3DDB0900965D99 /* ParsedContentRange.cpp */; };
                CDCD41E81C3DDB0A00965D99 /* ParsedContentRange.h in Headers */ = {isa = PBXBuildFile; fileRef = CDCD41E61C3DDB0900965D99 /* ParsedContentRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
                52131E5A1C4F15610033F802 /* WebVideoFullscreenInterfaceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenInterfaceMac.mm; sourceTree = "<group>"; };
                521D46F511AEC98100514613 /* KillRingMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KillRingMac.mm; sourceTree = "<group>"; };
                521D46F711AEC9B100514613 /* KillRing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KillRing.h; sourceTree = "<group>"; };
+               526724F11CB2FDF60075974D /* TextTrackRepresentationCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextTrackRepresentationCocoa.mm; sourceTree = "<group>"; };
+               526724F21CB2FDF60075974D /* TextTrackRepresentationCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackRepresentationCocoa.h; sourceTree = "<group>"; };
                52B0D4BD1C57FD1E0077CE53 /* PlatformView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformView.h; sourceTree = "<group>"; };
                52B0D4BF1C57FD660077CE53 /* WebVideoFullscreenChangeObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenChangeObserver.h; sourceTree = "<group>"; };
                52B0D4C11C57FF910077CE53 /* WebVideoFullscreenInterfaceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenInterfaceMac.h; sourceTree = "<group>"; };
                CDC8B5AC1804AE5D0016E685 /* SourceBufferPrivateClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBufferPrivateClient.h; sourceTree = "<group>"; };
                CDC979F21C498C0900DB50D4 /* WebCoreNSErrorExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSErrorExtras.mm; sourceTree = "<group>"; };
                CDC979F31C498C0900DB50D4 /* WebCoreNSErrorExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreNSErrorExtras.h; sourceTree = "<group>"; };
-               CDCA82941679100F00875714 /* TextTrackRepresentationIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextTrackRepresentationIOS.mm; sourceTree = "<group>"; };
                CDCA98E918B2C8D000C12FF9 /* CDMPrivateMediaPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMPrivateMediaPlayer.h; sourceTree = "<group>"; };
                CDCA98EA18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CDMPrivateMediaPlayer.cpp; sourceTree = "<group>"; };
                CDCD41E51C3DDB0900965D99 /* ParsedContentRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParsedContentRange.cpp; sourceTree = "<group>"; };
                CED06ACF1C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSecurityPolicyViolationEvent.h; sourceTree = "<group>"; };
                CEDA12D6152CA1CB00D9E08D /* AlternativeTextClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlternativeTextClient.h; sourceTree = "<group>"; };
                CEE27ACA1BBB53A20072400A /* pthreadSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pthreadSPI.h; sourceTree = "<group>"; };
-               CEEC6034187DD962003E43BB /* TextTrackRepresentationIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackRepresentationIOS.h; sourceTree = "<group>"; };
                CEEFCD7719DB31F7003876D7 /* MediaResourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaResourceLoader.cpp; sourceTree = "<group>"; };
                CEEFCD7819DB31F7003876D7 /* MediaResourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaResourceLoader.h; sourceTree = "<group>"; };
                CEEFCD7B19DB33DC003876D7 /* PlatformMediaResourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformMediaResourceLoader.h; sourceTree = "<group>"; };
                                C58361A81744523F00173511 /* FontServicesIOS.mm */,
                                31AB4FFF122878A2001A7DB0 /* GraphicsContext3DIOS.h */,
                                FED13D3F0CEA939400D89466 /* IconIOS.mm */,
-                               CEEC6034187DD962003E43BB /* TextTrackRepresentationIOS.h */,
-                               CDCA82941679100F00875714 /* TextTrackRepresentationIOS.mm */,
                        );
                        path = ios;
                        sourceTree = "<group>";
                                2D0B4AA918DA1CCD00434DE1 /* IOSurface.h */,
                                2D0B4AAA18DA1CCD00434DE1 /* IOSurface.mm */,
                                AD9FF6E01908391D003B61E0 /* IOSurfacePoolCocoa.mm */,
+                               526724F11CB2FDF60075974D /* TextTrackRepresentationCocoa.mm */,
+                               526724F21CB2FDF60075974D /* TextTrackRepresentationCocoa.h */,
                                2D3EF4441917915C00034184 /* WebActionDisablingCALayerDelegate.h */,
                                2D3EF4451917915C00034184 /* WebActionDisablingCALayerDelegate.mm */,
                                2D3EF4461917915C00034184 /* WebCoreCALayerExtras.h */,
                                076970861463AD8700F502CF /* TextTrackList.cpp in Sources */,
                                B1AD4E7313A12A4600846B27 /* TextTrackLoader.cpp in Sources */,
                                CD1E7347167BC78E009A885D /* TextTrackRepresentation.cpp in Sources */,
-                               CDCA82961679100F00875714 /* TextTrackRepresentationIOS.mm in Sources */,
+                               526724F31CB2FEAD0075974D /* TextTrackRepresentationCocoa.mm in Sources */,
                                29498683195341940072D2BD /* TextUndoInsertionMarkupMac.mm in Sources */,
                                498770F01242C535002226BA /* Texture.cpp in Sources */,
                                CD9D82751C7AE535006FF066 /* TextureCacheCV.mm in Sources */,
index 40a6f6a..8a5d6a2 100644 (file)
@@ -42,7 +42,7 @@ public:
     virtual IntRect bounds() const { return IntRect(); }
 };
 
-#if !PLATFORM(IOS)
+#if !(PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)))
 
 std::unique_ptr<TextTrackRepresentation> TextTrackRepresentation::create(TextTrackRepresentationClient&)
 {
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TextTrackRepresentationIOS_h
-#define TextTrackRepresentationIOS_h
+#ifndef TextTrackRepresentationCocoa_h
+#define TextTrackRepresentationCocoa_h
 
-#if PLATFORM(IOS) && ENABLE(VIDEO_TRACK)
+#if (PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))) && ENABLE(VIDEO_TRACK)
 
 #import "TextTrackRepresentation.h"
 #import <QuartzCore/CALayer.h>
 #import <wtf/RetainPtr.h>
 
-@class WebCoreTextTrackRepresentationIOSHelper;
+@class WebCoreTextTrackRepresentationCocoaHelper;
 
 namespace WebCore {
 
-class TextTrackRepresentationIOS final : public TextTrackRepresentation {
+class TextTrackRepresentationCocoa final : public TextTrackRepresentation {
 public:
-    explicit TextTrackRepresentationIOS(TextTrackRepresentationClient&);
-    virtual ~TextTrackRepresentationIOS();
+    explicit TextTrackRepresentationCocoa(TextTrackRepresentationClient&);
+    virtual ~TextTrackRepresentationCocoa();
 
     TextTrackRepresentationClient& client() const { return m_client; }
 
@@ -52,11 +52,11 @@ private:
 
     TextTrackRepresentationClient& m_client;
     RetainPtr<CALayer> m_layer;
-    RetainPtr<WebCoreTextTrackRepresentationIOSHelper> m_delegate;
+    RetainPtr<WebCoreTextTrackRepresentationCocoaHelper> m_delegate;
 };
 
 }
 
-#endif // PLATFORM(IOS) && ENABLE(VIDEO_TRACK)
+#endif // (PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))) && ENABLE(VIDEO_TRACK)
 
-#endif // TextTrackRepresentationIOS_h
+#endif // TextTrackRepresentationCocoa_h
 
 #include "config.h"
 
-#if PLATFORM(IOS) && ENABLE(VIDEO_TRACK)
-
-#include "TextTrackRepresentationIOS.h"
+#if (PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))) && ENABLE(VIDEO_TRACK)
+#include "TextTrackRepresentationCocoa.h"
 
 #include "FloatRect.h"
 #include "GraphicsContextCG.h"
 #include "IntRect.h"
+
+#if PLATFORM(IOS)
 #include "WebCoreThread.h"
 #include "WebCoreThreadRun.h"
+#endif
 
 using namespace WebCore;
 
-@interface WebCoreTextTrackRepresentationIOSHelper : NSObject {
-    TextTrackRepresentationIOS* _parent;
+@interface WebCoreTextTrackRepresentationCocoaHelper : NSObject {
+    TextTrackRepresentationCocoa* _parent;
 }
-- (id)initWithParent:(TextTrackRepresentationIOS*)parent;
-@property (assign) TextTrackRepresentationIOS* parent;
+- (id)initWithParent:(TextTrackRepresentationCocoa*)parent;
+@property (assign) TextTrackRepresentationCocoa* parent;
 @end
 
-@implementation WebCoreTextTrackRepresentationIOSHelper
-- (id)initWithParent:(TextTrackRepresentationIOS*)parent
+@implementation WebCoreTextTrackRepresentationCocoaHelper
+- (id)initWithParent:(TextTrackRepresentationCocoa*)parent
 {
     if (!(self = [super init]))
         return nil;
@@ -61,7 +63,7 @@ using namespace WebCore;
     [super dealloc];
 }
 
-- (void)setParent:(TextTrackRepresentationIOS*)parent
+- (void)setParent:(TextTrackRepresentationCocoa*)parent
 {
     if (_parent)
         [_parent->platformLayer() removeObserver:self forKeyPath:@"bounds"];
@@ -72,7 +74,7 @@ using namespace WebCore;
         [_parent->platformLayer() addObserver:self forKeyPath:@"bounds" options:0 context:0];
 }
 
-- (TextTrackRepresentationIOS*)parent
+- (TextTrackRepresentationCocoa*)parent
 {
     return _parent;
 }
@@ -81,10 +83,15 @@ using namespace WebCore;
 {
     UNUSED_PARAM(change);
     UNUSED_PARAM(context);
+#if PLATFORM(IOS)
     WebThreadRun(^{
         if (_parent && [keyPath isEqual:@"bounds"] && object == _parent->platformLayer())
             _parent->client().textTrackRepresentationBoundsChanged(_parent->bounds());
     });
+#else
+    if (_parent && [keyPath isEqual:@"bounds"] && object == _parent->platformLayer())
+        _parent->client().textTrackRepresentationBoundsChanged(_parent->bounds());
+#endif
 }
 
 - (id)actionForLayer:(CALayer *)layer forKey:(NSString *)event
@@ -99,38 +106,38 @@ using namespace WebCore;
 
 std::unique_ptr<TextTrackRepresentation> TextTrackRepresentation::create(TextTrackRepresentationClient& client)
 {
-    return std::make_unique<TextTrackRepresentationIOS>(client);
+    return std::make_unique<TextTrackRepresentationCocoa>(client);
 }
 
-TextTrackRepresentationIOS::TextTrackRepresentationIOS(TextTrackRepresentationClient& client)
+TextTrackRepresentationCocoa::TextTrackRepresentationCocoa(TextTrackRepresentationClient& client)
     : m_client(client)
     , m_layer(adoptNS([[CALayer alloc] init]))
-    , m_delegate(adoptNS([[WebCoreTextTrackRepresentationIOSHelper alloc] initWithParent:this]))
+    , m_delegate(adoptNS([[WebCoreTextTrackRepresentationCocoaHelper alloc] initWithParent:this]))
 {
     [m_layer.get() setDelegate:m_delegate.get()];
     [m_layer.get() setContentsGravity:kCAGravityBottom];
 }
 
-TextTrackRepresentationIOS::~TextTrackRepresentationIOS()
+TextTrackRepresentationCocoa::~TextTrackRepresentationCocoa()
 {
     [m_layer.get() setDelegate:nil];
     [m_delegate.get() setParent:nullptr];
 }
 
-void TextTrackRepresentationIOS::update()
+void TextTrackRepresentationCocoa::update()
 {
     if (auto representation = m_client.createTextTrackRepresentationImage())
         [m_layer.get() setContents:(id)representation->getCGImageRef()];
 }
 
-void TextTrackRepresentationIOS::setContentScale(float scale)
+void TextTrackRepresentationCocoa::setContentScale(float scale)
 {
     [m_layer.get() setContentsScale:scale];
 }
 
-IntRect TextTrackRepresentationIOS::bounds() const
+IntRect TextTrackRepresentationCocoa::bounds() const
 {
     return enclosingIntRect(FloatRect([m_layer.get() bounds]));
 }
 
-#endif // PLATFORM(IOS) && ENABLE(VIDEO_TRACK)
+#endif // (PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))) && ENABLE(VIDEO_TRACK)