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 #if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
83 bool Settings::gShouldUseHighResolutionTimers = true;
87 // 1) EditingMacBehavior comprises Tiger, Leopard, SnowLeopard and iOS builds, as well QtWebKit and Chromium when built on Mac;
88 // 2) EditingWindowsBehavior comprises Win32 and WinCE builds, as well as QtWebKit and Chromium when built on Windows;
89 // 3) EditingUnixBehavior comprises all unix-based systems, but Darwin/MacOS (and then abusing the terminology);
90 // 99) MacEditingBehavior is used a fallback.
91 static EditingBehaviorType editingBehaviorTypeForPlatform()
97 EditingWindowsBehavior
107 Settings::Settings(Page* page)
109 , m_editableLinkBehavior(EditableLinkDefaultBehavior)
110 , m_textDirectionSubmenuInclusionBehavior(TextDirectionSubmenuAutomaticallyIncluded)
111 , m_passwordEchoDurationInSeconds(1)
112 , m_minimumFontSize(0)
113 , m_minimumLogicalFontSize(0)
114 , m_defaultFontSize(0)
115 , m_defaultFixedFontSize(0)
116 , m_validationMessageTimerMagnification(50)
117 , m_minimumAccelerated2dCanvasSize(128 * 128)
118 , m_layoutFallbackWidth(980)
120 , m_maximumDecodedImageSize(numeric_limits<size_t>::max())
122 , m_deviceHeight(854)
123 #if ENABLE(DOM_STORAGE)
124 , m_sessionStorageQuota(StorageMap::noQuota)
126 , m_editingBehaviorType(editingBehaviorTypeForPlatform())
127 , m_maximumHTMLParserDOMTreeDepth(defaultMaximumHTMLParserDOMTreeDepth)
128 , m_isSpatialNavigationEnabled(false)
129 , m_isJavaEnabled(false)
130 , m_loadsImagesAutomatically(false)
131 , m_loadsSiteIconsIgnoringImageLoadingSetting(false)
132 , m_privateBrowsingEnabled(false)
133 , m_caretBrowsingEnabled(false)
134 , m_areImagesEnabled(true)
135 , m_isMediaEnabled(true)
136 , m_arePluginsEnabled(false)
137 , m_localStorageEnabled(false)
138 , m_isJavaScriptEnabled(false)
139 , m_isWebSecurityEnabled(true)
140 , m_allowUniversalAccessFromFileURLs(true)
141 , m_allowFileAccessFromFileURLs(true)
142 , m_javaScriptCanOpenWindowsAutomatically(false)
143 , m_javaScriptCanAccessClipboard(false)
144 , m_shouldPrintBackgrounds(false)
145 , m_textAreasAreResizable(false)
146 #if ENABLE(DASHBOARD_SUPPORT)
147 , m_usesDashboardBackwardCompatibilityMode(false)
149 , m_needsAdobeFrameReloadingQuirk(false)
150 , m_needsKeyboardEventDisambiguationQuirks(false)
151 , m_treatsAnyTextCSSLinkAsStylesheet(false)
152 , m_needsLeopardMailQuirks(false)
153 , m_isDOMPasteAllowed(false)
154 , m_shrinksStandaloneImagesToFit(true)
155 , m_usesPageCache(false)
156 , m_showsURLsInToolTips(false)
157 , m_showsToolTipOverTruncatedText(false)
158 , m_forceFTPDirectoryListings(false)
159 , m_developerExtrasEnabled(false)
160 , m_authorAndUserStylesEnabled(true)
161 , m_needsSiteSpecificQuirks(false)
162 , m_fontRenderingMode(0)
163 , m_frameFlatteningEnabled(false)
164 , m_webArchiveDebugModeEnabled(false)
165 , m_localFileContentSniffingEnabled(false)
166 , m_inApplicationChromeMode(false)
167 , m_offlineWebApplicationCacheEnabled(false)
168 , m_shouldPaintCustomScrollbars(false)
169 , m_enforceCSSMIMETypeInNoQuirksMode(true)
170 , m_usesEncodingDetector(false)
171 , m_allowScriptsToCloseWindows(false)
172 , m_canvasUsesAcceleratedDrawing(false)
173 , m_acceleratedDrawingEnabled(false)
174 // FIXME: This should really be disabled by default as it makes platforms that don't support the feature download files
175 // they can't use by. Leaving enabled for now to not change existing behavior.
176 , m_downloadableBinaryFontsEnabled(true)
177 , m_xssAuditorEnabled(false)
178 , m_acceleratedCompositingEnabled(true)
179 , m_acceleratedCompositingFor3DTransformsEnabled(true)
180 , m_acceleratedCompositingForVideoEnabled(true)
181 , m_acceleratedCompositingForPluginsEnabled(true)
182 , m_acceleratedCompositingForCanvasEnabled(true)
183 , m_acceleratedCompositingForAnimationEnabled(true)
184 , m_showDebugBorders(false)
185 , m_showRepaintCounter(false)
186 , m_experimentalNotificationsEnabled(false)
187 , m_webGLEnabled(false)
188 , m_openGLMultisamplingEnabled(true)
189 , m_webAudioEnabled(false)
190 , m_acceleratedCanvas2dEnabled(false)
191 , m_legacyAcceleratedCanvas2dEnabled(false)
192 , m_loadDeferringEnabled(true)
193 , m_tiledBackingStoreEnabled(false)
194 , m_paginateDuringLayoutEnabled(false)
195 , m_dnsPrefetchingEnabled(false)
196 #if ENABLE(FULLSCREEN_API)
197 , m_fullScreenAPIEnabled(false)
199 , m_asynchronousSpellCheckingEnabled(false)
200 , m_memoryInfoEnabled(false)
201 , m_interactiveFormValidation(false)
202 , m_usePreHTML5ParserQuirks(false)
203 , m_hyperlinkAuditingEnabled(false)
204 , m_crossOriginCheckInGetMatchedCSSRulesDisabled(false)
205 , m_forceCompositingMode(false)
206 , m_shouldInjectUserScriptsInInitialEmptyDocument(false)
207 , m_allowDisplayOfInsecureContent(true)
208 , m_allowRunningOfInsecureContent(true)
209 #if ENABLE(SMOOTH_SCROLLING)
210 , m_scrollAnimatorEnabled(true)
212 #if ENABLE(WEB_SOCKETS)
213 , m_useHixie76WebSocketProtocol(true)
215 , m_mediaPlaybackRequiresUserGesture(false)
216 , m_mediaPlaybackAllowsInline(true)
217 , m_passwordEchoEnabled(false)
218 , m_loadsImagesAutomaticallyTimer(this, &Settings::loadsImagesAutomaticallyTimerFired)
219 , m_zoomAnimatorScale(1)
221 // A Frame may not have been created yet, so we initialize the AtomicString
222 // hash before trying to use it.
223 AtomicString::init();
226 const AtomicString& Settings::standardFontFamily(UScriptCode script) const
228 return getGenericFontFamilyForScript(m_standardFontFamilyMap, script);
231 void Settings::setStandardFontFamily(const AtomicString& family, UScriptCode script)
233 setGenericFontFamilyMap(m_standardFontFamilyMap, family, script, m_page);
236 const AtomicString& Settings::fixedFontFamily(UScriptCode script) const
238 return getGenericFontFamilyForScript(m_fixedFontFamilyMap, script);
241 void Settings::setFixedFontFamily(const AtomicString& family, UScriptCode script)
243 setGenericFontFamilyMap(m_fixedFontFamilyMap, family, script, m_page);
246 const AtomicString& Settings::serifFontFamily(UScriptCode script) const
248 return getGenericFontFamilyForScript(m_serifFontFamilyMap, script);
251 void Settings::setSerifFontFamily(const AtomicString& family, UScriptCode script)
253 setGenericFontFamilyMap(m_serifFontFamilyMap, family, script, m_page);
256 const AtomicString& Settings::sansSerifFontFamily(UScriptCode script) const
258 return getGenericFontFamilyForScript(m_sansSerifFontFamilyMap, script);
261 void Settings::setSansSerifFontFamily(const AtomicString& family, UScriptCode script)
263 setGenericFontFamilyMap(m_sansSerifFontFamilyMap, family, script, m_page);
266 const AtomicString& Settings::cursiveFontFamily(UScriptCode script) const
268 return getGenericFontFamilyForScript(m_cursiveFontFamilyMap, script);
271 void Settings::setCursiveFontFamily(const AtomicString& family, UScriptCode script)
273 setGenericFontFamilyMap(m_cursiveFontFamilyMap, family, script, m_page);
276 const AtomicString& Settings::fantasyFontFamily(UScriptCode script) const
278 return getGenericFontFamilyForScript(m_fantasyFontFamilyMap, script);
281 void Settings::setFantasyFontFamily(const AtomicString& family, UScriptCode script)
283 setGenericFontFamilyMap(m_fantasyFontFamilyMap, family, script, m_page);
286 const AtomicString& Settings::pictographFontFamily(UScriptCode script) const
288 return getGenericFontFamilyForScript(m_pictographFontFamilyMap, script);
291 void Settings::setPictographFontFamily(const AtomicString& family, UScriptCode script)
293 setGenericFontFamilyMap(m_pictographFontFamilyMap, family, script, m_page);
296 void Settings::setMinimumFontSize(int minimumFontSize)
298 if (m_minimumFontSize == minimumFontSize)
301 m_minimumFontSize = minimumFontSize;
302 m_page->setNeedsRecalcStyleInAllFrames();
305 void Settings::setMinimumLogicalFontSize(int minimumLogicalFontSize)
307 if (m_minimumLogicalFontSize == minimumLogicalFontSize)
310 m_minimumLogicalFontSize = minimumLogicalFontSize;
311 m_page->setNeedsRecalcStyleInAllFrames();
314 void Settings::setDefaultFontSize(int defaultFontSize)
316 if (m_defaultFontSize == defaultFontSize)
319 m_defaultFontSize = defaultFontSize;
320 m_page->setNeedsRecalcStyleInAllFrames();
323 void Settings::setDefaultFixedFontSize(int defaultFontSize)
325 if (m_defaultFixedFontSize == defaultFontSize)
328 m_defaultFixedFontSize = defaultFontSize;
329 m_page->setNeedsRecalcStyleInAllFrames();
332 void Settings::setLoadsImagesAutomatically(bool loadsImagesAutomatically)
334 m_loadsImagesAutomatically = loadsImagesAutomatically;
336 // Changing this setting to true might immediately start new loads for images that had previously had loading disabled.
337 // If this happens while a WebView is being dealloc'ed, and we don't know the WebView is being dealloc'ed, these new loads
338 // can cause crashes downstream when the WebView memory has actually been free'd.
339 // One example where this can happen is in Mac apps that subclass WebView then do work in their overridden dealloc methods.
340 // Starting these loads synchronously is not important. By putting it on a 0-delay, properly closing the Page cancels them
341 // before they have a chance to really start.
342 // See http://webkit.org/b/60572 for more discussion.
343 m_loadsImagesAutomaticallyTimer.startOneShot(0);
346 void Settings::loadsImagesAutomaticallyTimerFired(Timer<Settings>*)
348 setLoadsImagesAutomaticallyInAllFrames(m_page);
351 void Settings::setLoadsSiteIconsIgnoringImageLoadingSetting(bool loadsSiteIcons)
353 m_loadsSiteIconsIgnoringImageLoadingSetting = loadsSiteIcons;
356 void Settings::setJavaScriptEnabled(bool isJavaScriptEnabled)
358 m_isJavaScriptEnabled = isJavaScriptEnabled;
361 void Settings::setWebSecurityEnabled(bool isWebSecurityEnabled)
363 m_isWebSecurityEnabled = isWebSecurityEnabled;
366 void Settings::setAllowUniversalAccessFromFileURLs(bool allowUniversalAccessFromFileURLs)
368 m_allowUniversalAccessFromFileURLs = allowUniversalAccessFromFileURLs;
371 void Settings::setAllowFileAccessFromFileURLs(bool allowFileAccessFromFileURLs)
373 m_allowFileAccessFromFileURLs = allowFileAccessFromFileURLs;
376 void Settings::setSpatialNavigationEnabled(bool isSpatialNavigationEnabled)
378 m_isSpatialNavigationEnabled = isSpatialNavigationEnabled;
381 void Settings::setJavaEnabled(bool isJavaEnabled)
383 m_isJavaEnabled = isJavaEnabled;
386 void Settings::setImagesEnabled(bool areImagesEnabled)
388 m_areImagesEnabled = areImagesEnabled;
391 void Settings::setMediaEnabled(bool isMediaEnabled)
393 m_isMediaEnabled = isMediaEnabled;
396 void Settings::setPluginsEnabled(bool arePluginsEnabled)
398 m_arePluginsEnabled = arePluginsEnabled;
401 void Settings::setLocalStorageEnabled(bool localStorageEnabled)
403 m_localStorageEnabled = localStorageEnabled;
406 #if ENABLE(DOM_STORAGE)
407 void Settings::setSessionStorageQuota(unsigned sessionStorageQuota)
409 m_sessionStorageQuota = sessionStorageQuota;
413 void Settings::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
415 // FIXME http://webkit.org/b/67870: The private browsing storage session and cookie private
416 // browsing mode (which is used if storage sessions are not available) are global settings, so
417 // it is misleading to have them as per-page settings.
418 // In addition, if they are treated as a per Page settings, the global values can get out of
419 // sync with the per Page value in the following situation:
420 // 1. The global values get set to true when setPrivateBrowsingEnabled(true) is called.
421 // 2. All Pages are closed, so all Settings objects go away.
422 // 3. A new Page is created, and a corresponding new Settings object is created - with
423 // m_privateBrowsingEnabled starting out as false in the constructor.
424 // 4. The WebPage settings get applied to the new Page and setPrivateBrowsingEnabled(false)
425 // is called, but an if (m_privateBrowsingEnabled == privateBrowsingEnabled) early return
426 // prevents the global values from getting changed from true to false.
427 #if USE(CFURLSTORAGESESSIONS)
428 ResourceHandle::setPrivateBrowsingEnabled(privateBrowsingEnabled);
430 setCookieStoragePrivateBrowsingEnabled(privateBrowsingEnabled);
432 if (m_privateBrowsingEnabled == privateBrowsingEnabled)
435 m_privateBrowsingEnabled = privateBrowsingEnabled;
436 m_page->privateBrowsingStateChanged();
439 void Settings::setJavaScriptCanOpenWindowsAutomatically(bool javaScriptCanOpenWindowsAutomatically)
441 m_javaScriptCanOpenWindowsAutomatically = javaScriptCanOpenWindowsAutomatically;
444 void Settings::setJavaScriptCanAccessClipboard(bool javaScriptCanAccessClipboard)
446 m_javaScriptCanAccessClipboard = javaScriptCanAccessClipboard;
449 void Settings::setDefaultTextEncodingName(const String& defaultTextEncodingName)
451 m_defaultTextEncodingName = defaultTextEncodingName;
454 void Settings::setUserStyleSheetLocation(const KURL& userStyleSheetLocation)
456 if (m_userStyleSheetLocation == userStyleSheetLocation)
459 m_userStyleSheetLocation = userStyleSheetLocation;
461 m_page->userStyleSheetLocationChanged();
464 void Settings::setShouldPrintBackgrounds(bool shouldPrintBackgrounds)
466 m_shouldPrintBackgrounds = shouldPrintBackgrounds;
469 void Settings::setTextAreasAreResizable(bool textAreasAreResizable)
471 if (m_textAreasAreResizable == textAreasAreResizable)
474 m_textAreasAreResizable = textAreasAreResizable;
475 m_page->setNeedsRecalcStyleInAllFrames();
478 void Settings::setEditableLinkBehavior(EditableLinkBehavior editableLinkBehavior)
480 m_editableLinkBehavior = editableLinkBehavior;
483 void Settings::setTextDirectionSubmenuInclusionBehavior(TextDirectionSubmenuInclusionBehavior behavior)
485 m_textDirectionSubmenuInclusionBehavior = behavior;
488 #if ENABLE(DASHBOARD_SUPPORT)
489 void Settings::setUsesDashboardBackwardCompatibilityMode(bool usesDashboardBackwardCompatibilityMode)
491 m_usesDashboardBackwardCompatibilityMode = usesDashboardBackwardCompatibilityMode;
495 // FIXME: This quirk is needed because of Radar 4674537 and 5211271. We need to phase it out once Adobe
496 // can fix the bug from their end.
497 void Settings::setNeedsAdobeFrameReloadingQuirk(bool shouldNotReloadIFramesForUnchangedSRC)
499 m_needsAdobeFrameReloadingQuirk = shouldNotReloadIFramesForUnchangedSRC;
502 // This is a quirk we are pro-actively applying to old applications. It changes keyboard event dispatching,
503 // making keyIdentifier available on keypress events, making charCode available on keydown/keyup events,
504 // and getting keypress dispatched in more cases.
505 void Settings::setNeedsKeyboardEventDisambiguationQuirks(bool needsQuirks)
507 m_needsKeyboardEventDisambiguationQuirks = needsQuirks;
510 void Settings::setTreatsAnyTextCSSLinkAsStylesheet(bool treatsAnyTextCSSLinkAsStylesheet)
512 m_treatsAnyTextCSSLinkAsStylesheet = treatsAnyTextCSSLinkAsStylesheet;
515 void Settings::setNeedsLeopardMailQuirks(bool needsQuirks)
517 m_needsLeopardMailQuirks = needsQuirks;
520 void Settings::setDOMPasteAllowed(bool DOMPasteAllowed)
522 m_isDOMPasteAllowed = DOMPasteAllowed;
525 void Settings::setDefaultMinDOMTimerInterval(double interval)
527 DOMTimer::setDefaultMinTimerInterval(interval);
530 double Settings::defaultMinDOMTimerInterval()
532 return DOMTimer::defaultMinTimerInterval();
535 void Settings::setMinDOMTimerInterval(double interval)
537 m_page->setMinimumTimerInterval(interval);
540 double Settings::minDOMTimerInterval()
542 return m_page->minimumTimerInterval();
545 void Settings::setUsesPageCache(bool usesPageCache)
547 if (m_usesPageCache == usesPageCache)
550 m_usesPageCache = usesPageCache;
551 if (!m_usesPageCache) {
552 int first = -m_page->backForward()->backCount();
553 int last = m_page->backForward()->forwardCount();
554 for (int i = first; i <= last; i++)
555 pageCache()->remove(m_page->backForward()->itemAtIndex(i));
556 pageCache()->releaseAutoreleasedPagesNow();
560 void Settings::setShrinksStandaloneImagesToFit(bool shrinksStandaloneImagesToFit)
562 m_shrinksStandaloneImagesToFit = shrinksStandaloneImagesToFit;
565 void Settings::setShowsURLsInToolTips(bool showsURLsInToolTips)
567 m_showsURLsInToolTips = showsURLsInToolTips;
570 void Settings::setShowsToolTipOverTruncatedText(bool showsToolTipForTruncatedText)
572 m_showsToolTipOverTruncatedText = showsToolTipForTruncatedText;
575 void Settings::setFTPDirectoryTemplatePath(const String& path)
577 m_ftpDirectoryTemplatePath = path;
580 void Settings::setForceFTPDirectoryListings(bool force)
582 m_forceFTPDirectoryListings = force;
585 void Settings::setDeveloperExtrasEnabled(bool developerExtrasEnabled)
587 m_developerExtrasEnabled = developerExtrasEnabled;
590 void Settings::setAuthorAndUserStylesEnabled(bool authorAndUserStylesEnabled)
592 if (m_authorAndUserStylesEnabled == authorAndUserStylesEnabled)
595 m_authorAndUserStylesEnabled = authorAndUserStylesEnabled;
596 m_page->setNeedsRecalcStyleInAllFrames();
599 void Settings::setFontRenderingMode(FontRenderingMode mode)
601 if (fontRenderingMode() == mode)
603 m_fontRenderingMode = mode;
604 m_page->setNeedsRecalcStyleInAllFrames();
607 FontRenderingMode Settings::fontRenderingMode() const
609 return static_cast<FontRenderingMode>(m_fontRenderingMode);
612 void Settings::setNeedsSiteSpecificQuirks(bool needsQuirks)
614 m_needsSiteSpecificQuirks = needsQuirks;
617 void Settings::setFrameFlatteningEnabled(bool frameFlatteningEnabled)
619 m_frameFlatteningEnabled = frameFlatteningEnabled;
622 #if ENABLE(WEB_ARCHIVE)
623 void Settings::setWebArchiveDebugModeEnabled(bool enabled)
625 m_webArchiveDebugModeEnabled = enabled;
629 void Settings::setLocalFileContentSniffingEnabled(bool enabled)
631 m_localFileContentSniffingEnabled = enabled;
634 void Settings::setLocalStorageDatabasePath(const String& path)
636 m_localStorageDatabasePath = path;
639 void Settings::setApplicationChromeMode(bool mode)
641 m_inApplicationChromeMode = mode;
644 void Settings::setOfflineWebApplicationCacheEnabled(bool enabled)
646 m_offlineWebApplicationCacheEnabled = enabled;
649 void Settings::setShouldPaintCustomScrollbars(bool shouldPaintCustomScrollbars)
651 m_shouldPaintCustomScrollbars = shouldPaintCustomScrollbars;
654 void Settings::setEnforceCSSMIMETypeInNoQuirksMode(bool enforceCSSMIMETypeInNoQuirksMode)
656 m_enforceCSSMIMETypeInNoQuirksMode = enforceCSSMIMETypeInNoQuirksMode;
659 #if USE(SAFARI_THEME)
660 void Settings::setShouldPaintNativeControls(bool shouldPaintNativeControls)
662 gShouldPaintNativeControls = shouldPaintNativeControls;
666 void Settings::setUsesEncodingDetector(bool usesEncodingDetector)
668 m_usesEncodingDetector = usesEncodingDetector;
671 void Settings::setDNSPrefetchingEnabled(bool dnsPrefetchingEnabled)
673 if (m_dnsPrefetchingEnabled == dnsPrefetchingEnabled)
676 m_dnsPrefetchingEnabled = dnsPrefetchingEnabled;
677 m_page->dnsPrefetchingStateChanged();
680 void Settings::setAllowScriptsToCloseWindows(bool allowScriptsToCloseWindows)
682 m_allowScriptsToCloseWindows = allowScriptsToCloseWindows;
685 void Settings::setCaretBrowsingEnabled(bool caretBrowsingEnabled)
687 m_caretBrowsingEnabled = caretBrowsingEnabled;
690 void Settings::setDownloadableBinaryFontsEnabled(bool downloadableBinaryFontsEnabled)
692 m_downloadableBinaryFontsEnabled = downloadableBinaryFontsEnabled;
695 void Settings::setXSSAuditorEnabled(bool xssAuditorEnabled)
697 m_xssAuditorEnabled = xssAuditorEnabled;
700 void Settings::setAcceleratedCompositingEnabled(bool enabled)
702 if (m_acceleratedCompositingEnabled == enabled)
705 m_acceleratedCompositingEnabled = enabled;
706 m_page->setNeedsRecalcStyleInAllFrames();
709 void Settings::setCanvasUsesAcceleratedDrawing(bool enabled)
711 m_canvasUsesAcceleratedDrawing = enabled;
714 void Settings::setAcceleratedDrawingEnabled(bool enabled)
716 m_acceleratedDrawingEnabled = enabled;
719 void Settings::setAcceleratedCompositingFor3DTransformsEnabled(bool enabled)
721 m_acceleratedCompositingFor3DTransformsEnabled = enabled;
724 void Settings::setAcceleratedCompositingForVideoEnabled(bool enabled)
726 m_acceleratedCompositingForVideoEnabled = enabled;
729 void Settings::setAcceleratedCompositingForPluginsEnabled(bool enabled)
731 m_acceleratedCompositingForPluginsEnabled = enabled;
734 void Settings::setAcceleratedCompositingForCanvasEnabled(bool enabled)
736 m_acceleratedCompositingForCanvasEnabled = enabled;
739 void Settings::setAcceleratedCompositingForAnimationEnabled(bool enabled)
741 m_acceleratedCompositingForAnimationEnabled = enabled;
744 void Settings::setShowDebugBorders(bool enabled)
746 if (m_showDebugBorders == enabled)
749 m_showDebugBorders = enabled;
750 m_page->setNeedsRecalcStyleInAllFrames();
753 void Settings::setShowRepaintCounter(bool enabled)
755 if (m_showRepaintCounter == enabled)
758 m_showRepaintCounter = enabled;
759 m_page->setNeedsRecalcStyleInAllFrames();
762 void Settings::setExperimentalNotificationsEnabled(bool enabled)
764 m_experimentalNotificationsEnabled = enabled;
767 #if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
768 void Settings::setShouldUseHighResolutionTimers(bool shouldUseHighResolutionTimers)
770 gShouldUseHighResolutionTimers = shouldUseHighResolutionTimers;
774 void Settings::setWebAudioEnabled(bool enabled)
776 m_webAudioEnabled = enabled;
779 void Settings::setWebGLEnabled(bool enabled)
781 m_webGLEnabled = enabled;
784 void Settings::setOpenGLMultisamplingEnabled(bool enabled)
786 m_openGLMultisamplingEnabled = enabled;
789 void Settings::setAccelerated2dCanvasEnabled(bool enabled)
791 m_acceleratedCanvas2dEnabled = enabled;
794 void Settings::setLegacyAccelerated2dCanvasEnabled(bool enabled)
796 m_legacyAcceleratedCanvas2dEnabled = enabled;
799 void Settings::setMinimumAccelerated2dCanvasSize(int numPixels)
801 m_minimumAccelerated2dCanvasSize = numPixels;
804 void Settings::setLoadDeferringEnabled(bool enabled)
806 m_loadDeferringEnabled = enabled;
809 void Settings::setTiledBackingStoreEnabled(bool enabled)
811 m_tiledBackingStoreEnabled = enabled;
812 #if ENABLE(TILED_BACKING_STORE)
813 if (m_page->mainFrame())
814 m_page->mainFrame()->setTiledBackingStoreEnabled(enabled);
818 } // namespace WebCore