Modern IDB (Workers): Enable INDEXED_DATABASE_IN_WORKERS compile time flag, but disab...
[WebKit-https.git] / Source / WebCore / testing / InternalSettings.cpp
1 /*
2  * Copyright (C) 2012 Google Inc. All rights reserved.
3  * Copyright (C) 2013 Apple Inc. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1.  Redistributions of source code must retain the above copyright
10  *     notice, this list of conditions and the following disclaimer.
11  * 2.  Redistributions in binary form must reproduce the above copyright
12  *     notice, this list of conditions and the following disclaimer in the
13  *     documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
16  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
19  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26
27 #include "config.h"
28 #include "InternalSettings.h"
29
30 #include "CaptionUserPreferences.h"
31 #include "Document.h"
32 #include "ExceptionCode.h"
33 #include "FrameView.h"
34 #include "Language.h"
35 #include "LocaleToScriptMapping.h"
36 #include "MainFrame.h"
37 #include "Page.h"
38 #include "PageGroup.h"
39 #include "RuntimeEnabledFeatures.h"
40 #include "Settings.h"
41 #include "Supplementable.h"
42 #include "TextRun.h"
43
44 #if ENABLE(INPUT_TYPE_COLOR)
45 #include "ColorChooser.h"
46 #endif
47
48 #define InternalSettingsGuardForSettingsReturn(returnValue) \
49     if (!settings()) { \
50         ec = INVALID_ACCESS_ERR; \
51         return returnValue; \
52     }
53
54 #define InternalSettingsGuardForSettings()  \
55     if (!settings()) { \
56         ec = INVALID_ACCESS_ERR; \
57         return; \
58     }
59
60 #define InternalSettingsGuardForPage() \
61     if (!page()) { \
62         ec = INVALID_ACCESS_ERR; \
63         return; \
64     }
65
66 namespace WebCore {
67
68 InternalSettings::Backup::Backup(Settings& settings)
69     : m_originalCSSShapesEnabled(RuntimeEnabledFeatures::sharedFeatures().cssShapesEnabled())
70     , m_originalEditingBehavior(settings.editingBehaviorType())
71 #if ENABLE(TEXT_AUTOSIZING)
72     , m_originalTextAutosizingEnabled(settings.textAutosizingEnabled())
73     , m_originalTextAutosizingWindowSizeOverride(settings.textAutosizingWindowSizeOverride())
74     , m_originalTextAutosizingFontScaleFactor(settings.textAutosizingFontScaleFactor())
75 #endif
76     , m_originalMediaTypeOverride(settings.mediaTypeOverride())
77     , m_originalCanvasUsesAcceleratedDrawing(settings.canvasUsesAcceleratedDrawing())
78     , m_originalMockScrollbarsEnabled(settings.mockScrollbarsEnabled())
79     , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::sharedFeatures().langAttributeAwareFormControlUIEnabled())
80     , m_imagesEnabled(settings.areImagesEnabled())
81     , m_minimumTimerInterval(settings.minimumDOMTimerInterval())
82 #if ENABLE(VIDEO_TRACK)
83     , m_shouldDisplaySubtitles(settings.shouldDisplaySubtitles())
84     , m_shouldDisplayCaptions(settings.shouldDisplayCaptions())
85     , m_shouldDisplayTextDescriptions(settings.shouldDisplayTextDescriptions())
86 #endif
87     , m_defaultVideoPosterURL(settings.defaultVideoPosterURL())
88     , m_forcePendingWebGLPolicy(settings.isForcePendingWebGLPolicy())
89     , m_originalTimeWithoutMouseMovementBeforeHidingControls(settings.timeWithoutMouseMovementBeforeHidingControls())
90     , m_useLegacyBackgroundSizeShorthandBehavior(settings.useLegacyBackgroundSizeShorthandBehavior())
91     , m_autoscrollForDragAndDropEnabled(settings.autoscrollForDragAndDropEnabled())
92     , m_pluginReplacementEnabled(RuntimeEnabledFeatures::sharedFeatures().pluginReplacementEnabled())
93     , m_shouldConvertPositionStyleOnCopy(settings.shouldConvertPositionStyleOnCopy())
94     , m_fontFallbackPrefersPictographs(settings.fontFallbackPrefersPictographs())
95     , m_backgroundShouldExtendBeyondPage(settings.backgroundShouldExtendBeyondPage())
96     , m_storageBlockingPolicy(settings.storageBlockingPolicy())
97     , m_scrollingTreeIncludesFrames(settings.scrollingTreeIncludesFrames())
98 #if ENABLE(TOUCH_EVENTS)
99     , m_touchEventEmulationEnabled(settings.isTouchEventEmulationEnabled())
100 #endif
101 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
102     , m_allowsAirPlayForMediaPlayback(settings.allowsAirPlayForMediaPlayback())
103 #endif
104     , m_allowsInlineMediaPlayback(settings.allowsInlineMediaPlayback())
105     , m_inlineMediaPlaybackRequiresPlaysInlineAttribute(settings.inlineMediaPlaybackRequiresPlaysInlineAttribute())
106     , m_indexedDBWorkersEnabled(RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled())
107 {
108 }
109
110 void InternalSettings::Backup::restoreTo(Settings& settings)
111 {
112     RuntimeEnabledFeatures::sharedFeatures().setCSSShapesEnabled(m_originalCSSShapesEnabled);
113     settings.setEditingBehaviorType(m_originalEditingBehavior);
114
115     for (const auto& standardFont : m_standardFontFamilies)
116         settings.setStandardFontFamily(standardFont.value, static_cast<UScriptCode>(standardFont.key));
117     m_standardFontFamilies.clear();
118
119     for (const auto& fixedFont : m_fixedFontFamilies)
120         settings.setFixedFontFamily(fixedFont.value, static_cast<UScriptCode>(fixedFont.key));
121     m_fixedFontFamilies.clear();
122
123     for (const auto& serifFont : m_serifFontFamilies)
124         settings.setSerifFontFamily(serifFont.value, static_cast<UScriptCode>(serifFont.key));
125     m_serifFontFamilies.clear();
126
127     for (const auto& sansSerifFont : m_sansSerifFontFamilies)
128         settings.setSansSerifFontFamily(sansSerifFont.value, static_cast<UScriptCode>(sansSerifFont.key));
129     m_sansSerifFontFamilies.clear();
130
131     for (const auto& cursiveFont : m_cursiveFontFamilies)
132         settings.setCursiveFontFamily(cursiveFont.value, static_cast<UScriptCode>(cursiveFont.key));
133     m_cursiveFontFamilies.clear();
134
135     for (const auto& fantasyFont : m_fantasyFontFamilies)
136         settings.setFantasyFontFamily(fantasyFont.value, static_cast<UScriptCode>(fantasyFont.key));
137     m_fantasyFontFamilies.clear();
138
139     for (const auto& pictographFont : m_pictographFontFamilies)
140         settings.setPictographFontFamily(pictographFont.value, static_cast<UScriptCode>(pictographFont.key));
141     m_pictographFontFamilies.clear();
142
143 #if ENABLE(TEXT_AUTOSIZING)
144     settings.setTextAutosizingEnabled(m_originalTextAutosizingEnabled);
145     settings.setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindowSizeOverride);
146     settings.setTextAutosizingFontScaleFactor(m_originalTextAutosizingFontScaleFactor);
147 #endif
148     settings.setMediaTypeOverride(m_originalMediaTypeOverride);
149     settings.setCanvasUsesAcceleratedDrawing(m_originalCanvasUsesAcceleratedDrawing);
150     RuntimeEnabledFeatures::sharedFeatures().setLangAttributeAwareFormControlUIEnabled(m_langAttributeAwareFormControlUIEnabled);
151     settings.setImagesEnabled(m_imagesEnabled);
152     settings.setMinimumDOMTimerInterval(m_minimumTimerInterval);
153 #if ENABLE(VIDEO_TRACK)
154     settings.setShouldDisplaySubtitles(m_shouldDisplaySubtitles);
155     settings.setShouldDisplayCaptions(m_shouldDisplayCaptions);
156     settings.setShouldDisplayTextDescriptions(m_shouldDisplayTextDescriptions);
157 #endif
158     settings.setDefaultVideoPosterURL(m_defaultVideoPosterURL);
159     settings.setForcePendingWebGLPolicy(m_forcePendingWebGLPolicy);
160     settings.setTimeWithoutMouseMovementBeforeHidingControls(m_originalTimeWithoutMouseMovementBeforeHidingControls);
161     settings.setUseLegacyBackgroundSizeShorthandBehavior(m_useLegacyBackgroundSizeShorthandBehavior);
162     settings.setAutoscrollForDragAndDropEnabled(m_autoscrollForDragAndDropEnabled);
163     settings.setShouldConvertPositionStyleOnCopy(m_shouldConvertPositionStyleOnCopy);
164     settings.setFontFallbackPrefersPictographs(m_fontFallbackPrefersPictographs);
165     settings.setBackgroundShouldExtendBeyondPage(m_backgroundShouldExtendBeyondPage);
166     settings.setStorageBlockingPolicy(m_storageBlockingPolicy);
167     settings.setScrollingTreeIncludesFrames(m_scrollingTreeIncludesFrames);
168 #if ENABLE(TOUCH_EVENTS)
169     settings.setTouchEventEmulationEnabled(m_touchEventEmulationEnabled);
170 #endif
171     settings.setAllowsInlineMediaPlayback(m_allowsInlineMediaPlayback);
172     settings.setInlineMediaPlaybackRequiresPlaysInlineAttribute(m_inlineMediaPlaybackRequiresPlaysInlineAttribute);
173     RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(m_pluginReplacementEnabled);
174     RuntimeEnabledFeatures::sharedFeatures().setIndexedDBWorkersEnabled(m_indexedDBWorkersEnabled);
175 }
176
177 class InternalSettingsWrapper : public Supplement<Page> {
178 public:
179     explicit InternalSettingsWrapper(Page* page)
180         : m_internalSettings(InternalSettings::create(page)) { }
181     virtual ~InternalSettingsWrapper() { m_internalSettings->hostDestroyed(); }
182 #if !ASSERT_DISABLED
183     bool isRefCountedWrapper() const override { return true; }
184 #endif
185     InternalSettings* internalSettings() const { return m_internalSettings.get(); }
186
187 private:
188     RefPtr<InternalSettings> m_internalSettings;
189 };
190
191 const char* InternalSettings::supplementName()
192 {
193     return "InternalSettings";
194 }
195
196 InternalSettings* InternalSettings::from(Page* page)
197 {
198     if (!Supplement<Page>::from(page, supplementName()))
199         Supplement<Page>::provideTo(page, supplementName(), std::make_unique<InternalSettingsWrapper>(page));
200     return static_cast<InternalSettingsWrapper*>(Supplement<Page>::from(page, supplementName()))->internalSettings();
201 }
202
203 InternalSettings::~InternalSettings()
204 {
205 }
206
207 InternalSettings::InternalSettings(Page* page)
208     : InternalSettingsGenerated(page)
209     , m_page(page)
210     , m_backup(page->settings())
211 {
212 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
213     page->settings().setAllowsAirPlayForMediaPlayback(false);
214 #endif
215 }
216
217 void InternalSettings::resetToConsistentState()
218 {
219     page()->setPageScaleFactor(1, IntPoint(0, 0));
220     page()->setCanStartMedia(true);
221     page()->settings().setForcePendingWebGLPolicy(false);
222 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
223     m_page->settings().setAllowsAirPlayForMediaPlayback(false);
224 #endif
225
226     m_backup.restoreTo(*settings());
227     m_backup = Backup(*settings());
228
229     InternalSettingsGenerated::resetToConsistentState();
230 }
231
232 Settings* InternalSettings::settings() const
233 {
234     if (!page())
235         return 0;
236     return &page()->settings();
237 }
238
239 void InternalSettings::setTouchEventEmulationEnabled(bool enabled, ExceptionCode& ec)
240 {
241 #if ENABLE(TOUCH_EVENTS)
242     InternalSettingsGuardForSettings();
243     settings()->setTouchEventEmulationEnabled(enabled);
244 #else
245     UNUSED_PARAM(enabled);
246     UNUSED_PARAM(ec);
247 #endif
248 }
249
250 void InternalSettings::setStandardFontFamily(const String& family, const String& script, ExceptionCode& ec)
251 {
252     InternalSettingsGuardForSettings();
253     UScriptCode code = scriptNameToCode(script);
254     if (code == USCRIPT_INVALID_CODE)
255         return;
256     m_backup.m_standardFontFamilies.add(code, settings()->standardFontFamily(code));
257     settings()->setStandardFontFamily(family, code);
258 }
259
260 void InternalSettings::setSerifFontFamily(const String& family, const String& script, ExceptionCode& ec)
261 {
262     InternalSettingsGuardForSettings();
263     UScriptCode code = scriptNameToCode(script);
264     if (code == USCRIPT_INVALID_CODE)
265         return;
266     m_backup.m_serifFontFamilies.add(code, settings()->serifFontFamily(code));
267     settings()->setSerifFontFamily(family, code);
268 }
269
270 void InternalSettings::setSansSerifFontFamily(const String& family, const String& script, ExceptionCode& ec)
271 {
272     InternalSettingsGuardForSettings();
273     UScriptCode code = scriptNameToCode(script);
274     if (code == USCRIPT_INVALID_CODE)
275         return;
276     m_backup.m_sansSerifFontFamilies.add(code, settings()->sansSerifFontFamily(code));
277     settings()->setSansSerifFontFamily(family, code);
278 }
279
280 void InternalSettings::setFixedFontFamily(const String& family, const String& script, ExceptionCode& ec)
281 {
282     InternalSettingsGuardForSettings();
283     UScriptCode code = scriptNameToCode(script);
284     if (code == USCRIPT_INVALID_CODE)
285         return;
286     m_backup.m_fixedFontFamilies.add(code, settings()->fixedFontFamily(code));
287     settings()->setFixedFontFamily(family, code);
288 }
289
290 void InternalSettings::setCursiveFontFamily(const String& family, const String& script, ExceptionCode& ec)
291 {
292     InternalSettingsGuardForSettings();
293     UScriptCode code = scriptNameToCode(script);
294     if (code == USCRIPT_INVALID_CODE)
295         return;
296     m_backup.m_cursiveFontFamilies.add(code, settings()->cursiveFontFamily(code));
297     settings()->setCursiveFontFamily(family, code);
298 }
299
300 void InternalSettings::setFantasyFontFamily(const String& family, const String& script, ExceptionCode& ec)
301 {
302     InternalSettingsGuardForSettings();
303     UScriptCode code = scriptNameToCode(script);
304     if (code == USCRIPT_INVALID_CODE)
305         return;
306     m_backup.m_fantasyFontFamilies.add(code, settings()->fantasyFontFamily(code));
307     settings()->setFantasyFontFamily(family, code);
308 }
309
310 void InternalSettings::setPictographFontFamily(const String& family, const String& script, ExceptionCode& ec)
311 {
312     InternalSettingsGuardForSettings();
313     UScriptCode code = scriptNameToCode(script);
314     if (code == USCRIPT_INVALID_CODE)
315         return;
316     m_backup.m_pictographFontFamilies.add(code, settings()->pictographFontFamily(code));
317     settings()->setPictographFontFamily(family, code);
318 }
319
320 void InternalSettings::setTextAutosizingEnabled(bool enabled, ExceptionCode& ec)
321 {
322 #if ENABLE(TEXT_AUTOSIZING)
323     InternalSettingsGuardForSettings();
324     settings()->setTextAutosizingEnabled(enabled);
325 #else
326     UNUSED_PARAM(enabled);
327     UNUSED_PARAM(ec);
328 #endif
329 }
330
331 void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height, ExceptionCode& ec)
332 {
333 #if ENABLE(TEXT_AUTOSIZING)
334     InternalSettingsGuardForSettings();
335     settings()->setTextAutosizingWindowSizeOverride(IntSize(width, height));
336 #else
337     UNUSED_PARAM(width);
338     UNUSED_PARAM(height);
339     UNUSED_PARAM(ec);
340 #endif
341 }
342
343 void InternalSettings::setMediaTypeOverride(const String& mediaType, ExceptionCode& ec)
344 {
345     InternalSettingsGuardForSettings();
346     settings()->setMediaTypeOverride(mediaType);
347 }
348
349 void InternalSettings::setTextAutosizingFontScaleFactor(float fontScaleFactor, ExceptionCode& ec)
350 {
351 #if ENABLE(TEXT_AUTOSIZING)
352     InternalSettingsGuardForSettings();
353     settings()->setTextAutosizingFontScaleFactor(fontScaleFactor);
354 #else
355     UNUSED_PARAM(fontScaleFactor);
356     UNUSED_PARAM(ec);
357 #endif
358 }
359
360 void InternalSettings::setCSSShapesEnabled(bool enabled, ExceptionCode& ec)
361 {
362     UNUSED_PARAM(ec);
363     RuntimeEnabledFeatures::sharedFeatures().setCSSShapesEnabled(enabled);
364 }
365
366 void InternalSettings::setCanStartMedia(bool enabled, ExceptionCode& ec)
367 {
368     InternalSettingsGuardForSettings();
369     m_page->setCanStartMedia(enabled);
370 }
371
372 void InternalSettings::setWirelessPlaybackDisabled(bool available)
373 {
374 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
375     m_page->settings().setAllowsAirPlayForMediaPlayback(available);
376 #else
377     UNUSED_PARAM(available);
378 #endif
379 }
380
381 void InternalSettings::setEditingBehavior(const String& editingBehavior, ExceptionCode& ec)
382 {
383     InternalSettingsGuardForSettings();
384     if (equalLettersIgnoringASCIICase(editingBehavior, "win"))
385         settings()->setEditingBehaviorType(EditingWindowsBehavior);
386     else if (equalLettersIgnoringASCIICase(editingBehavior, "mac"))
387         settings()->setEditingBehaviorType(EditingMacBehavior);
388     else if (equalLettersIgnoringASCIICase(editingBehavior, "unix"))
389         settings()->setEditingBehaviorType(EditingUnixBehavior);
390     else if (equalLettersIgnoringASCIICase(editingBehavior, "ios"))
391         settings()->setEditingBehaviorType(EditingIOSBehavior);
392     else
393         ec = SYNTAX_ERR;
394 }
395
396 void InternalSettings::setShouldDisplayTrackKind(const String& kind, bool enabled, ExceptionCode& ec)
397 {
398     InternalSettingsGuardForSettings();
399
400 #if ENABLE(VIDEO_TRACK)
401     if (!page())
402         return;
403
404     auto& captionPreferences = page()->group().captionPreferences();
405     if (equalLettersIgnoringASCIICase(kind, "subtitles"))
406         captionPreferences.setUserPrefersSubtitles(enabled);
407     else if (equalLettersIgnoringASCIICase(kind, "captions"))
408         captionPreferences.setUserPrefersCaptions(enabled);
409     else if (equalLettersIgnoringASCIICase(kind, "textdescriptions"))
410         captionPreferences.setUserPrefersTextDescriptions(enabled);
411     else
412         ec = SYNTAX_ERR;
413 #else
414     UNUSED_PARAM(kind);
415     UNUSED_PARAM(enabled);
416 #endif
417 }
418
419 bool InternalSettings::shouldDisplayTrackKind(const String& kind, ExceptionCode& ec)
420 {
421     InternalSettingsGuardForSettingsReturn(false);
422
423 #if ENABLE(VIDEO_TRACK)
424     if (!page())
425         return false;
426
427     auto& captionPreferences = page()->group().captionPreferences();
428     if (equalLettersIgnoringASCIICase(kind, "subtitles"))
429         return captionPreferences.userPrefersSubtitles();
430     if (equalLettersIgnoringASCIICase(kind, "captions"))
431         return captionPreferences.userPrefersCaptions();
432     if (equalLettersIgnoringASCIICase(kind, "textdescriptions"))
433         return captionPreferences.userPrefersTextDescriptions();
434
435     ec = SYNTAX_ERR;
436     return false;
437 #else
438     UNUSED_PARAM(kind);
439     return false;
440 #endif
441 }
442
443 void InternalSettings::setStorageBlockingPolicy(const String& mode, ExceptionCode& ec)
444 {
445     InternalSettingsGuardForSettings();
446
447     if (mode == "AllowAll")
448         settings()->setStorageBlockingPolicy(SecurityOrigin::AllowAllStorage);
449     else if (mode == "BlockThirdParty")
450         settings()->setStorageBlockingPolicy(SecurityOrigin::BlockThirdPartyStorage);
451     else if (mode == "BlockAll")
452         settings()->setStorageBlockingPolicy(SecurityOrigin::BlockAllStorage);
453     else
454         ec = SYNTAX_ERR;
455 }
456
457 void InternalSettings::setLangAttributeAwareFormControlUIEnabled(bool enabled)
458 {
459     RuntimeEnabledFeatures::sharedFeatures().setLangAttributeAwareFormControlUIEnabled(enabled);
460 }
461
462 void InternalSettings::setImagesEnabled(bool enabled, ExceptionCode& ec)
463 {
464     InternalSettingsGuardForSettings();
465     settings()->setImagesEnabled(enabled);
466 }
467
468 void InternalSettings::setMinimumTimerInterval(double intervalInSeconds, ExceptionCode& ec)
469 {
470     InternalSettingsGuardForSettings();
471     settings()->setMinimumDOMTimerInterval(std::chrono::milliseconds((std::chrono::milliseconds::rep)(intervalInSeconds * 1000)));
472 }
473
474 void InternalSettings::setDefaultVideoPosterURL(const String& url, ExceptionCode& ec)
475 {
476     InternalSettingsGuardForSettings();
477     settings()->setDefaultVideoPosterURL(url);
478 }
479
480 void InternalSettings::setForcePendingWebGLPolicy(bool forced, ExceptionCode& ec)
481 {
482     InternalSettingsGuardForSettings();
483     settings()->setForcePendingWebGLPolicy(forced);
484 }
485
486 void InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls(double time, ExceptionCode& ec)
487 {
488     InternalSettingsGuardForSettings();
489     settings()->setTimeWithoutMouseMovementBeforeHidingControls(time);
490 }
491
492 void InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode& ec)
493 {
494     InternalSettingsGuardForSettings();
495     settings()->setUseLegacyBackgroundSizeShorthandBehavior(enabled);
496 }
497
498 void InternalSettings::setAutoscrollForDragAndDropEnabled(bool enabled, ExceptionCode& ec)
499 {
500     InternalSettingsGuardForSettings();
501     settings()->setAutoscrollForDragAndDropEnabled(enabled);
502 }
503
504 void InternalSettings::setFontFallbackPrefersPictographs(bool preferPictographs, ExceptionCode& ec)
505 {
506     InternalSettingsGuardForSettings();
507     settings()->setFontFallbackPrefersPictographs(preferPictographs);
508 }
509
510 void InternalSettings::setPluginReplacementEnabled(bool enabled)
511 {
512     RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(enabled);
513 }
514
515 void InternalSettings::setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground, ExceptionCode& ec)
516 {
517     InternalSettingsGuardForSettings();
518     settings()->setBackgroundShouldExtendBeyondPage(hasExtendedBackground);
519 }
520
521 void InternalSettings::setShouldConvertPositionStyleOnCopy(bool convert, ExceptionCode& ec)
522 {
523     InternalSettingsGuardForSettings();
524     settings()->setShouldConvertPositionStyleOnCopy(convert);
525 }
526
527 void InternalSettings::setScrollingTreeIncludesFrames(bool enabled, ExceptionCode& ec)
528 {
529     InternalSettingsGuardForSettings();
530     settings()->setScrollingTreeIncludesFrames(enabled);
531 }
532
533 void InternalSettings::setAllowsInlineMediaPlayback(bool allows, ExceptionCode& ec)
534 {
535     InternalSettingsGuardForSettings();
536     settings()->setAllowsInlineMediaPlayback(allows);
537 }
538
539 void InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute(bool requires, ExceptionCode& ec)
540 {
541     InternalSettingsGuardForSettings();
542     settings()->setInlineMediaPlaybackRequiresPlaysInlineAttribute(requires);
543 }
544
545 void InternalSettings::setIndexedDBWorkersEnabled(bool enabled, ExceptionCode&)
546 {
547 #if ENABLE(INDEXED_DATABASE_IN_WORKERS)
548     RuntimeEnabledFeatures::sharedFeatures().setIndexedDBWorkersEnabled(enabled);
549 #endif
550 }
551
552
553 // If you add to this list, make sure that you update the Backup class for test reproducability!
554
555 }