Changeset 211072 in webkit
- Timestamp:
- Jan 23, 2017 6:19:21 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r211068 r211072 1 2017-01-23 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r211062. 4 https://bugs.webkit.org/show_bug.cgi?id=167354 5 6 broke API tests (Requested by alexchristensen on #webkit). 7 8 Reverted changeset: 9 10 "Pass down website autoplay policies to media elements" 11 https://bugs.webkit.org/show_bug.cgi?id=167132 12 http://trac.webkit.org/changeset/211062 13 1 14 2017-01-23 Antti Koivisto <antti@apple.com> 2 15 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r211062 r211072 818 818 documentLoader->setUserContentExtensionsEnabled(websitePolicies.contentBlockersEnabled); 819 819 820 #if PLATFORM(MAC)821 coreFrame->settings().setAudioPlaybackRequiresUserGesture(!websitePolicies.autoplayEnabled);822 #endif823 824 820 // We call this synchronously because WebCore cannot gracefully handle a frame load without a synchronous navigation policy reply. 825 821 if (receivedPolicyAction) -
trunk/Tools/ChangeLog
r211067 r211072 1 2017-01-23 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r211062. 4 https://bugs.webkit.org/show_bug.cgi?id=167354 5 6 broke API tests (Requested by alexchristensen on #webkit). 7 8 Reverted changeset: 9 10 "Pass down website autoplay policies to media elements" 11 https://bugs.webkit.org/show_bug.cgi?id=167132 12 http://trac.webkit.org/changeset/211062 13 1 14 2017-01-23 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r211062 r211072 507 507 C54237F116B8957D00E638FC /* PasteboardNotifications_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C54237ED16B8955800E638FC /* PasteboardNotifications_Bundle.cpp */; }; 508 508 C5E1AFFE16B221F1006CC1F2 /* execCopy.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C5E1AFFD16B22179006CC1F2 /* execCopy.html */; }; 509 C9CB7DE11E2ED6F900B26082 /* autoplayCheck.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C9CB7DE01E2ED2A700B26082 /* autoplayCheck.html */; };510 509 CD59F53419E9110D00CF1835 /* file-with-mse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD59F53219E910AA00CF1835 /* file-with-mse.html */; }; 511 510 CD59F53519E9110D00CF1835 /* test-mse.mp4 in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD59F53319E910BC00CF1835 /* test-mse.mp4 */; }; … … 606 605 dstSubfolderSpec = 7; 607 606 files = ( 608 C9CB7DE11E2ED6F900B26082 /* autoplayCheck.html in Copy Resources */,609 607 7AEAD4811E20122700416EFE /* CrossPartitionFileSchemeAccess.html in Copy Resources */, 610 608 CDB4115A1E0B00DB00EAD352 /* video-with-muted-audio.html in Copy Resources */, … … 1268 1266 C5E1AFFD16B22179006CC1F2 /* execCopy.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = execCopy.html; sourceTree = "<group>"; }; 1269 1267 C95501BE19AD2FAF0049BE3E /* Preferences.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Preferences.mm; sourceTree = "<group>"; }; 1270 C9CB7DE01E2ED2A700B26082 /* autoplayCheck.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = autoplayCheck.html; sourceTree = "<group>"; };1271 1268 CD225C071C45A69200140761 /* ParsedContentRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParsedContentRange.cpp; sourceTree = "<group>"; }; 1272 1269 CD5393C71757BA9700C07123 /* MD5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MD5.cpp; sourceTree = "<group>"; }; … … 1949 1946 isa = PBXGroup; 1950 1947 children = ( 1948 9BD4239B1E04BFD000200395 /* chinese-character-with-image.html */, 1949 07492B391DF8ADA400633DE1 /* enumerateMediaDevices.html */, 1951 1950 C045F9461385C2F800C0F3CD /* 18-characters.html */, 1952 1951 1C2B81851C89252300A5529F /* Ahem.ttf */, … … 1954 1953 F6B7BE9617469B7E008A3445 /* associate-form-controls.html */, 1955 1954 76E182DE15475A8300F1FADD /* auto-submitting-form.html */, 1956 C9CB7DE01E2ED2A700B26082 /* autoplayCheck.html */,1957 1955 7C486BA01AA1254B003F6F9B /* bundle-file.html */, 1958 9BD4239B1E04BFD000200395 /* chinese-character-with-image.html */,1959 1956 1A50AA1F1A2A4EA500F4C345 /* close-from-within-create-page.html */, 1960 1957 9B270FED1DDC25FD002D53F3 /* closed-shadow-tree-test.html */, 1961 1958 5C9E56861DF9148E00C9EE33 /* contentBlockerCheck.html */, 1962 1959 290F4274172A1FDE00939FF0 /* custom-protocol-sync-xhr.html */, 1963 07492B391DF8ADA400633DE1 /* enumerateMediaDevices.html */,1964 1960 C5E1AFFD16B22179006CC1F2 /* execCopy.html */, 1965 1961 BC2D004A12A9FEB300E732A3 /* file-with-anchor.html */, -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm
r211062 r211072 27 27 28 28 #import "PlatformUtilities.h" 29 #import "TestWKWebView.h"30 29 #import <WebKit/WKUserContentControllerPrivate.h> 31 30 #import <WebKit/WKWebViewPrivate.h> … … 40 39 static size_t alertCount; 41 40 42 @interface ContentBlockingWebsitePoliciesDelegate : NSObject <WKNavigationDelegate, WKUIDelegate>41 @interface WebsitePoliciesDelegate : NSObject <WKNavigationDelegate, WKUIDelegate> 43 42 @end 44 43 45 @implementation ContentBlockingWebsitePoliciesDelegate44 @implementation WebsitePoliciesDelegate 46 45 47 46 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler … … 125 124 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 126 125 127 auto delegate = adoptNS([[ ContentBlockingWebsitePoliciesDelegate alloc] init]);126 auto delegate = adoptNS([[WebsitePoliciesDelegate alloc] init]); 128 127 [webView setNavigationDelegate:delegate.get()]; 129 128 [webView setUIDelegate:delegate.get()]; … … 150 149 } 151 150 152 #if PLATFORM(MAC)153 154 @interface AutoplayPoliciesDelegate : NSObject <WKNavigationDelegate, WKUIDelegate>155 @property (nonatomic) BOOL allowAutoplay;156 @end157 158 @implementation AutoplayPoliciesDelegate159 160 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler161 {162 // _webView:decidePolicyForNavigationAction:decisionHandler: should be called instead if it is implemented.163 EXPECT_TRUE(false);164 decisionHandler(WKNavigationActionPolicyAllow);165 }166 167 - (void)_webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy, _WKWebsitePolicies *))decisionHandler168 {169 _WKWebsitePolicies *websitePolicies = [[[_WKWebsitePolicies alloc] init] autorelease];170 websitePolicies.autoplayEnabled = _allowAutoplay;171 decisionHandler(WKNavigationActionPolicyAllow, websitePolicies);172 }173 174 @end175 176 TEST(WebKit2, WebsitePoliciesAutoplayEnabled)177 {178 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);179 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);180 181 auto delegate = adoptNS([[AutoplayPoliciesDelegate alloc] init]);182 [webView setNavigationDelegate:delegate.get()];183 184 NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"autoplayCheck" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];185 186 [delegate setAllowAutoplay:YES];187 [webView loadRequest:request];188 [webView waitForMessage:@"autoplayed"];189 190 [delegate setAllowAutoplay:NO];191 [webView loadRequest:request];192 [webView waitForMessage:@"did-not-play"];193 194 [delegate setAllowAutoplay:YES];195 [webView loadRequest:request];196 [webView waitForMessage:@"autoplayed"];197 }198 199 #endif // PLATFORM(MAC)200 201 151 #endif
Note: See TracChangeset
for help on using the changeset viewer.