Title: [245491] trunk
Revision
245491
Author
[email protected]
Date
2019-05-17 19:12:13 -0700 (Fri, 17 May 2019)

Log Message

Enable legacy EME for iOS WKWebView
https://bugs.webkit.org/show_bug.cgi?id=197964
<rdar://problem/50625666>

Patch by Alex Christensen <[email protected]> on 2019-05-17
Reviewed by Wenson Hsieh.

Source/WebCore:

This was attempted unsuccessfully in r230169.
Verified manually that it works as desired.

* page/RuntimeEnabledFeatures.h:

Source/WebKit:

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewConfiguration.mm:
(TEST):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (245490 => 245491)


--- trunk/Source/WebCore/ChangeLog	2019-05-18 01:32:03 UTC (rev 245490)
+++ trunk/Source/WebCore/ChangeLog	2019-05-18 02:12:13 UTC (rev 245491)
@@ -1,3 +1,16 @@
+2019-05-17  Alex Christensen  <[email protected]>
+
+        Enable legacy EME for iOS WKWebView
+        https://bugs.webkit.org/show_bug.cgi?id=197964
+        <rdar://problem/50625666>
+
+        Reviewed by Wenson Hsieh.
+
+        This was attempted unsuccessfully in r230169.
+        Verified manually that it works as desired.
+
+        * page/RuntimeEnabledFeatures.h:
+
 2019-05-17  Sihui Liu  <[email protected]>
 
         ASSERTION FAILED: !m_backingStore in WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore(uint64_t)

Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (245490 => 245491)


--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2019-05-18 01:32:03 UTC (rev 245490)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2019-05-18 02:12:13 UTC (rev 245491)
@@ -507,7 +507,7 @@
 #endif
 
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-    bool m_legacyEncryptedMediaAPIEnabled { false };
+    bool m_legacyEncryptedMediaAPIEnabled { true };
 #endif
 
 #if ENABLE(INTERSECTION_OBSERVER)

Modified: trunk/Source/WebKit/ChangeLog (245490 => 245491)


--- trunk/Source/WebKit/ChangeLog	2019-05-18 01:32:03 UTC (rev 245490)
+++ trunk/Source/WebKit/ChangeLog	2019-05-18 02:12:13 UTC (rev 245491)
@@ -1,3 +1,14 @@
+2019-05-17  Alex Christensen  <[email protected]>
+
+        Enable legacy EME for iOS WKWebView
+        https://bugs.webkit.org/show_bug.cgi?id=197964
+        <rdar://problem/50625666>
+
+        Reviewed by Wenson Hsieh.
+
+        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+        (-[WKWebViewConfiguration init]):
+
 2019-05-17  Antoine Quint  <[email protected]>
 
         Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm (245490 => 245491)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm	2019-05-18 01:32:03 UTC (rev 245490)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm	2019-05-18 02:12:13 UTC (rev 245491)
@@ -200,13 +200,12 @@
 #endif
         _mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAll;
     _ignoresViewportScaleLimits = NO;
-    _legacyEncryptedMediaAPIEnabled = NO;
 #else
     _mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone;
     _mediaDataLoadsAutomatically = YES;
     _userInterfaceDirectionPolicy = WKUserInterfaceDirectionPolicyContent;
+#endif
     _legacyEncryptedMediaAPIEnabled = YES;
-#endif
     _mainContentUserGestureOverrideEnabled = NO;
     _invisibleAutoplayNotPermitted = NO;
     _attachmentElementEnabled = NO;

Modified: trunk/Tools/ChangeLog (245490 => 245491)


--- trunk/Tools/ChangeLog	2019-05-18 01:32:03 UTC (rev 245490)
+++ trunk/Tools/ChangeLog	2019-05-18 02:12:13 UTC (rev 245491)
@@ -1,3 +1,14 @@
+2019-05-17  Alex Christensen  <[email protected]>
+
+        Enable legacy EME for iOS WKWebView
+        https://bugs.webkit.org/show_bug.cgi?id=197964
+        <rdar://problem/50625666>
+
+        Reviewed by Wenson Hsieh.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewConfiguration.mm:
+        (TEST):
+
 2019-05-17  Aakash Jain  <[email protected]>
 
         [ews-build] Add clickable url in UI for uploaded S3 archive

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewConfiguration.mm (245490 => 245491)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewConfiguration.mm	2019-05-18 01:32:03 UTC (rev 245490)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewConfiguration.mm	2019-05-18 02:12:13 UTC (rev 245491)
@@ -81,3 +81,17 @@
     auto configuationCopy = adoptNS([configuration copy]);
     EXPECT_STREQ([configuration _groupIdentifier].UTF8String, [configuationCopy _groupIdentifier].UTF8String);
 }
+
+TEST(WebKit, DefaultConfigurationEME)
+{
+    auto configuration = adoptNS([WKWebViewConfiguration new]);
+    EXPECT_TRUE([configuration _legacyEncryptedMediaAPIEnabled]);
+    auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) configuration:configuration.get()]);
+    [webView loadHTMLString:@"<html>hi</html>" baseURL:nil];
+    __block bool done = false;
+    [webView evaluateJavaScript:@"window.WebKitMediaKeys ? 'ENABLED' : 'DISABLED'" completionHandler:^(id result, NSError *){
+        EXPECT_TRUE([result isEqualToString:@"ENABLED"]);
+        done = true;
+    }];
+    TestWebKitAPI::Util::run(&done);
+}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to