COMMIT_MESSAGE

 1Implement W3C Secure Contexts Draft Specification
 2https://bugs.webkit.org/show_bug.cgi?id=158121
 3<rdar://problem/26012994>
 4
 5Reviewed by NOBODY (OOPS!).
 6
 7Part 4
 8
 9Source/JavaScriptCore:
 10
 11Adds isSecureContext to the list of common identifiers as needed to support
 12toggling its exposure from a runtime enabled feature flag.
 13
 14* runtime/CommonIdentifiers.h:
 15
 16Source/WebCore:
 17
 18Adds runtime enabled feature flag, isSecureContextAttributeEnabled, to toggle exposing
 19the global object property isSecureContext (defaults: true - expose the property).
 20
 21Test: security/isSecureContext-disabled.html
 22
 23* page/RuntimeEnabledFeatures.h:
 24(WebCore::RuntimeEnabledFeatures::setIsSecureContextAttributeEnabled):
 25(WebCore::RuntimeEnabledFeatures::isSecureContextAttributeEnabled):
 26* page/WindowOrWorkerGlobalScope.idl:
 27
 28Source/WebKit/mac:
 29
 30Adds a preference to toggle the runtime enabled feature flag isSecureContextAttributeEnabled.
 31
 32* WebView/WebPreferenceKeysPrivate.h:
 33* WebView/WebPreferences.mm:
 34(+[WebPreferences initialize]):
 35(-[WebPreferences isSecureContextAttributeEnabled]):
 36(-[WebPreferences setIsSecureContextAttributeEnabled:]):
 37* WebView/WebPreferencesPrivate.h:
 38* WebView/WebView.mm:
 39(-[WebView _preferencesChanged:]):
 40
 41Source/WebKit/win:
 42
 43Adds a preference to toggle the runtime enabled feature flag isSecureContextAttributeEnabled.
 44
 45* Interfaces/IWebPreferencesPrivate.idl:
 46* WebPreferenceKeysPrivate.h:
 47* WebPreferences.cpp:
 48(WebPreferences::initializeDefaultSettings):
 49(WebPreferences::setIsSecureContextAttributeEnabled):
 50(WebPreferences::isSecureContextAttributeEnabled):
 51* WebPreferences.h:
 52* WebView.cpp:
 53(WebView::notifyPreferencesChanged):
 54
 55Source/WebKit2:
 56
 57Adds a preference to toggle the runtime enabled feature flag isSecureContextAttributeEnabled.
 58
 59* Shared/WebPreferencesDefinitions.h:
 60* UIProcess/API/C/WKPreferences.cpp:
 61(WKPreferencesSetIsSecureContextAttributeEnabled):
 62(WKPreferencesGetIsSecureContextAttributeEnabled):
 63* UIProcess/API/C/WKPreferencesRefPrivate.h:
 64* WebProcess/InjectedBundle/InjectedBundle.cpp:
 65(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
 66* WebProcess/WebPage/WebPage.cpp:
 67(WebKit::WebPage::updatePreferences):
 68
 69Tools:
 70
 71Expose the isSecureContext attribute by default in DumpRenderTree and WebKitTestRunner.
 72Teach DumpRenderTree for Mac and WebKitTestRunner to parse the test option enableIsSecureContextAttribute
 73to toggle the runtime enabled feature flag isSecureContextAttributeEnabled.
 74
 75* DumpRenderTree/TestOptions.h:
 76* DumpRenderTree/TestOptions.mm:
 77(TestOptions::TestOptions):
 78* DumpRenderTree/mac/DumpRenderTree.mm:
 79(enableExperimentalFeatures):
 80(setWebPreferencesForTestOptions):
 81* DumpRenderTree/win/DumpRenderTree.cpp:
 82(enableExperimentalFeatures):
 83* WebKitTestRunner/TestController.cpp:
 84(WTR::TestController::resetPreferencesToConsistentValues):
 85(WTR::updateTestOptionsFromTestHeader):
 86* WebKitTestRunner/TestOptions.h:
 87(WTR::TestOptions::hasSameInitializationOptions):
 88
 89LayoutTests:
 90
 91Adds a test to ensure that the global object property isSecureContext is not
 92exposed (is undefined) when the runtime enabled feature flag isSecureContextAttributeEnabled
 93is disabled.
 94
 95* platform/win/TestExpectations: Skip the test as DumpRenderTree on Windows does not support
 96parsing of test options. See <https://bugs.webkit.org/show_bug.cgi?id=173281> for more details.
 97* security/isSecureContext-disabled-expected.txt: Added.
 98* security/isSecureContext-disabled.html: Added.
 99* security/resources/worker-isSecureContext-disabled.js: Added.

LayoutTests/ChangeLog

 12017-06-13 Daniel Bates <dabates@apple.com>
 2
 3 Implement W3C Secure Contexts Draft Specification
 4 https://bugs.webkit.org/show_bug.cgi?id=158121
 5 <rdar://problem/26012994>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Part 4
 10
 11 Adds a test to ensure that the global object property isSecureContext is not
 12 exposed (is undefined) when the runtime enabled feature flag isSecureContextAttributeEnabled
 13 is disabled.
 14
 15 * platform/win/TestExpectations: Skip the test as DumpRenderTree on Windows does not support
 16 parsing of test options. See <https://bugs.webkit.org/show_bug.cgi?id=173281> for more details.
 17 * security/isSecureContext-disabled-expected.txt: Added.
 18 * security/isSecureContext-disabled.html: Added.
 19 * security/resources/worker-isSecureContext-disabled.js: Added.
 20
1212017-06-13 Joanmarie Diggs <jdiggs@igalia.com>
222
323 AX: [ATK] Implement missing AtkRelation types

LayoutTests/platform/win/TestExpectations

@@fast/css/text-overflow-ellipsis-strict.html [ Skip ]
8484################################################################################
8585############## Missing Functionality Prevents Testing ################
8686################################################################################
 87
 88# FIXME: Implement test options parsing (<!-- webkit-test-runner [ ... ] -->).
 89webkit.org/b/173281 security/isSecureContext-disabled.html [ Skip ]
 90
8791# TODO HW filters not yet supported on Windows
8892webkit.org/b/74716 css3/filters/effect-blur-hw.html [ Skip ]
8993webkit.org/b/74716 css3/filters/effect-combined-hw.html [ Skip ]

LayoutTests/security/isSecureContext-disabled-expected.txt

 1Tests that global property isSecureContexts is undefined when the Setting isSecureContextAttributeEnabled is disabled.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS window.isSecureContext is undefined.
 7Starting worker: resources/worker-isSecureContext-disabled.js
 8PASS [Worker] self.isSecureContext is undefined.
 9PASS successfullyParsed is true
 10
 11TEST COMPLETE
 12

LayoutTests/security/isSecureContext-disabled.html

 1<!DOCTYPE html><!-- webkit-test-runner [ enableIsSecureContextAttribute=false ] -->
 2<html>
 3<head>
 4<script src="../resources/js-test.js"></script>
 5</head>
 6<body>
 7<script>
 8window.jsTestIsAsync = true;
 9
 10description("Tests that global property isSecureContexts is undefined when the Setting isSecureContextAttributeEnabled is disabled.");
 11
 12shouldBeUndefined("window.isSecureContext");
 13startWorker("resources/worker-isSecureContext-disabled.js");
 14</script>
 15</body>
 16</html>

LayoutTests/security/resources/worker-isSecureContext-disabled.js

 1importScripts("../../resources/js-test.js");
 2
 3if (typeof(self.isSecureContext) === 'undefined')
 4 testPassed("self.isSecureContext is undefined.");
 5else
 6 testFailed("self.isSecureContext is defined.");
 7finishJSTest();

Source/JavaScriptCore/ChangeLog

 12017-06-13 Daniel Bates <dabates@apple.com>
 2
 3 Implement W3C Secure Contexts Draft Specification
 4 https://bugs.webkit.org/show_bug.cgi?id=158121
 5 <rdar://problem/26012994>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Part 4
 10
 11 Adds isSecureContext to the list of common identifiers as needed to support
 12 toggling its exposure from a runtime enabled feature flag.
 13
 14 * runtime/CommonIdentifiers.h:
 15
1162017-06-13 Don Olmstead <don.olmstead@sony.com>
217
318 [JSC] Remove redundant includes in config.h

Source/JavaScriptCore/runtime/CommonIdentifiers.h

241241 macro(isArray) \
242242 macro(isEnabled) \
243243 macro(isPrototypeOf) \
 244 macro(isSecureContext) \
244245 macro(isView) \
245246 macro(isWatchpoint) \
246247 macro(jettisonReason) \

Source/WebCore/ChangeLog

 12017-06-13 Daniel Bates <dabates@apple.com>
 2
 3 Implement W3C Secure Contexts Draft Specification
 4 https://bugs.webkit.org/show_bug.cgi?id=158121
 5 <rdar://problem/26012994>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Part 4
 10
 11 Adds runtime enabled feature flag, isSecureContextAttributeEnabled, to toggle exposing
 12 the global object property isSecureContext (defaults: true - expose the property).
 13
 14 Test: security/isSecureContext-disabled.html
 15
 16 * page/RuntimeEnabledFeatures.h:
 17 (WebCore::RuntimeEnabledFeatures::setIsSecureContextAttributeEnabled):
 18 (WebCore::RuntimeEnabledFeatures::isSecureContextAttributeEnabled):
 19 * page/WindowOrWorkerGlobalScope.idl:
 20
1212017-06-13 Wenson Hsieh <wenson_hsieh@apple.com>
222
323 Unable to paste text that was copied from a page into the universal search field

Source/WebCore/page/RuntimeEnabledFeatures.h

@@public:
7878 void setCredentialManagementEnabled(bool isEnabled) { m_isCredentialManagementEnabled = isEnabled; }
7979 bool credentialManagementEnabled() const { return m_isCredentialManagementEnabled; }
8080
 81 void setIsSecureContextAttributeEnabled(bool isEnabled) { m_isSecureContextAttributeEnabled = isEnabled; }
 82 bool isSecureContextAttributeEnabled() const { return m_isSecureContextAttributeEnabled; }
 83
8184#if ENABLE(INDEXED_DATABASE_IN_WORKERS)
8285 void setIndexedDBWorkersEnabled(bool isEnabled) { m_isIndexedDBWorkersEnabled = isEnabled; }
8386 bool indexedDBWorkersEnabled() const { return m_isIndexedDBWorkersEnabled; }

@@private:
209212 bool m_isUserTimingEnabled { false };
210213 bool m_isInteractiveFormValidationEnabled { false };
211214 bool m_isCredentialManagementEnabled { false };
 215 bool m_isSecureContextAttributeEnabled { false };
212216
213217 bool m_isDisplayContentsEnabled { false };
214218 bool m_isShadowDOMEnabled { true };

Source/WebCore/page/WindowOrWorkerGlobalScope.idl

4141 [MayThrowException] DOMString btoa(DOMString string);
4242
4343 // Secure Contexts
44  readonly attribute boolean isSecureContext;
 44 [EnabledAtRuntime=IsSecureContextAttribute] readonly attribute boolean isSecureContext;
4545};

Source/WebKit/mac/ChangeLog

 12017-06-13 Daniel Bates <dabates@apple.com>
 2
 3 Implement W3C Secure Contexts Draft Specification
 4 https://bugs.webkit.org/show_bug.cgi?id=158121
 5 <rdar://problem/26012994>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Part 4
 10
 11 Adds a preference to toggle the runtime enabled feature flag isSecureContextAttributeEnabled.
 12
 13 * WebView/WebPreferenceKeysPrivate.h:
 14 * WebView/WebPreferences.mm:
 15 (+[WebPreferences initialize]):
 16 (-[WebPreferences isSecureContextAttributeEnabled]):
 17 (-[WebPreferences setIsSecureContextAttributeEnabled:]):
 18 * WebView/WebPreferencesPrivate.h:
 19 * WebView/WebView.mm:
 20 (-[WebView _preferencesChanged:]):
 21
1222017-06-13 Sam Weinig <sam@webkit.org>
223
324 Rename JSDOMWindowShell to JSDOMWindowProxy to match the HTML5 spec.

Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h

185185#define WebKitMediaPreloadingEnabledPreferenceKey @"WebKitMediaPreloadingEnabled"
186186#define WebKitCredentialManagementEnabledPreferenceKey @"WebKitCredentialManagementEnabled"
187187#define WebKitMediaUserGestureInheritsFromDocument @"WebKitMediaUserGestureInheritsFromDocument"
 188#define WebKitIsSecureContextAttributeEnabledPreferenceKey @"WebKitIsSecureContextAttributeEnabled"
188189
189190#if !TARGET_OS_IPHONE
190191// These are private both because callers should be using the cover methods and because the

Source/WebKit/mac/WebView/WebPreferences.mm

@@+ (void)initialize
668668 @NO, WebKitResourceTimingEnabledPreferenceKey,
669669 @NO, WebKitCredentialManagementEnabledPreferenceKey,
670670 @NO, WebKitMediaUserGestureInheritsFromDocument,
 671 @NO, WebKitIsSecureContextAttributeEnabledPreferenceKey,
671672 (NSString *)Settings::defaultMediaContentTypesRequiringHardwareSupport(), WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey,
672673 nil];
673674

@@- (void)setMediaContentTypesRequiringHardwareSupport:(NSString *)value
31033104{
31043105 [self _setStringValue:value forKey:WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey];
31053106}
 3107
 3108- (BOOL)isSecureContextAttributeEnabled
 3109{
 3110 return [self _boolValueForKey:WebKitIsSecureContextAttributeEnabledPreferenceKey];
 3111}
 3112
 3113- (void)setIsSecureContextAttributeEnabled:(BOOL)flag
 3114{
 3115 [self _setBoolValue:flag forKey:WebKitIsSecureContextAttributeEnabledPreferenceKey];
 3116}
 3117
31063118@end
31073119
31083120@implementation WebPreferences (WebInternal)

Source/WebKit/mac/WebView/WebPreferencesPrivate.h

@@extern NSString *WebPreferencesCacheModelChangedInternalNotification;
547547- (void)setCredentialManagementEnabled:(BOOL)flag;
548548- (BOOL)credentialManagementEnabled;
549549
 550- (void)setIsSecureContextAttributeEnabled:(BOOL)flag;
 551- (BOOL)isSecureContextAttributeEnabled;
 552
550553@property (nonatomic) BOOL visualViewportEnabled;
551554@property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
552555@property (nonatomic) BOOL animatedImageAsyncDecodingEnabled;

@@extern NSString *WebPreferencesCacheModelChangedInternalNotification;
561564@property (nonatomic) BOOL linkPreloadEnabled;
562565@property (nonatomic) BOOL credentialManagementEnabled;
563566@property (nonatomic) BOOL mediaUserGestureInheritsFromDocument;
 567@property (nonatomic) BOOL isSecureContextAttributeEnabled;
564568
565569#if TARGET_OS_IPHONE
566570@property (nonatomic) BOOL quickLookDocumentSavingEnabled;

Source/WebKit/mac/WebView/WebView.mm

@@- (void)_preferencesChanged:(WebPreferences *)preferences
30573057 RuntimeEnabledFeatures::sharedFeatures().setLinkPreloadEnabled(preferences.linkPreloadEnabled);
30583058 RuntimeEnabledFeatures::sharedFeatures().setMediaPreloadingEnabled(preferences.mediaPreloadingEnabled);
30593059 RuntimeEnabledFeatures::sharedFeatures().setCredentialManagementEnabled(preferences.credentialManagementEnabled);
 3060 RuntimeEnabledFeatures::sharedFeatures().setIsSecureContextAttributeEnabled(preferences.isSecureContextAttributeEnabled);
30603061
30613062 NSTimeInterval timeout = [preferences incrementalRenderingSuppressionTimeoutInSeconds];
30623063 if (timeout > 0)

Source/WebKit/win/ChangeLog

 12017-06-13 Daniel Bates <dabates@apple.com>
 2
 3 Implement W3C Secure Contexts Draft Specification
 4 https://bugs.webkit.org/show_bug.cgi?id=158121
 5 <rdar://problem/26012994>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Part 4
 10
 11 Adds a preference to toggle the runtime enabled feature flag isSecureContextAttributeEnabled.
 12
 13 * Interfaces/IWebPreferencesPrivate.idl:
 14 * WebPreferenceKeysPrivate.h:
 15 * WebPreferences.cpp:
 16 (WebPreferences::initializeDefaultSettings):
 17 (WebPreferences::setIsSecureContextAttributeEnabled):
 18 (WebPreferences::isSecureContextAttributeEnabled):
 19 * WebPreferences.h:
 20 * WebView.cpp:
 21 (WebView::notifyPreferencesChanged):
 22
1232017-06-13 Sam Weinig <sam@webkit.org>
224
325 Rename JSDOMWindowShell to JSDOMWindowProxy to match the HTML5 spec.

Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl

@@interface IWebPreferencesPrivate4 : IWebPreferencesPrivate3
201201 HRESULT setMediaPreloadingEnabled([in] BOOL enabled);
202202 HRESULT clearNetworkLoaderSession();
203203 HRESULT switchNetworkLoaderToNewTestingSession();
 204 HRESULT isSecureContextAttributeEnabled([out, retval] BOOL*);
 205 HRESULT setIsSecureContextAttributeEnabled([in] BOOL enabled);
204206}

Source/WebKit/win/WebPreferenceKeysPrivate.h

185185#define WebKitLinkPreloadEnabledPreferenceKey "WebKitLinkPreloadEnabled"
186186
187187#define WebKitMediaPreloadingEnabledPreferenceKey "WebKitMediaPreloadingEnabled"
 188
 189#define WebKitIsSecureContextAttributeEnabledPreferenceKey "WebKitIsSecureContextAttributeEnabled"

Source/WebKit/win/WebPreferences.cpp

@@void WebPreferences::initializeDefaultSettings()
316316
317317 CFDictionaryAddValue(defaults, CFSTR(WebKitMediaPreloadingEnabledPreferenceKey), kCFBooleanFalse);
318318
 319 CFDictionaryAddValue(defaults, CFSTR(WebKitIsSecureContextAttributeEnabledPreferenceKey), kCFBooleanFalse);
 320
319321 defaultSettings = defaults;
320322}
321323

@@HRESULT WebPreferences::switchNetworkLoaderToNewTestingSession()
20412043 return S_OK;
20422044}
20432045
 2046HRESULT WebPreferences::setIsSecureContextAttributeEnabled(BOOL enabled)
 2047{
 2048 setBoolValue(WebKitIsSecureContextAttributeEnabledPreferenceKey, enabled);
 2049 return S_OK;
 2050}
 2051
 2052HRESULT WebPreferences::isSecureContextAttributeEnabled(_Out_ BOOL* enabled)
 2053{
 2054 if (!enabled)
 2055 return E_POINTER;
 2056 *enabled = boolValueForKey(WebKitIsSecureContextAttributeEnabledPreferenceKey);
 2057 return S_OK;
 2058}
 2059
20442060HRESULT WebPreferences::setApplicationId(BSTR applicationId)
20452061{
20462062 m_applicationId = String(applicationId).createCFString();

Source/WebKit/win/WebPreferences.h

@@public:
255255 virtual HRESULT STDMETHODCALLTYPE setMediaPreloadingEnabled(BOOL);
256256 virtual HRESULT STDMETHODCALLTYPE clearNetworkLoaderSession();
257257 virtual HRESULT STDMETHODCALLTYPE switchNetworkLoaderToNewTestingSession();
 258 virtual HRESULT STDMETHODCALLTYPE isSecureContextAttributeEnabled(_Out_ BOOL*);
 259 virtual HRESULT STDMETHODCALLTYPE setIsSecureContextAttributeEnabled(BOOL);
258260
259261 // WebPreferences
260262

Source/WebKit/win/WebView.cpp

@@HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
52855285 return hr;
52865286 RuntimeEnabledFeatures::sharedFeatures().setMediaPreloadingEnabled(!!enabled);
52875287
 5288 hr = prefsPrivate->isSecureContextAttributeEnabled(&enabled);
 5289 if (FAILED(hr))
 5290 return hr;
 5291 RuntimeEnabledFeatures::sharedFeatures().setIsSecureContextAttributeEnabled(!!enabled);
 5292
52885293 hr = preferences->privateBrowsingEnabled(&enabled);
52895294 if (FAILED(hr))
52905295 return hr;

Source/WebKit2/ChangeLog

 12017-06-13 Daniel Bates <dabates@apple.com>
 2
 3 Implement W3C Secure Contexts Draft Specification
 4 https://bugs.webkit.org/show_bug.cgi?id=158121
 5 <rdar://problem/26012994>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Part 4
 10
 11 Adds a preference to toggle the runtime enabled feature flag isSecureContextAttributeEnabled.
 12
 13 * Shared/WebPreferencesDefinitions.h:
 14 * UIProcess/API/C/WKPreferences.cpp:
 15 (WKPreferencesSetIsSecureContextAttributeEnabled):
 16 (WKPreferencesGetIsSecureContextAttributeEnabled):
 17 * UIProcess/API/C/WKPreferencesRefPrivate.h:
 18 * WebProcess/InjectedBundle/InjectedBundle.cpp:
 19 (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
 20 * WebProcess/WebPage/WebPage.cpp:
 21 (WebKit::WebPage::updatePreferences):
 22
1232017-06-13 Wenson Hsieh <wenson_hsieh@apple.com>
224
325 Unable to paste text that was copied from a page into the universal search field

Source/WebKit2/Shared/WebPreferencesDefinitions.h

355355 macro(ConstantPropertiesEnabled, constantPropertiesEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Constant Properties", "Enable CSS constant() properties") \
356356 macro(DisplayContentsEnabled, displayContentsEnabled, Bool, bool, false, "CSS display: contents", "Enable CSS display: contents support") \
357357 macro(SpringTimingFunctionEnabled, springTimingFunctionEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "CSS Spring Animations", "CSS Spring Animation prototype") \
 358 macro(IsSecureContextAttributeEnabled, isSecureContextAttributeEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "isSecureContext attribute", "Enable isSecureContext attribute") \
358359 macro(LinkPreloadEnabled, linkPreloadEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Link Preload", "Link preload support") \
359360 macro(WebRTCLegacyAPIDisabled, webRTCLegacyAPIDisabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Remove Legacy WebRTC API", "Remove Legacy WebRTC API") \
360361 macro(SubresourceIntegrityEnabled, subresourceIntegrityEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "SubresourceIntegrity", "Enable SubresourceIntegrity") \

Source/WebKit2/UIProcess/API/C/WKPreferences.cpp

@@WKStringRef WKPreferencesCopyMediaContentTypesRequiringHardwareSupport(WKPrefere
17811781 return toCopiedAPI(toImpl(preferencesRef)->mediaContentTypesRequiringHardwareSupport());
17821782}
17831783
 1784void WKPreferencesSetIsSecureContextAttributeEnabled(WKPreferencesRef preferencesRef, bool flag)
 1785{
 1786 toImpl(preferencesRef)->setIsSecureContextAttributeEnabled(flag);
 1787}
 1788
 1789bool WKPreferencesGetIsSecureContextAttributeEnabled(WKPreferencesRef preferencesRef)
 1790{
 1791 return toImpl(preferencesRef)->isSecureContextAttributeEnabled();
 1792}

Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h

@@WK_EXPORT bool WKPreferencesGetMediaUserGestureInheritsFromDocument(WKPreference
501501WK_EXPORT void WKPreferencesSetMediaContentTypesRequiringHardwareSupport(WKPreferencesRef, WKStringRef);
502502WK_EXPORT WKStringRef WKPreferencesCopyMediaContentTypesRequiringHardwareSupport(WKPreferencesRef);
503503
 504// Defaults to false.
 505WK_EXPORT void WKPreferencesSetIsSecureContextAttributeEnabled(WKPreferencesRef, bool flag);
 506WK_EXPORT bool WKPreferencesGetIsSecureContextAttributeEnabled(WKPreferencesRef);
 507
504508#ifdef __cplusplus
505509}
506510#endif

Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp

@@void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
224224 RuntimeEnabledFeatures::sharedFeatures().setWebRTCLegacyAPIEnabled(enabled);
225225#endif
226226
 227 if (preference == "WebKitIsSecureContextAttributeEnabled") {
 228 WebPreferencesStore::overrideBoolValueForKey(WebPreferencesKey::isSecureContextAttributeEnabledKey(), enabled);
 229 RuntimeEnabledFeatures::sharedFeatures().setIsSecureContextAttributeEnabled(enabled);
 230 }
 231
227232 // Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
228233#define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
229234 macro(WebKitAcceleratedCompositingEnabled, AcceleratedCompositingEnabled, acceleratedCompositingEnabled) \

Source/WebKit2/WebProcess/WebPage/WebPage.cpp

@@void WebPage::updatePreferences(const WebPreferencesStore& store)
33643364 RuntimeEnabledFeatures::sharedFeatures().setLinkPreloadEnabled(store.getBoolValueForKey(WebPreferencesKey::linkPreloadEnabledKey()));
33653365 RuntimeEnabledFeatures::sharedFeatures().setMediaPreloadingEnabled(store.getBoolValueForKey(WebPreferencesKey::mediaPreloadingEnabledKey()));
33663366 RuntimeEnabledFeatures::sharedFeatures().setCredentialManagementEnabled(store.getBoolValueForKey(WebPreferencesKey::credentialManagementEnabledKey()));
 3367 RuntimeEnabledFeatures::sharedFeatures().setIsSecureContextAttributeEnabled(store.getBoolValueForKey(WebPreferencesKey::isSecureContextAttributeEnabledKey()));
33673368
33683369 bool processSuppressionEnabled = store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey());
33693370 if (m_processSuppressionEnabled != processSuppressionEnabled) {

Tools/ChangeLog

 12017-06-13 Daniel Bates <dabates@apple.com>
 2
 3 Implement W3C Secure Contexts Draft Specification
 4 https://bugs.webkit.org/show_bug.cgi?id=158121
 5 <rdar://problem/26012994>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Part 4
 10
 11 Expose the isSecureContext attribute by default in DumpRenderTree and WebKitTestRunner.
 12 Teach DumpRenderTree for Mac and WebKitTestRunner to parse the test option enableIsSecureContextAttribute
 13 to toggle the runtime enabled feature flag isSecureContextAttributeEnabled.
 14
 15 * DumpRenderTree/TestOptions.h:
 16 * DumpRenderTree/TestOptions.mm:
 17 (TestOptions::TestOptions):
 18 * DumpRenderTree/mac/DumpRenderTree.mm:
 19 (enableExperimentalFeatures):
 20 (setWebPreferencesForTestOptions):
 21 * DumpRenderTree/win/DumpRenderTree.cpp:
 22 (enableExperimentalFeatures):
 23 * WebKitTestRunner/TestController.cpp:
 24 (WTR::TestController::resetPreferencesToConsistentValues):
 25 (WTR::updateTestOptionsFromTestHeader):
 26 * WebKitTestRunner/TestOptions.h:
 27 (WTR::TestOptions::hasSameInitializationOptions):
 28
1292017-06-13 Wenson Hsieh <wenson_hsieh@apple.com>
230
331 Unable to paste text that was copied from a page into the universal search field

Tools/DumpRenderTree/TestOptions.h

@@struct TestOptions {
3535 bool enableCredentialManagement { false };
3636 bool enableDragDestinationActionLoad { false };
3737 bool layerBackedWebView { false };
 38 bool enableIsSecureContextAttribute { false };
3839
3940 TestOptions(NSURL*, const TestCommand&);
4041 bool webViewIsCompatibleWithOptions(const TestOptions&) const;

Tools/DumpRenderTree/TestOptions.mm

@@TestOptions::TestOptions(NSURL *testURL, const TestCommand& command)
9292 this->enableDragDestinationActionLoad = parseBooleanTestHeaderValue(value);
9393 else if (key == "layerBackedWebView")
9494 this->layerBackedWebView = parseBooleanTestHeaderValue(value);
 95 else if (key == "enableIsSecureContextAttribute")
 96 this->enableIsSecureContextAttribute = parseBooleanTestHeaderValue(value);
9597 pairStart = pairEnd + 1;
9698 }
9799}

Tools/DumpRenderTree/mac/DumpRenderTree.mm

@@static void enableExperimentalFeatures(WebPreferences* preferences)
852852 [preferences setCredentialManagementEnabled:YES];
853853 [preferences setReadableByteStreamAPIEnabled:YES];
854854 [preferences setWritableStreamAPIEnabled:YES];
 855 [preferences setIsSecureContextAttributeEnabled:YES];
855856}
856857
857858// Called before each test.

@@static void setWebPreferencesForTestOptions(const TestOptions& options)
974975 preferences.intersectionObserverEnabled = options.enableIntersectionObserver;
975976 preferences.modernMediaControlsEnabled = options.enableModernMediaControls;
976977 preferences.credentialManagementEnabled = options.enableCredentialManagement;
 978 preferences.isSecureContextAttributeEnabled = options.enableIsSecureContextAttribute;
977979}
978980
979981// Called once on DumpRenderTree startup.

Tools/DumpRenderTree/win/DumpRenderTree.cpp

@@static void enableExperimentalFeatures(IWebPreferences* preferences)
781781 prefsPrivate4->setWebAnimationsEnabled(TRUE);
782782 // FIXME: WebGL2
783783 // FIXME: WebRTC
 784 prefsPrivate4->setIsSecureContextAttributeEnabled(TRUE);
784785}
785786
786787static void resetWebPreferencesToConsistentValues(IWebPreferences* preferences)

Tools/WebKitTestRunner/TestController.cpp

@@void TestController::resetPreferencesToConsistentValues(const TestOptions& optio
682682 WKPreferencesSetIntersectionObserverEnabled(preferences, options.enableIntersectionObserver);
683683 WKPreferencesSetModernMediaControlsEnabled(preferences, options.enableModernMediaControls);
684684 WKPreferencesSetCredentialManagementEnabled(preferences, options.enableCredentialManagement);
 685 WKPreferencesSetIsSecureContextAttributeEnabled(preferences, options.enableIsSecureContextAttribute);
685686
686687 static WKStringRef defaultTextEncoding = WKStringCreateWithUTF8CString("ISO-8859-1");
687688 WKPreferencesSetDefaultTextEncodingName(preferences, defaultTextEncoding);

@@static void updateTestOptionsFromTestHeader(TestOptions& testOptions, const std:
10161017 testOptions.enablePointerLock = parseBooleanTestHeaderValue(value);
10171018 if (key == "enableCredentialManagement")
10181019 testOptions.enableCredentialManagement = parseBooleanTestHeaderValue(value);
 1020 if (key == "enableIsSecureContextAttribute")
 1021 testOptions.enableIsSecureContextAttribute = parseBooleanTestHeaderValue(value);
10191022 pairStart = pairEnd + 1;
10201023 }
10211024}

Tools/WebKitTestRunner/TestOptions.h

@@struct TestOptions {
4747 bool enableModernMediaControls { true };
4848 bool enablePointerLock { false };
4949 bool enableCredentialManagement { false };
 50 bool enableIsSecureContextAttribute { true };
5051
5152 float deviceScaleFactor { 1 };
5253 Vector<String> overrideLanguages;

@@struct TestOptions {
6768 || enableIntersectionObserver != options.enableIntersectionObserver
6869 || enableModernMediaControls != options.enableModernMediaControls
6970 || enablePointerLock != options.enablePointerLock
70  || enableCredentialManagement != options.enableCredentialManagement)
 71 || enableCredentialManagement != options.enableCredentialManagement
 72 || enableIsSecureContextAttribute != options.enableIsSecureContextAttribute)
7173 return false;
7274
7375 return true;