Changeset 146664 in webkit
- Timestamp:
- Mar 22, 2013 3:19:52 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r146661 r146664 1 2013-03-21 Geoffrey Garen <ggaren@apple.com> 2 3 Added a setting for whether JavaScript markup is enabled 4 https://bugs.webkit.org/show_bug.cgi?id=112999 5 6 Reviewed by Maciej Stachowiak. 7 8 This setting is useful for clients that want protection from script 9 injection attacks. 10 11 * page/Settings.h: 12 (Settings): Clarified which clients should call canExecuteScripts(). 13 14 * page/Settings.in: Added the new setting. 15 1 16 2013-03-22 Roger Fong <roger_fong@apple.com> 2 17 -
trunk/Source/WebCore/page/Settings.h
r145003 r146664 120 120 bool loadsImagesAutomatically() const { return m_loadsImagesAutomatically; } 121 121 122 // Clients that execute script should call ScriptController::canExecuteScripts() 123 // instead of this function. ScriptController::canExecuteScripts() checks the 124 // HTML sandbox, plug-in sandboxing, and other important details. 125 bool isScriptEnabled() const { return m_isScriptEnabled; } 122 126 void setScriptEnabled(bool); 123 // Instead of calling isScriptEnabled directly, please consider calling124 // ScriptController::canExecuteScripts, which takes things like the125 // HTML sandbox attribute into account.126 bool isScriptEnabled() const { return m_isScriptEnabled; }127 127 128 128 SETTINGS_GETTERS_AND_SETTERS -
trunk/Source/WebCore/page/Settings.in
r146351 r146664 77 77 developerExtrasEnabled initial=false 78 78 javaScriptExperimentsEnabled initial=false 79 scriptMarkupEnabled initial=true 79 80 needsSiteSpecificQuirks initial=false 80 81 webArchiveDebugModeEnabled initial=false, conditional=WEB_ARCHIVE -
trunk/Source/WebKit2/ChangeLog
r146637 r146664 1 2013-03-21 Geoffrey Garen <ggaren@apple.com> 2 3 Added a setting for whether JavaScript markup is enabled 4 https://bugs.webkit.org/show_bug.cgi?id=112999 5 6 Reviewed by Maciej Stachowiak. 7 8 This setting is useful for clients that want protection from script 9 injection attacks. 10 11 * Shared/WebPreferencesStore.h: 12 * UIProcess/API/C/WKPreferences.cpp: 13 (WKPreferencesGetJavaScriptMarkupEnabled): 14 (WKPreferencesSetJavaScriptMarkupEnabled): 15 (WKPreferencesGetJavaScriptEnabled): 16 * UIProcess/API/C/WKPreferences.h: 17 * UIProcess/API/mac/WKBrowsingContextGroup.mm: 18 (-[WKBrowsingContextGroup allowsJavaScriptMarkup]): 19 (-[WKBrowsingContextGroup setAllowsJavaScriptMarkup:]): 20 * WebProcess/InjectedBundle/InjectedBundle.cpp: 21 (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 22 * WebProcess/WebPage/WebPage.cpp: 23 (WebKit::WebPage::updatePreferences): Plumbed through to API. 24 1 25 2013-03-22 Mario Sanchez Prada <mario.prada@samsung.com> 2 26 -
trunk/Source/WebKit2/Shared/WebPreferencesStore.h
r145961 r146664 57 57 #define FOR_EACH_WEBKIT_BOOL_PREFERENCE(macro) \ 58 58 macro(JavaScriptEnabled, javaScriptEnabled, Bool, bool, true) \ 59 macro(JavaScriptMarkupEnabled, javaScriptMarkupEnabled, Bool, bool, true) \ 59 60 macro(LoadsImagesAutomatically, loadsImagesAutomatically, Bool, bool, true) \ 60 61 macro(LoadsSiteIconsIgnoringImageLoadingPreference, loadsSiteIconsIgnoringImageLoadingPreference, Bool, bool, false) \ -
trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
r145386 r146664 70 70 } 71 71 72 void WKPreferencesSetJavaScriptMarkupEnabled(WKPreferencesRef preferencesRef, bool javaScriptMarkupEnabled) 73 { 74 toImpl(preferencesRef)->setJavaScriptMarkupEnabled(javaScriptMarkupEnabled); 75 } 76 77 bool WKPreferencesGetJavaScriptMarkupEnabled(WKPreferencesRef preferencesRef) 78 { 79 return toImpl(preferencesRef)->javaScriptMarkupEnabled(); 80 } 81 72 82 void WKPreferencesSetLoadsImagesAutomatically(WKPreferencesRef preferencesRef, bool loadsImagesAutomatically) 73 83 { -
trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.h
r144752 r146664 54 54 55 55 // Defaults to true. 56 WK_EXPORT void WKPreferencesSetJavaScriptMarkupEnabled(WKPreferencesRef preferences, bool javaScriptEnabled); 57 WK_EXPORT bool WKPreferencesGetJavaScriptMarkupEnabled(WKPreferencesRef preferences); 58 59 // Defaults to true. 56 60 WK_EXPORT void WKPreferencesSetLoadsImagesAutomatically(WKPreferencesRef preferences, bool loadsImagesAutomatically); 57 61 WK_EXPORT bool WKPreferencesGetLoadsImagesAutomatically(WKPreferencesRef preferences); -
trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm
r144777 r146664 74 74 { 75 75 WKPreferencesSetJavaScriptEnabled(WKPageGroupGetPreferences(self._pageGroupRef), allowsJavaScript); 76 } 77 78 - (BOOL)allowsJavaScriptMarkup 79 { 80 return WKPreferencesGetJavaScriptMarkupEnabled(WKPageGroupGetPreferences(self._pageGroupRef)); 81 } 82 83 - (void)setAllowsJavaScriptMarkup:(BOOL)allowsJavaScriptMarkup 84 { 85 WKPreferencesSetJavaScriptMarkupEnabled(WKPageGroupGetPreferences(self._pageGroupRef), allowsJavaScriptMarkup); 76 86 } 77 87 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
r145784 r146664 212 212 macro(WebKitJavaEnabled, JavaEnabled, javaEnabled) \ 213 213 macro(WebKitJavaScriptEnabled, ScriptEnabled, javaScriptEnabled) \ 214 macro(WebKitJavaScriptMarkupEnabled, ScriptEnabled, javaScriptEnabled) \ 214 215 macro(WebKitLoadSiteIconsKey, LoadsSiteIconsIgnoringImageLoadingSetting, loadsSiteIconsIgnoringImageLoadingPreference) \ 215 216 macro(WebKitOfflineWebApplicationCacheEnabled, OfflineWebApplicationCacheEnabled, offlineWebApplicationCacheEnabled) \ -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r146551 r146664 2269 2269 2270 2270 settings->setScriptEnabled(store.getBoolValueForKey(WebPreferencesKey::javaScriptEnabledKey())); 2271 settings->setScriptMarkupEnabled(store.getBoolValueForKey(WebPreferencesKey::javaScriptMarkupEnabledKey())); 2271 2272 settings->setLoadsImagesAutomatically(store.getBoolValueForKey(WebPreferencesKey::loadsImagesAutomaticallyKey())); 2272 2273 settings->setLoadsSiteIconsIgnoringImageLoadingSetting(store.getBoolValueForKey(WebPreferencesKey::loadsSiteIconsIgnoringImageLoadingPreferenceKey()));
Note: See TracChangeset
for help on using the changeset viewer.