2 * Copyright (C) 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #include "BackForwardController.h"
30 #include "CachedResourceLoader.h"
31 #include "CookieStorage.h"
36 #include "FrameTree.h"
37 #include "FrameView.h"
38 #include "HistoryItem.h"
40 #include "PageCache.h"
41 #include "ResourceHandle.h"
42 #include "StorageMap.h"
49 static void setLoadsImagesAutomaticallyInAllFrames(Page* page)
51 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
52 frame->document()->cachedResourceLoader()->setAutoLoadImages(page->settings()->loadsImagesAutomatically());
55 static inline void setGenericFontFamilyMap(ScriptFontFamilyMap& fontMap, const AtomicString& family, UScriptCode script, Page* page)
57 ScriptFontFamilyMap::iterator it = fontMap.find(static_cast<int>(script));
58 if (it != fontMap.end() && it->second == family)
60 fontMap.set(static_cast<int>(script), family);
61 page->setNeedsRecalcStyleInAllFrames();
64 static inline const AtomicString& getGenericFontFamilyForScript(const ScriptFontFamilyMap& fontMap, UScriptCode script)
66 ScriptFontFamilyMap::const_iterator it = fontMap.find(static_cast<int>(script));
67 if (it != fontMap.end())
69 if (script != USCRIPT_COMMON)
70 return getGenericFontFamilyForScript(fontMap, USCRIPT_COMMON);
75 bool Settings::gShouldPaintNativeControls = true;
79 bool Settings::gAVFoundationEnabled(false);
82 bool Settings::gMockScrollbarsEnabled = false;
84 #if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
85 bool Settings::gShouldUseHighResolutionTimers = true;
88 #if ENABLE(TIZEN_CSS_FIXED_AS_ABSOLUTE)
89 bool Settings::m_fixedAsAbsoluteEnabled = false;
93 // 1) EditingMacBehavior comprises Tiger, Leopard, SnowLeopard and iOS builds, as well QtWebKit and Chromium when built on Mac;
94 // 2) EditingWindowsBehavior comprises Win32 and WinCE builds, as well as QtWebKit and Chromium when built on Windows;
95 // 3) EditingUnixBehavior comprises all unix-based systems, but Darwin/MacOS (and then abusing the terminology);
96 // 99) MacEditingBehavior is used a fallback.
97 static EditingBehaviorType editingBehaviorTypeForPlatform()
103 EditingWindowsBehavior
113 Settings::Settings(Page* page)
115 , m_editableLinkBehavior(EditableLinkDefaultBehavior)
116 , m_textDirectionSubmenuInclusionBehavior(TextDirectionSubmenuAutomaticallyIncluded)
117 , m_passwordEchoDurationInSeconds(1)
118 , m_minimumFontSize(0)
119 , m_minimumLogicalFontSize(0)
120 , m_defaultFontSize(0)
121 , m_defaultFixedFontSize(0)
122 , m_validationMessageTimerMagnification(50)
123 , m_minimumAccelerated2dCanvasSize(128 * 128)
124 , m_layoutFallbackWidth(980)
126 , m_maximumDecodedImageSize(numeric_limits<size_t>::max())
128 , m_deviceHeight(854)
129 , m_sessionStorageQuota(StorageMap::noQuota)
130 , m_editingBehaviorType(editingBehaviorTypeForPlatform())
131 , m_maximumHTMLParserDOMTreeDepth(defaultMaximumHTMLParserDOMTreeDepth)
132 , m_isSpatialNavigationEnabled(false)
133 , m_isJavaEnabled(false)
134 , m_loadsImagesAutomatically(false)
135 , m_loadsSiteIconsIgnoringImageLoadingSetting(false)
136 , m_privateBrowsingEnabled(false)
137 , m_caretBrowsingEnabled(false)
138 , m_areImagesEnabled(true)
139 , m_isMediaEnabled(true)
140 , m_arePluginsEnabled(false)
141 , m_localStorageEnabled(false)
142 , m_isScriptEnabled(false)
143 , m_isWebSecurityEnabled(true)
144 , m_allowUniversalAccessFromFileURLs(true)
145 , m_allowFileAccessFromFileURLs(true)
146 , m_javaScriptCanOpenWindowsAutomatically(false)
147 , m_javaScriptCanAccessClipboard(false)
148 , m_shouldPrintBackgrounds(false)
149 , m_textAreasAreResizable(false)
150 #if ENABLE(DASHBOARD_SUPPORT)
151 , m_usesDashboardBackwardCompatibilityMode(false)
153 , m_needsAdobeFrameReloadingQuirk(false)
154 , m_needsKeyboardEventDisambiguationQuirks(false)
155 , m_treatsAnyTextCSSLinkAsStylesheet(false)
156 , m_needsLeopardMailQuirks(false)
157 , m_isDOMPasteAllowed(false)
158 , m_shrinksStandaloneImagesToFit(true)
159 , m_usesPageCache(false)
160 , m_showsURLsInToolTips(false)
161 , m_showsToolTipOverTruncatedText(false)
162 , m_forceFTPDirectoryListings(false)
163 , m_developerExtrasEnabled(false)
164 , m_authorAndUserStylesEnabled(true)
165 , m_needsSiteSpecificQuirks(false)
166 , m_fontRenderingMode(0)
167 , m_frameFlatteningEnabled(false)
168 , m_webArchiveDebugModeEnabled(false)
169 , m_localFileContentSniffingEnabled(false)
170 , m_inApplicationChromeMode(false)
171 , m_offlineWebApplicationCacheEnabled(false)
172 , m_enforceCSSMIMETypeInNoQuirksMode(true)
173 , m_usesEncodingDetector(false)
174 , m_allowScriptsToCloseWindows(false)
175 , m_canvasUsesAcceleratedDrawing(false)
176 , m_acceleratedDrawingEnabled(false)
177 // FIXME: This should really be disabled by default as it makes platforms that don't support the feature download files
178 // they can't use by. Leaving enabled for now to not change existing behavior.
179 , m_downloadableBinaryFontsEnabled(true)
180 , m_xssAuditorEnabled(false)
181 , m_acceleratedCompositingEnabled(true)
182 , m_acceleratedCompositingFor3DTransformsEnabled(true)
183 , m_acceleratedCompositingForVideoEnabled(true)
184 , m_acceleratedCompositingForPluginsEnabled(true)
185 , m_acceleratedCompositingForCanvasEnabled(true)
186 , m_acceleratedCompositingForAnimationEnabled(true)
187 , m_acceleratedCompositingForFixedPositionEnabled(false)
188 , m_acceleratedCompositingForScrollableFramesEnabled(false)
189 , m_showDebugBorders(false)
190 , m_showRepaintCounter(false)
191 , m_experimentalNotificationsEnabled(false)
192 , m_webGLEnabled(false)
193 , m_openGLMultisamplingEnabled(true)
194 , m_privilegedWebGLExtensionsEnabled(false)
195 , m_webAudioEnabled(false)
196 , m_acceleratedCanvas2dEnabled(false)
197 , m_legacyAcceleratedCanvas2dEnabled(false)
198 , m_loadDeferringEnabled(true)
199 , m_tiledBackingStoreEnabled(false)
200 , m_paginateDuringLayoutEnabled(false)
201 , m_dnsPrefetchingEnabled(false)
202 #if ENABLE(FULLSCREEN_API)
203 , m_fullScreenAPIEnabled(false)
205 , m_asynchronousSpellCheckingEnabled(false)
206 #if USE(UNIFIED_TEXT_CHECKING)
207 , m_unifiedTextCheckerEnabled(true)
209 , m_unifiedTextCheckerEnabled(false)
211 , m_memoryInfoEnabled(false)
212 , m_interactiveFormValidation(false)
213 , m_usePreHTML5ParserQuirks(false)
214 , m_hyperlinkAuditingEnabled(false)
215 , m_crossOriginCheckInGetMatchedCSSRulesDisabled(false)
216 #if ENABLE(TIZEN_GEOLOCATION)
217 , m_isGeolocationEnabled(false)
219 #if ENABLE(TIZEN_FOCUS_RING)
220 , m_isFocusRingEnabled(true)
222 , m_forceCompositingMode(false)
223 , m_shouldInjectUserScriptsInInitialEmptyDocument(false)
224 , m_allowDisplayOfInsecureContent(true)
225 , m_allowRunningOfInsecureContent(true)
226 #if ENABLE(SMOOTH_SCROLLING)
227 , m_scrollAnimatorEnabled(true)
229 #if ENABLE(WEB_SOCKETS)
230 , m_useHixie76WebSocketProtocol(true)
232 , m_mediaPlaybackRequiresUserGesture(false)
233 , m_mediaPlaybackAllowsInline(true)
235 , m_passwordEchoEnabled(true)
237 , m_passwordEchoEnabled(false)
239 , m_suppressIncrementalRendering(false)
240 , m_backspaceKeyNavigationEnabled(true)
241 , m_visualWordMovementEnabled(false)
242 , m_loadsImagesAutomaticallyTimer(this, &Settings::loadsImagesAutomaticallyTimerFired)
243 #if ENABLE(TIZEN_ONSCROLL_EVENT_SUPPRESSION)
244 , m_onscrollEventSuppressionEnabled(false)
246 #if ENABLE(TIZEN_CSS_FIXED_FAST_PATH)
247 , m_fixedFastPathImprovementsEnabled(true)
250 // A Frame may not have been created yet, so we initialize the AtomicString
251 // hash before trying to use it.
252 AtomicString::init();
255 const AtomicString& Settings::standardFontFamily(UScriptCode script) const
257 return getGenericFontFamilyForScript(m_standardFontFamilyMap, script);
260 void Settings::setStandardFontFamily(const AtomicString& family, UScriptCode script)
262 setGenericFontFamilyMap(m_standardFontFamilyMap, family, script, m_page);
265 const AtomicString& Settings::fixedFontFamily(UScriptCode script) const
267 return getGenericFontFamilyForScript(m_fixedFontFamilyMap, script);
270 void Settings::setFixedFontFamily(const AtomicString& family, UScriptCode script)
272 setGenericFontFamilyMap(m_fixedFontFamilyMap, family, script, m_page);
275 const AtomicString& Settings::serifFontFamily(UScriptCode script) const
277 return getGenericFontFamilyForScript(m_serifFontFamilyMap, script);
280 void Settings::setSerifFontFamily(const AtomicString& family, UScriptCode script)
282 setGenericFontFamilyMap(m_serifFontFamilyMap, family, script, m_page);
285 const AtomicString& Settings::sansSerifFontFamily(UScriptCode script) const
287 return getGenericFontFamilyForScript(m_sansSerifFontFamilyMap, script);
290 void Settings::setSansSerifFontFamily(const AtomicString& family, UScriptCode script)
292 setGenericFontFamilyMap(m_sansSerifFontFamilyMap, family, script, m_page);
295 const AtomicString& Settings::cursiveFontFamily(UScriptCode script) const
297 return getGenericFontFamilyForScript(m_cursiveFontFamilyMap, script);
300 void Settings::setCursiveFontFamily(const AtomicString& family, UScriptCode script)
302 setGenericFontFamilyMap(m_cursiveFontFamilyMap, family, script, m_page);
305 const AtomicString& Settings::fantasyFontFamily(UScriptCode script) const
307 return getGenericFontFamilyForScript(m_fantasyFontFamilyMap, script);
310 void Settings::setFantasyFontFamily(const AtomicString& family, UScriptCode script)
312 setGenericFontFamilyMap(m_fantasyFontFamilyMap, family, script, m_page);
315 const AtomicString& Settings::pictographFontFamily(UScriptCode script) const
317 return getGenericFontFamilyForScript(m_pictographFontFamilyMap, script);
320 void Settings::setPictographFontFamily(const AtomicString& family, UScriptCode script)
322 setGenericFontFamilyMap(m_pictographFontFamilyMap, family, script, m_page);
325 void Settings::setMinimumFontSize(int minimumFontSize)
327 if (m_minimumFontSize == minimumFontSize)
330 m_minimumFontSize = minimumFontSize;
331 m_page->setNeedsRecalcStyleInAllFrames();
334 void Settings::setMinimumLogicalFontSize(int minimumLogicalFontSize)
336 if (m_minimumLogicalFontSize == minimumLogicalFontSize)
339 m_minimumLogicalFontSize = minimumLogicalFontSize;
340 m_page->setNeedsRecalcStyleInAllFrames();
343 void Settings::setDefaultFontSize(int defaultFontSize)
345 if (m_defaultFontSize == defaultFontSize)
348 m_defaultFontSize = defaultFontSize;
349 m_page->setNeedsRecalcStyleInAllFrames();
352 void Settings::setDefaultFixedFontSize(int defaultFontSize)
354 if (m_defaultFixedFontSize == defaultFontSize)
357 m_defaultFixedFontSize = defaultFontSize;
358 m_page->setNeedsRecalcStyleInAllFrames();
361 void Settings::setLoadsImagesAutomatically(bool loadsImagesAutomatically)
363 m_loadsImagesAutomatically = loadsImagesAutomatically;
365 // Changing this setting to true might immediately start new loads for images that had previously had loading disabled.
366 // If this happens while a WebView is being dealloc'ed, and we don't know the WebView is being dealloc'ed, these new loads
367 // can cause crashes downstream when the WebView memory has actually been free'd.
368 // One example where this can happen is in Mac apps that subclass WebView then do work in their overridden dealloc methods.
369 // Starting these loads synchronously is not important. By putting it on a 0-delay, properly closing the Page cancels them
370 // before they have a chance to really start.
371 // See http://webkit.org/b/60572 for more discussion.
372 m_loadsImagesAutomaticallyTimer.startOneShot(0);
375 void Settings::loadsImagesAutomaticallyTimerFired(Timer<Settings>*)
377 setLoadsImagesAutomaticallyInAllFrames(m_page);
380 void Settings::setLoadsSiteIconsIgnoringImageLoadingSetting(bool loadsSiteIcons)
382 m_loadsSiteIconsIgnoringImageLoadingSetting = loadsSiteIcons;
385 void Settings::setScriptEnabled(bool isScriptEnabled)
387 m_isScriptEnabled = isScriptEnabled;
390 void Settings::setWebSecurityEnabled(bool isWebSecurityEnabled)
392 m_isWebSecurityEnabled = isWebSecurityEnabled;
395 void Settings::setAllowUniversalAccessFromFileURLs(bool allowUniversalAccessFromFileURLs)
397 m_allowUniversalAccessFromFileURLs = allowUniversalAccessFromFileURLs;
400 void Settings::setAllowFileAccessFromFileURLs(bool allowFileAccessFromFileURLs)
402 m_allowFileAccessFromFileURLs = allowFileAccessFromFileURLs;
405 void Settings::setSpatialNavigationEnabled(bool isSpatialNavigationEnabled)
407 m_isSpatialNavigationEnabled = isSpatialNavigationEnabled;
410 void Settings::setJavaEnabled(bool isJavaEnabled)
412 m_isJavaEnabled = isJavaEnabled;
415 void Settings::setImagesEnabled(bool areImagesEnabled)
417 m_areImagesEnabled = areImagesEnabled;
420 void Settings::setMediaEnabled(bool isMediaEnabled)
422 m_isMediaEnabled = isMediaEnabled;
425 void Settings::setPluginsEnabled(bool arePluginsEnabled)
427 m_arePluginsEnabled = arePluginsEnabled;
430 void Settings::setLocalStorageEnabled(bool localStorageEnabled)
432 m_localStorageEnabled = localStorageEnabled;
435 void Settings::setSessionStorageQuota(unsigned sessionStorageQuota)
437 m_sessionStorageQuota = sessionStorageQuota;
440 void Settings::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
442 // FIXME http://webkit.org/b/67870: The private browsing storage session and cookie private
443 // browsing mode (which is used if storage sessions are not available) are global settings, so
444 // it is misleading to have them as per-page settings.
445 // In addition, if they are treated as a per Page settings, the global values can get out of
446 // sync with the per Page value in the following situation:
447 // 1. The global values get set to true when setPrivateBrowsingEnabled(true) is called.
448 // 2. All Pages are closed, so all Settings objects go away.
449 // 3. A new Page is created, and a corresponding new Settings object is created - with
450 // m_privateBrowsingEnabled starting out as false in the constructor.
451 // 4. The WebPage settings get applied to the new Page and setPrivateBrowsingEnabled(false)
452 // is called, but an if (m_privateBrowsingEnabled == privateBrowsingEnabled) early return
453 // prevents the global values from getting changed from true to false.
454 #if USE(CFURLSTORAGESESSIONS)
455 ResourceHandle::setPrivateBrowsingEnabled(privateBrowsingEnabled);
457 setCookieStoragePrivateBrowsingEnabled(privateBrowsingEnabled);
459 if (m_privateBrowsingEnabled == privateBrowsingEnabled)
462 m_privateBrowsingEnabled = privateBrowsingEnabled;
463 m_page->privateBrowsingStateChanged();
466 void Settings::setJavaScriptCanOpenWindowsAutomatically(bool javaScriptCanOpenWindowsAutomatically)
468 m_javaScriptCanOpenWindowsAutomatically = javaScriptCanOpenWindowsAutomatically;
471 void Settings::setJavaScriptCanAccessClipboard(bool javaScriptCanAccessClipboard)
473 m_javaScriptCanAccessClipboard = javaScriptCanAccessClipboard;
476 void Settings::setDefaultTextEncodingName(const String& defaultTextEncodingName)
478 m_defaultTextEncodingName = defaultTextEncodingName;
481 void Settings::setUserStyleSheetLocation(const KURL& userStyleSheetLocation)
483 if (m_userStyleSheetLocation == userStyleSheetLocation)
486 m_userStyleSheetLocation = userStyleSheetLocation;
488 m_page->userStyleSheetLocationChanged();
491 void Settings::setShouldPrintBackgrounds(bool shouldPrintBackgrounds)
493 m_shouldPrintBackgrounds = shouldPrintBackgrounds;
496 void Settings::setTextAreasAreResizable(bool textAreasAreResizable)
498 if (m_textAreasAreResizable == textAreasAreResizable)
501 m_textAreasAreResizable = textAreasAreResizable;
502 m_page->setNeedsRecalcStyleInAllFrames();
505 void Settings::setEditableLinkBehavior(EditableLinkBehavior editableLinkBehavior)
507 m_editableLinkBehavior = editableLinkBehavior;
510 void Settings::setTextDirectionSubmenuInclusionBehavior(TextDirectionSubmenuInclusionBehavior behavior)
512 m_textDirectionSubmenuInclusionBehavior = behavior;
515 #if ENABLE(DASHBOARD_SUPPORT)
516 void Settings::setUsesDashboardBackwardCompatibilityMode(bool usesDashboardBackwardCompatibilityMode)
518 m_usesDashboardBackwardCompatibilityMode = usesDashboardBackwardCompatibilityMode;
522 // FIXME: This quirk is needed because of Radar 4674537 and 5211271. We need to phase it out once Adobe
523 // can fix the bug from their end.
524 void Settings::setNeedsAdobeFrameReloadingQuirk(bool shouldNotReloadIFramesForUnchangedSRC)
526 m_needsAdobeFrameReloadingQuirk = shouldNotReloadIFramesForUnchangedSRC;
529 // This is a quirk we are pro-actively applying to old applications. It changes keyboard event dispatching,
530 // making keyIdentifier available on keypress events, making charCode available on keydown/keyup events,
531 // and getting keypress dispatched in more cases.
532 void Settings::setNeedsKeyboardEventDisambiguationQuirks(bool needsQuirks)
534 m_needsKeyboardEventDisambiguationQuirks = needsQuirks;
537 void Settings::setTreatsAnyTextCSSLinkAsStylesheet(bool treatsAnyTextCSSLinkAsStylesheet)
539 m_treatsAnyTextCSSLinkAsStylesheet = treatsAnyTextCSSLinkAsStylesheet;
542 void Settings::setNeedsLeopardMailQuirks(bool needsQuirks)
544 m_needsLeopardMailQuirks = needsQuirks;
547 void Settings::setDOMPasteAllowed(bool DOMPasteAllowed)
549 m_isDOMPasteAllowed = DOMPasteAllowed;
552 void Settings::setDefaultMinDOMTimerInterval(double interval)
554 DOMTimer::setDefaultMinTimerInterval(interval);
557 double Settings::defaultMinDOMTimerInterval()
559 return DOMTimer::defaultMinTimerInterval();
562 void Settings::setMinDOMTimerInterval(double interval)
564 m_page->setMinimumTimerInterval(interval);
567 double Settings::minDOMTimerInterval()
569 return m_page->minimumTimerInterval();
572 void Settings::setUsesPageCache(bool usesPageCache)
574 if (m_usesPageCache == usesPageCache)
577 m_usesPageCache = usesPageCache;
578 if (!m_usesPageCache) {
579 int first = -m_page->backForward()->backCount();
580 int last = m_page->backForward()->forwardCount();
581 for (int i = first; i <= last; i++)
582 pageCache()->remove(m_page->backForward()->itemAtIndex(i));
583 pageCache()->releaseAutoreleasedPagesNow();
587 void Settings::setShrinksStandaloneImagesToFit(bool shrinksStandaloneImagesToFit)
589 m_shrinksStandaloneImagesToFit = shrinksStandaloneImagesToFit;
592 void Settings::setShowsURLsInToolTips(bool showsURLsInToolTips)
594 m_showsURLsInToolTips = showsURLsInToolTips;
597 void Settings::setShowsToolTipOverTruncatedText(bool showsToolTipForTruncatedText)
599 m_showsToolTipOverTruncatedText = showsToolTipForTruncatedText;
602 void Settings::setFTPDirectoryTemplatePath(const String& path)
604 m_ftpDirectoryTemplatePath = path;
607 void Settings::setForceFTPDirectoryListings(bool force)
609 m_forceFTPDirectoryListings = force;
612 void Settings::setDeveloperExtrasEnabled(bool developerExtrasEnabled)
614 m_developerExtrasEnabled = developerExtrasEnabled;
617 void Settings::setAuthorAndUserStylesEnabled(bool authorAndUserStylesEnabled)
619 if (m_authorAndUserStylesEnabled == authorAndUserStylesEnabled)
622 m_authorAndUserStylesEnabled = authorAndUserStylesEnabled;
623 m_page->setNeedsRecalcStyleInAllFrames();
626 void Settings::setFontRenderingMode(FontRenderingMode mode)
628 if (fontRenderingMode() == mode)
630 m_fontRenderingMode = mode;
631 m_page->setNeedsRecalcStyleInAllFrames();
634 FontRenderingMode Settings::fontRenderingMode() const
636 return static_cast<FontRenderingMode>(m_fontRenderingMode);
639 void Settings::setNeedsSiteSpecificQuirks(bool needsQuirks)
641 m_needsSiteSpecificQuirks = needsQuirks;
644 void Settings::setFrameFlatteningEnabled(bool frameFlatteningEnabled)
646 m_frameFlatteningEnabled = frameFlatteningEnabled;
649 #if ENABLE(WEB_ARCHIVE)
650 void Settings::setWebArchiveDebugModeEnabled(bool enabled)
652 m_webArchiveDebugModeEnabled = enabled;
656 void Settings::setLocalFileContentSniffingEnabled(bool enabled)
658 m_localFileContentSniffingEnabled = enabled;
661 void Settings::setLocalStorageDatabasePath(const String& path)
663 m_localStorageDatabasePath = path;
666 void Settings::setApplicationChromeMode(bool mode)
668 m_inApplicationChromeMode = mode;
671 void Settings::setOfflineWebApplicationCacheEnabled(bool enabled)
673 m_offlineWebApplicationCacheEnabled = enabled;
676 void Settings::setEnforceCSSMIMETypeInNoQuirksMode(bool enforceCSSMIMETypeInNoQuirksMode)
678 m_enforceCSSMIMETypeInNoQuirksMode = enforceCSSMIMETypeInNoQuirksMode;
681 #if USE(SAFARI_THEME)
682 void Settings::setShouldPaintNativeControls(bool shouldPaintNativeControls)
684 gShouldPaintNativeControls = shouldPaintNativeControls;
688 void Settings::setUsesEncodingDetector(bool usesEncodingDetector)
690 m_usesEncodingDetector = usesEncodingDetector;
693 void Settings::setDNSPrefetchingEnabled(bool dnsPrefetchingEnabled)
695 if (m_dnsPrefetchingEnabled == dnsPrefetchingEnabled)
698 m_dnsPrefetchingEnabled = dnsPrefetchingEnabled;
699 m_page->dnsPrefetchingStateChanged();
702 void Settings::setAllowScriptsToCloseWindows(bool allowScriptsToCloseWindows)
704 m_allowScriptsToCloseWindows = allowScriptsToCloseWindows;
707 void Settings::setCaretBrowsingEnabled(bool caretBrowsingEnabled)
709 m_caretBrowsingEnabled = caretBrowsingEnabled;
712 void Settings::setDownloadableBinaryFontsEnabled(bool downloadableBinaryFontsEnabled)
714 m_downloadableBinaryFontsEnabled = downloadableBinaryFontsEnabled;
717 void Settings::setXSSAuditorEnabled(bool xssAuditorEnabled)
719 m_xssAuditorEnabled = xssAuditorEnabled;
722 void Settings::setAcceleratedCompositingEnabled(bool enabled)
724 if (m_acceleratedCompositingEnabled == enabled)
727 m_acceleratedCompositingEnabled = enabled;
728 m_page->setNeedsRecalcStyleInAllFrames();
731 void Settings::setCanvasUsesAcceleratedDrawing(bool enabled)
733 m_canvasUsesAcceleratedDrawing = enabled;
736 void Settings::setAcceleratedCompositingFor3DTransformsEnabled(bool enabled)
738 m_acceleratedCompositingFor3DTransformsEnabled = enabled;
741 void Settings::setAcceleratedCompositingForVideoEnabled(bool enabled)
743 m_acceleratedCompositingForVideoEnabled = enabled;
746 void Settings::setAcceleratedCompositingForPluginsEnabled(bool enabled)
748 m_acceleratedCompositingForPluginsEnabled = enabled;
751 void Settings::setAcceleratedCompositingForCanvasEnabled(bool enabled)
753 m_acceleratedCompositingForCanvasEnabled = enabled;
756 void Settings::setAcceleratedCompositingForAnimationEnabled(bool enabled)
758 m_acceleratedCompositingForAnimationEnabled = enabled;
761 void Settings::setShowDebugBorders(bool enabled)
763 if (m_showDebugBorders == enabled)
766 m_showDebugBorders = enabled;
767 m_page->setNeedsRecalcStyleInAllFrames();
770 void Settings::setShowRepaintCounter(bool enabled)
772 if (m_showRepaintCounter == enabled)
775 m_showRepaintCounter = enabled;
776 m_page->setNeedsRecalcStyleInAllFrames();
779 void Settings::setExperimentalNotificationsEnabled(bool enabled)
781 m_experimentalNotificationsEnabled = enabled;
784 #if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
785 void Settings::setShouldUseHighResolutionTimers(bool shouldUseHighResolutionTimers)
787 gShouldUseHighResolutionTimers = shouldUseHighResolutionTimers;
791 void Settings::setWebAudioEnabled(bool enabled)
793 m_webAudioEnabled = enabled;
796 void Settings::setWebGLEnabled(bool enabled)
798 m_webGLEnabled = enabled;
801 void Settings::setOpenGLMultisamplingEnabled(bool enabled)
803 m_openGLMultisamplingEnabled = enabled;
806 void Settings::setPrivilegedWebGLExtensionsEnabled(bool enabled)
808 m_privilegedWebGLExtensionsEnabled = enabled;
811 void Settings::setAccelerated2dCanvasEnabled(bool enabled)
813 m_acceleratedCanvas2dEnabled = enabled;
816 void Settings::setLegacyAccelerated2dCanvasEnabled(bool enabled)
818 m_legacyAcceleratedCanvas2dEnabled = enabled;
821 void Settings::setMinimumAccelerated2dCanvasSize(int numPixels)
823 m_minimumAccelerated2dCanvasSize = numPixels;
826 void Settings::setLoadDeferringEnabled(bool enabled)
828 m_loadDeferringEnabled = enabled;
831 void Settings::setTiledBackingStoreEnabled(bool enabled)
833 m_tiledBackingStoreEnabled = enabled;
834 #if USE(TILED_BACKING_STORE)
835 if (m_page->mainFrame())
836 m_page->mainFrame()->setTiledBackingStoreEnabled(enabled);
840 #if ENABLE(TIZEN_GEOLOCATION)
841 void Settings::setGeolocationEnabled(bool isGeolocationEnabled)
843 m_isGeolocationEnabled = isGeolocationEnabled;
847 void Settings::setMockScrollbarsEnabled(bool flag)
849 gMockScrollbarsEnabled = flag;
852 bool Settings::mockScrollbarsEnabled()
854 return gMockScrollbarsEnabled;
856 #if ENABLE(TIZEN_FOCUS_RING)
857 void Settings::setFocusRingEnabled(bool isFocusRingEnabled)
859 m_isFocusRingEnabled = isFocusRingEnabled;
864 } // namespace WebCore