1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
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.
12 *
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.
24 */
25
26 #include "config.h"
27 #include "Settings.h"
28
29 #include "Frame.h"
30 #include "FrameTree.h"
31 #include "FrameView.h"
32 #include "HistoryItem.h"
33 #include "Page.h"
34 #include "PageCache.h"
35 #include <limits>
36
37 using namespace std;
38
39 namespace WebCore {
40
setNeedsReapplyStylesInAllFrames(Page * page)41 static void setNeedsReapplyStylesInAllFrames(Page* page)
42 {
43 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
44 frame->setNeedsReapplyStyles();
45 }
46
47 #if USE(SAFARI_THEME)
48 bool Settings::gShouldPaintNativeControls = true;
49 #endif
50
Settings(Page * page)51 Settings::Settings(Page* page)
52 : m_page(page)
53 #ifdef ANDROID_LAYOUT
54 , m_layoutAlgorithm(kLayoutFitColumnToScreen)
55 #endif
56 , m_editableLinkBehavior(EditableLinkDefaultBehavior)
57 , m_textDirectionSubmenuInclusionBehavior(TextDirectionSubmenuAutomaticallyIncluded)
58 , m_minimumFontSize(0)
59 , m_minimumLogicalFontSize(0)
60 , m_defaultFontSize(0)
61 , m_defaultFixedFontSize(0)
62 #ifdef ANDROID_LAYOUT
63 , m_useWideViewport(false)
64 #endif
65 #ifdef ANDROID_MULTIPLE_WINDOWS
66 , m_supportMultipleWindows(true)
67 #endif
68 #ifdef ANDROID_BLOCK_NETWORK_IMAGE
69 , m_blockNetworkImage(false)
70 #endif
71 , m_maximumDecodedImageSize(numeric_limits<size_t>::max())
72 , m_isJavaEnabled(false)
73 , m_loadsImagesAutomatically(false)
74 , m_privateBrowsingEnabled(false)
75 , m_caretBrowsingEnabled(false)
76 , m_arePluginsEnabled(false)
77 , m_databasesEnabled(false)
78 , m_localStorageEnabled(false)
79 , m_sessionStorageEnabled(true)
80 , m_isJavaScriptEnabled(false)
81 , m_isWebSecurityEnabled(true)
82 , m_allowUniversalAccessFromFileURLs(true)
83 , m_javaScriptCanOpenWindowsAutomatically(false)
84 , m_shouldPrintBackgrounds(false)
85 , m_textAreasAreResizable(false)
86 #if ENABLE(DASHBOARD_SUPPORT)
87 , m_usesDashboardBackwardCompatibilityMode(false)
88 #endif
89 , m_needsAdobeFrameReloadingQuirk(false)
90 , m_needsKeyboardEventDisambiguationQuirks(false)
91 , m_treatsAnyTextCSSLinkAsStylesheet(false)
92 , m_needsLeopardMailQuirks(false)
93 , m_needsTigerMailQuirks(false)
94 , m_isDOMPasteAllowed(false)
95 , m_shrinksStandaloneImagesToFit(true)
96 , m_usesPageCache(false)
97 , m_showsURLsInToolTips(false)
98 , m_forceFTPDirectoryListings(false)
99 , m_developerExtrasEnabled(false)
100 , m_authorAndUserStylesEnabled(true)
101 , m_needsSiteSpecificQuirks(false)
102 , m_fontRenderingMode(0)
103 , m_webArchiveDebugModeEnabled(false)
104 , m_localFileContentSniffingEnabled(false)
105 , m_inApplicationChromeMode(false)
106 , m_offlineWebApplicationCacheEnabled(false)
107 , m_shouldPaintCustomScrollbars(false)
108 , m_zoomsTextOnly(false)
109 , m_enforceCSSMIMETypeInStrictMode(true)
110 , m_usesEncodingDetector(false)
111 , m_allowScriptsToCloseWindows(false)
112 , m_editingBehavior(
113 #if PLATFORM(MAC)
114 EditingMacBehavior
115 #else
116 EditingWindowsBehavior
117 #endif
118 )
119 // FIXME: This should really be disabled by default as it makes platforms that don't support the feature download files
120 // they can't use by. Leaving enabled for now to not change existing behavior.
121 , m_downloadableBinaryFontsEnabled(true)
122 , m_xssAuditorEnabled(false)
123 , m_acceleratedCompositingEnabled(true)
124 {
125 // A Frame may not have been created yet, so we initialize the AtomicString
126 // hash before trying to use it.
127 AtomicString::init();
128 #ifdef ANDROID_META_SUPPORT
129 resetMetadataSettings();
130 #endif
131 }
132
setStandardFontFamily(const AtomicString & standardFontFamily)133 void Settings::setStandardFontFamily(const AtomicString& standardFontFamily)
134 {
135 if (standardFontFamily == m_standardFontFamily)
136 return;
137
138 m_standardFontFamily = standardFontFamily;
139 setNeedsReapplyStylesInAllFrames(m_page);
140 }
141
setFixedFontFamily(const AtomicString & fixedFontFamily)142 void Settings::setFixedFontFamily(const AtomicString& fixedFontFamily)
143 {
144 if (m_fixedFontFamily == fixedFontFamily)
145 return;
146
147 m_fixedFontFamily = fixedFontFamily;
148 setNeedsReapplyStylesInAllFrames(m_page);
149 }
150
setSerifFontFamily(const AtomicString & serifFontFamily)151 void Settings::setSerifFontFamily(const AtomicString& serifFontFamily)
152 {
153 if (m_serifFontFamily == serifFontFamily)
154 return;
155
156 m_serifFontFamily = serifFontFamily;
157 setNeedsReapplyStylesInAllFrames(m_page);
158 }
159
setSansSerifFontFamily(const AtomicString & sansSerifFontFamily)160 void Settings::setSansSerifFontFamily(const AtomicString& sansSerifFontFamily)
161 {
162 if (m_sansSerifFontFamily == sansSerifFontFamily)
163 return;
164
165 m_sansSerifFontFamily = sansSerifFontFamily;
166 setNeedsReapplyStylesInAllFrames(m_page);
167 }
168
setCursiveFontFamily(const AtomicString & cursiveFontFamily)169 void Settings::setCursiveFontFamily(const AtomicString& cursiveFontFamily)
170 {
171 if (m_cursiveFontFamily == cursiveFontFamily)
172 return;
173
174 m_cursiveFontFamily = cursiveFontFamily;
175 setNeedsReapplyStylesInAllFrames(m_page);
176 }
177
setFantasyFontFamily(const AtomicString & fantasyFontFamily)178 void Settings::setFantasyFontFamily(const AtomicString& fantasyFontFamily)
179 {
180 if (m_fantasyFontFamily == fantasyFontFamily)
181 return;
182
183 m_fantasyFontFamily = fantasyFontFamily;
184 setNeedsReapplyStylesInAllFrames(m_page);
185 }
186
setMinimumFontSize(int minimumFontSize)187 void Settings::setMinimumFontSize(int minimumFontSize)
188 {
189 if (m_minimumFontSize == minimumFontSize)
190 return;
191
192 m_minimumFontSize = minimumFontSize;
193 setNeedsReapplyStylesInAllFrames(m_page);
194 }
195
setMinimumLogicalFontSize(int minimumLogicalFontSize)196 void Settings::setMinimumLogicalFontSize(int minimumLogicalFontSize)
197 {
198 if (m_minimumLogicalFontSize == minimumLogicalFontSize)
199 return;
200
201 m_minimumLogicalFontSize = minimumLogicalFontSize;
202 setNeedsReapplyStylesInAllFrames(m_page);
203 }
204
setDefaultFontSize(int defaultFontSize)205 void Settings::setDefaultFontSize(int defaultFontSize)
206 {
207 if (m_defaultFontSize == defaultFontSize)
208 return;
209
210 m_defaultFontSize = defaultFontSize;
211 setNeedsReapplyStylesInAllFrames(m_page);
212 }
213
setDefaultFixedFontSize(int defaultFontSize)214 void Settings::setDefaultFixedFontSize(int defaultFontSize)
215 {
216 if (m_defaultFixedFontSize == defaultFontSize)
217 return;
218
219 m_defaultFixedFontSize = defaultFontSize;
220 setNeedsReapplyStylesInAllFrames(m_page);
221 }
222
223 #ifdef ANDROID_BLOCK_NETWORK_IMAGE
setBlockNetworkImage(bool blockNetworkImage)224 void Settings::setBlockNetworkImage(bool blockNetworkImage)
225 {
226 m_blockNetworkImage = blockNetworkImage;
227 }
228 #endif
229
setLoadsImagesAutomatically(bool loadsImagesAutomatically)230 void Settings::setLoadsImagesAutomatically(bool loadsImagesAutomatically)
231 {
232 m_loadsImagesAutomatically = loadsImagesAutomatically;
233 }
234
setJavaScriptEnabled(bool isJavaScriptEnabled)235 void Settings::setJavaScriptEnabled(bool isJavaScriptEnabled)
236 {
237 m_isJavaScriptEnabled = isJavaScriptEnabled;
238 }
239
setWebSecurityEnabled(bool isWebSecurityEnabled)240 void Settings::setWebSecurityEnabled(bool isWebSecurityEnabled)
241 {
242 m_isWebSecurityEnabled = isWebSecurityEnabled;
243 }
244
setAllowUniversalAccessFromFileURLs(bool allowUniversalAccessFromFileURLs)245 void Settings::setAllowUniversalAccessFromFileURLs(bool allowUniversalAccessFromFileURLs)
246 {
247 m_allowUniversalAccessFromFileURLs = allowUniversalAccessFromFileURLs;
248 }
249
setJavaEnabled(bool isJavaEnabled)250 void Settings::setJavaEnabled(bool isJavaEnabled)
251 {
252 m_isJavaEnabled = isJavaEnabled;
253 }
254
setPluginsEnabled(bool arePluginsEnabled)255 void Settings::setPluginsEnabled(bool arePluginsEnabled)
256 {
257 m_arePluginsEnabled = arePluginsEnabled;
258 }
259
setDatabasesEnabled(bool databasesEnabled)260 void Settings::setDatabasesEnabled(bool databasesEnabled)
261 {
262 m_databasesEnabled = databasesEnabled;
263 }
264
setLocalStorageEnabled(bool localStorageEnabled)265 void Settings::setLocalStorageEnabled(bool localStorageEnabled)
266 {
267 m_localStorageEnabled = localStorageEnabled;
268 }
269
setSessionStorageEnabled(bool sessionStorageEnabled)270 void Settings::setSessionStorageEnabled(bool sessionStorageEnabled)
271 {
272 m_sessionStorageEnabled = sessionStorageEnabled;
273 }
274
setPrivateBrowsingEnabled(bool privateBrowsingEnabled)275 void Settings::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
276 {
277 m_privateBrowsingEnabled = privateBrowsingEnabled;
278 }
279
setJavaScriptCanOpenWindowsAutomatically(bool javaScriptCanOpenWindowsAutomatically)280 void Settings::setJavaScriptCanOpenWindowsAutomatically(bool javaScriptCanOpenWindowsAutomatically)
281 {
282 m_javaScriptCanOpenWindowsAutomatically = javaScriptCanOpenWindowsAutomatically;
283 }
284
setDefaultTextEncodingName(const String & defaultTextEncodingName)285 void Settings::setDefaultTextEncodingName(const String& defaultTextEncodingName)
286 {
287 m_defaultTextEncodingName = defaultTextEncodingName;
288 }
289
setUserStyleSheetLocation(const KURL & userStyleSheetLocation)290 void Settings::setUserStyleSheetLocation(const KURL& userStyleSheetLocation)
291 {
292 if (m_userStyleSheetLocation == userStyleSheetLocation)
293 return;
294
295 m_userStyleSheetLocation = userStyleSheetLocation;
296
297 m_page->userStyleSheetLocationChanged();
298 setNeedsReapplyStylesInAllFrames(m_page);
299 }
300
setShouldPrintBackgrounds(bool shouldPrintBackgrounds)301 void Settings::setShouldPrintBackgrounds(bool shouldPrintBackgrounds)
302 {
303 m_shouldPrintBackgrounds = shouldPrintBackgrounds;
304 }
305
setTextAreasAreResizable(bool textAreasAreResizable)306 void Settings::setTextAreasAreResizable(bool textAreasAreResizable)
307 {
308 if (m_textAreasAreResizable == textAreasAreResizable)
309 return;
310
311 m_textAreasAreResizable = textAreasAreResizable;
312 setNeedsReapplyStylesInAllFrames(m_page);
313 }
314
setEditableLinkBehavior(EditableLinkBehavior editableLinkBehavior)315 void Settings::setEditableLinkBehavior(EditableLinkBehavior editableLinkBehavior)
316 {
317 m_editableLinkBehavior = editableLinkBehavior;
318 }
319
setTextDirectionSubmenuInclusionBehavior(TextDirectionSubmenuInclusionBehavior behavior)320 void Settings::setTextDirectionSubmenuInclusionBehavior(TextDirectionSubmenuInclusionBehavior behavior)
321 {
322 m_textDirectionSubmenuInclusionBehavior = behavior;
323 }
324
325 #if ENABLE(DASHBOARD_SUPPORT)
setUsesDashboardBackwardCompatibilityMode(bool usesDashboardBackwardCompatibilityMode)326 void Settings::setUsesDashboardBackwardCompatibilityMode(bool usesDashboardBackwardCompatibilityMode)
327 {
328 m_usesDashboardBackwardCompatibilityMode = usesDashboardBackwardCompatibilityMode;
329 }
330 #endif
331
332 // FIXME: This quirk is needed because of Radar 4674537 and 5211271. We need to phase it out once Adobe
333 // can fix the bug from their end.
setNeedsAdobeFrameReloadingQuirk(bool shouldNotReloadIFramesForUnchangedSRC)334 void Settings::setNeedsAdobeFrameReloadingQuirk(bool shouldNotReloadIFramesForUnchangedSRC)
335 {
336 m_needsAdobeFrameReloadingQuirk = shouldNotReloadIFramesForUnchangedSRC;
337 }
338
339 // This is a quirk we are pro-actively applying to old applications. It changes keyboard event dispatching,
340 // making keyIdentifier available on keypress events, making charCode available on keydown/keyup events,
341 // and getting keypress dispatched in more cases.
setNeedsKeyboardEventDisambiguationQuirks(bool needsQuirks)342 void Settings::setNeedsKeyboardEventDisambiguationQuirks(bool needsQuirks)
343 {
344 m_needsKeyboardEventDisambiguationQuirks = needsQuirks;
345 }
346
setTreatsAnyTextCSSLinkAsStylesheet(bool treatsAnyTextCSSLinkAsStylesheet)347 void Settings::setTreatsAnyTextCSSLinkAsStylesheet(bool treatsAnyTextCSSLinkAsStylesheet)
348 {
349 m_treatsAnyTextCSSLinkAsStylesheet = treatsAnyTextCSSLinkAsStylesheet;
350 }
351
setNeedsLeopardMailQuirks(bool needsQuirks)352 void Settings::setNeedsLeopardMailQuirks(bool needsQuirks)
353 {
354 m_needsLeopardMailQuirks = needsQuirks;
355 }
356
setNeedsTigerMailQuirks(bool needsQuirks)357 void Settings::setNeedsTigerMailQuirks(bool needsQuirks)
358 {
359 m_needsTigerMailQuirks = needsQuirks;
360 }
361
setDOMPasteAllowed(bool DOMPasteAllowed)362 void Settings::setDOMPasteAllowed(bool DOMPasteAllowed)
363 {
364 m_isDOMPasteAllowed = DOMPasteAllowed;
365 }
366
setUsesPageCache(bool usesPageCache)367 void Settings::setUsesPageCache(bool usesPageCache)
368 {
369 if (m_usesPageCache == usesPageCache)
370 return;
371
372 m_usesPageCache = usesPageCache;
373 if (!m_usesPageCache) {
374 HistoryItemVector& historyItems = m_page->backForwardList()->entries();
375 for (unsigned i = 0; i < historyItems.size(); i++)
376 pageCache()->remove(historyItems[i].get());
377 pageCache()->releaseAutoreleasedPagesNow();
378 }
379 }
380
setShrinksStandaloneImagesToFit(bool shrinksStandaloneImagesToFit)381 void Settings::setShrinksStandaloneImagesToFit(bool shrinksStandaloneImagesToFit)
382 {
383 m_shrinksStandaloneImagesToFit = shrinksStandaloneImagesToFit;
384 }
385
setShowsURLsInToolTips(bool showsURLsInToolTips)386 void Settings::setShowsURLsInToolTips(bool showsURLsInToolTips)
387 {
388 m_showsURLsInToolTips = showsURLsInToolTips;
389 }
390
setFTPDirectoryTemplatePath(const String & path)391 void Settings::setFTPDirectoryTemplatePath(const String& path)
392 {
393 m_ftpDirectoryTemplatePath = path;
394 }
395
setForceFTPDirectoryListings(bool force)396 void Settings::setForceFTPDirectoryListings(bool force)
397 {
398 m_forceFTPDirectoryListings = force;
399 }
400
setDeveloperExtrasEnabled(bool developerExtrasEnabled)401 void Settings::setDeveloperExtrasEnabled(bool developerExtrasEnabled)
402 {
403 m_developerExtrasEnabled = developerExtrasEnabled;
404 }
405
406 #ifdef ANDROID_META_SUPPORT
resetMetadataSettings()407 void Settings::resetMetadataSettings()
408 {
409 m_viewport_width = -1;
410 m_viewport_height = -1;
411 m_viewport_initial_scale = 0;
412 m_viewport_minimum_scale = 0;
413 m_viewport_maximum_scale = 0;
414 m_viewport_user_scalable = true;
415 m_viewport_target_densitydpi = -1;
416 m_format_detection_telephone = true;
417 m_format_detection_address = true;
418 m_format_detection_email = true;
419 }
420
setMetadataSettings(const String & key,const String & value)421 void Settings::setMetadataSettings(const String& key, const String& value)
422 {
423 if (key == "width") {
424 if (value == "device-width") {
425 m_viewport_width = 0;
426 } else {
427 int width = value.toInt();
428 if (width <= 10000) {
429 if (width <= 320) {
430 // This is a hack to accommodate the pages designed for the
431 // original iPhone. The new version, since 10/2007, is to
432 // use device-width which works for both portrait and
433 // landscape modes.
434 m_viewport_width = 0;
435 } else {
436 m_viewport_width = width;
437 }
438 }
439 }
440 } else if (key == "height") {
441 if (value == "device-height") {
442 m_viewport_height = 0;
443 } else {
444 int height = value.toInt();
445 if (height >= 200 && height <= 10000) {
446 m_viewport_height = height;
447 }
448 }
449 } else if (key == "initial-scale") {
450 int scale = int(value.toFloat() * 100);
451 if (scale >= 1 && scale <= 1000) {
452 m_viewport_initial_scale = scale;
453 }
454 } else if (key == "minimum-scale") {
455 int scale = int(value.toFloat() * 100);
456 if (scale >= 1 && scale <= 1000) {
457 m_viewport_minimum_scale = scale;
458 }
459 } else if (key == "maximum-scale") {
460 int scale = int(value.toFloat() * 100);
461 if (scale >= 1 && scale <= 1000) {
462 m_viewport_maximum_scale = scale;
463 }
464 } else if (key == "user-scalable") {
465 // even Apple doc says using "no", "0" is common in the real world, and
466 // some sites, e.g. gomoviesapp.com, use "false".
467 if (value == "no" || value == "0" || value == "false") {
468 m_viewport_user_scalable = false;
469 }
470 } else if (key == "target-densitydpi") {
471 if (value == "device-dpi") {
472 m_viewport_target_densitydpi = 0;
473 } else if (value == "low-dpi") {
474 m_viewport_target_densitydpi = 120;
475 } else if (value == "medium-dpi") {
476 m_viewport_target_densitydpi = 160;
477 } else if (value == "high-dpi") {
478 m_viewport_target_densitydpi = 240;
479 } else {
480 int dpi = value.toInt();
481 if (dpi >= 70 && dpi <= 400) {
482 m_viewport_target_densitydpi = dpi;
483 }
484 }
485 } else if (key == "telephone") {
486 if (value == "no") {
487 m_format_detection_telephone = false;
488 }
489 } else if (key == "address") {
490 if (value == "no") {
491 m_format_detection_address = false;
492 }
493 } else if (key == "email") {
494 if (value == "no") {
495 m_format_detection_email = false;
496 }
497 } else if (key == "format-detection") {
498 // even Apple doc says "format-detection" should be the name of the
499 // <meta> tag. In the real world, e.g. amazon.com, use
500 // "format-detection=no" in the "viewport" <meta> tag to disable all
501 // format detection.
502 if (value == "no") {
503 m_format_detection_telephone = false;
504 m_format_detection_address = false;
505 m_format_detection_email = false;
506 }
507 }
508 }
509 #endif
510
setAuthorAndUserStylesEnabled(bool authorAndUserStylesEnabled)511 void Settings::setAuthorAndUserStylesEnabled(bool authorAndUserStylesEnabled)
512 {
513 if (m_authorAndUserStylesEnabled == authorAndUserStylesEnabled)
514 return;
515
516 m_authorAndUserStylesEnabled = authorAndUserStylesEnabled;
517 setNeedsReapplyStylesInAllFrames(m_page);
518 }
519
setFontRenderingMode(FontRenderingMode mode)520 void Settings::setFontRenderingMode(FontRenderingMode mode)
521 {
522 if (fontRenderingMode() == mode)
523 return;
524 m_fontRenderingMode = mode;
525 setNeedsReapplyStylesInAllFrames(m_page);
526 }
527
fontRenderingMode() const528 FontRenderingMode Settings::fontRenderingMode() const
529 {
530 return static_cast<FontRenderingMode>(m_fontRenderingMode);
531 }
532
setNeedsSiteSpecificQuirks(bool needsQuirks)533 void Settings::setNeedsSiteSpecificQuirks(bool needsQuirks)
534 {
535 m_needsSiteSpecificQuirks = needsQuirks;
536 }
537
setWebArchiveDebugModeEnabled(bool enabled)538 void Settings::setWebArchiveDebugModeEnabled(bool enabled)
539 {
540 m_webArchiveDebugModeEnabled = enabled;
541 }
542
setLocalFileContentSniffingEnabled(bool enabled)543 void Settings::setLocalFileContentSniffingEnabled(bool enabled)
544 {
545 m_localFileContentSniffingEnabled = enabled;
546 }
547
setLocalStorageDatabasePath(const String & path)548 void Settings::setLocalStorageDatabasePath(const String& path)
549 {
550 m_localStorageDatabasePath = path;
551 }
552
setApplicationChromeMode(bool mode)553 void Settings::setApplicationChromeMode(bool mode)
554 {
555 m_inApplicationChromeMode = mode;
556 }
557
setOfflineWebApplicationCacheEnabled(bool enabled)558 void Settings::setOfflineWebApplicationCacheEnabled(bool enabled)
559 {
560 m_offlineWebApplicationCacheEnabled = enabled;
561 }
562
setShouldPaintCustomScrollbars(bool shouldPaintCustomScrollbars)563 void Settings::setShouldPaintCustomScrollbars(bool shouldPaintCustomScrollbars)
564 {
565 m_shouldPaintCustomScrollbars = shouldPaintCustomScrollbars;
566 }
567
setZoomsTextOnly(bool zoomsTextOnly)568 void Settings::setZoomsTextOnly(bool zoomsTextOnly)
569 {
570 if (zoomsTextOnly == m_zoomsTextOnly)
571 return;
572
573 m_zoomsTextOnly = zoomsTextOnly;
574 setNeedsReapplyStylesInAllFrames(m_page);
575 }
576
setEnforceCSSMIMETypeInStrictMode(bool enforceCSSMIMETypeInStrictMode)577 void Settings::setEnforceCSSMIMETypeInStrictMode(bool enforceCSSMIMETypeInStrictMode)
578 {
579 m_enforceCSSMIMETypeInStrictMode = enforceCSSMIMETypeInStrictMode;
580 }
581
582 #if USE(SAFARI_THEME)
setShouldPaintNativeControls(bool shouldPaintNativeControls)583 void Settings::setShouldPaintNativeControls(bool shouldPaintNativeControls)
584 {
585 gShouldPaintNativeControls = shouldPaintNativeControls;
586 }
587 #endif
588
setUsesEncodingDetector(bool usesEncodingDetector)589 void Settings::setUsesEncodingDetector(bool usesEncodingDetector)
590 {
591 m_usesEncodingDetector = usesEncodingDetector;
592 }
593
setAllowScriptsToCloseWindows(bool allowScriptsToCloseWindows)594 void Settings::setAllowScriptsToCloseWindows(bool allowScriptsToCloseWindows)
595 {
596 m_allowScriptsToCloseWindows = allowScriptsToCloseWindows;
597 }
598
setCaretBrowsingEnabled(bool caretBrowsingEnabled)599 void Settings::setCaretBrowsingEnabled(bool caretBrowsingEnabled)
600 {
601 m_caretBrowsingEnabled = caretBrowsingEnabled;
602 }
603
setDownloadableBinaryFontsEnabled(bool downloadableBinaryFontsEnabled)604 void Settings::setDownloadableBinaryFontsEnabled(bool downloadableBinaryFontsEnabled)
605 {
606 m_downloadableBinaryFontsEnabled = downloadableBinaryFontsEnabled;
607 }
608
setXSSAuditorEnabled(bool xssAuditorEnabled)609 void Settings::setXSSAuditorEnabled(bool xssAuditorEnabled)
610 {
611 m_xssAuditorEnabled = xssAuditorEnabled;
612 }
613
setAcceleratedCompositingEnabled(bool enabled)614 void Settings::setAcceleratedCompositingEnabled(bool enabled)
615 {
616 if (m_acceleratedCompositingEnabled == enabled)
617 return;
618
619 m_acceleratedCompositingEnabled = enabled;
620 setNeedsReapplyStylesInAllFrames(m_page);
621 }
622
623 } // namespace WebCore
624