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.