ee3d15d8303e9381ebb6963e16fdcfebb61a6838
[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 {
107 }
108
109 void InternalSettings::Backup::restoreTo(Settings& settings)
110 {
111     RuntimeEnabledFeatures::sharedFeatures().setCSSShapesEnabled(m_originalCSSShapesEnabled);
112     settings.setEditingBehaviorType(m_originalEditingBehavior);
113
114     for (const auto& standardFont : m_standardFontFamilies)
115         settings.setStandardFontFamily(standardFont.value, static_cast<UScriptCode>(standardFont.key));
116     m_standardFontFamilies.clear();
117
118     for (const auto& fixedFont : m_fixedFontFamilies)
119         settings.setFixedFontFamily(fixedFont.value, static_cast<UScriptCode>(fixedFont.key));
120     m_fixedFontFamilies.clear();
121
122     for (const auto& serifFont : m_serifFontFamilies)
123         settings.setSerifFontFamily(serifFont.value, static_cast<UScriptCode>(serifFont.key));
124     m_serifFontFamilies.clear();
125
126     for (const auto& sansSerifFont : m_sansSerifFontFamilies)
127         settings.setSansSerifFontFamily(sansSerifFont.value, static_cast<UScriptCode>(sansSerifFont.key));
128     m_sansSerifFontFamilies.clear();
129
130     for (const auto& cursiveFont : m_cursiveFontFamilies)
131         settings.setCursiveFontFamily(cursiveFont.value, static_cast<UScriptCode>(cursiveFont.key));
132     m_cursiveFontFamilies.clear();
133
134     for (const auto& fantasyFont : m_fantasyFontFamilies)
135         settings.setFantasyFontFamily(fantasyFont.value, static_cast<UScriptCode>(fantasyFont.key));
136     m_fantasyFontFamilies.clear();
137
138     for (const auto& pictographFont : m_pictographFontFamilies)
139         settings.setPictographFontFamily(pictographFont.value, static_cast<UScriptCode>(pictographFont.key));
140     m_pictographFontFamilies.clear();
141
142 #if ENABLE(TEXT_AUTOSIZING)
143     settings.setTextAutosizingEnabled(m_originalTextAutosizingEnabled);
144     settings.setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindowSizeOverride);
145     settings.setTextAutosizingFontScaleFactor(m_originalTextAutosizingFontScaleFactor);
146 #endif
147     settings.setMediaTypeOverride(m_originalMediaTypeOverride);
148     settings.setCanvasUsesAcceleratedDrawing(m_originalCanvasUsesAcceleratedDrawing);
149     RuntimeEnabledFeatures::sharedFeatures().setLangAttributeAwareFormControlUIEnabled(m_langAttributeAwareFormControlUIEnabled);
150     settings.setImagesEnabled(m_imagesEnabled);
151     settings.setMinimumDOMTimerInterval(m_minimumTimerInterval);
152 #if ENABLE(VIDEO_TRACK)
153     settings.setShouldDisplaySubtitles(m_shouldDisplaySubtitles);
154     settings.setShouldDisplayCaptions(m_shouldDisplayCaptions);
155     settings.setShouldDisplayTextDescriptions(m_shouldDisplayTextDescriptions);
156 #endif
157     settings.setDefaultVideoPosterURL(m_defaultVideoPosterURL);
158     settings.setForcePendingWebGLPolicy(m_forcePendingWebGLPolicy);
159     settings.setTimeWithoutMouseMovementBeforeHidingControls(m_originalTimeWithoutMouseMovementBeforeHidingControls);
160     settings.setUseLegacyBackgroundSizeShorthandBehavior(m_useLegacyBackgroundSizeShorthandBehavior);
161     settings.setAutoscrollForDragAndDropEnabled(m_autoscrollForDragAndDropEnabled);
162     settings.setShouldConvertPositionStyleOnCopy(m_shouldConvertPositionStyleOnCopy);
163     settings.setFontFallbackPrefersPictographs(m_fontFallbackPrefersPictographs);
164     settings.setBackgroundShouldExtendBeyondPage(m_backgroundShouldExtendBeyondPage);
165     settings.setStorageBlockingPolicy(m_storageBlockingPolicy);
166     settings.setScrollingTreeIncludesFrames(m_scrollingTreeIncludesFrames);
167 #if ENABLE(TOUCH_EVENTS)
168     settings.setTouchEventEmulationEnabled(m_touchEventEmulationEnabled);
169 #endif
170     settings.setAllowsInlineMediaPlayback(m_allowsInlineMediaPlayback);
171     settings.setInlineMediaPlaybackRequiresPlaysInlineAttribute(m_inlineMediaPlaybackRequiresPlaysInlineAttribute);
172     RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(m_pluginReplacementEnabled);
173 }
174
175 class InternalSettingsWrapper : public Supplement<Page> {
176 public:
177     explicit InternalSettingsWrapper(Page* page)
178         : m_internalSettings(InternalSettings::create(page)) { }
179     virtual ~InternalSettingsWrapper() { m_internalSettings->hostDestroyed(); }
180 #if !ASSERT_DISABLED
181     virtual bool isRefCountedWrapper() const override { return true; }
182 #endif
183     InternalSettings* internalSettings() const { return m_internalSettings.get(); }
184
185 private:
186     RefPtr<InternalSettings> m_internalSettings;
187 };
188
189 const char* InternalSettings::supplementName()
190 {
191     return "InternalSettings";
192 }
193
194 InternalSettings* InternalSettings::from(Page* page)
195 {
196     if (!Supplement<Page>::from(page, supplementName()))
197         Supplement<Page>::provideTo(page, supplementName(), std::make_unique<InternalSettingsWrapper>(page));
198     return static_cast<InternalSettingsWrapper*>(Supplement<Page>::from(page, supplementName()))->internalSettings();
199 }
200
201 InternalSettings::~InternalSettings()
202 {
203 }
204
205 InternalSettings::InternalSettings(Page* page)
206     : InternalSettingsGenerated(page)
207     , m_page(page)
208     , m_backup(page->settings())
209 {
210 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
211     page->settings().setAllowsAirPlayForMediaPlayback(false);
212 #endif
213 }
214
215 void InternalSettings::resetToConsistentState()
216 {
217     page()->setPageScaleFactor(1, IntPoint(0, 0));
218     page()->setCanStartMedia(true);
219     page()->settings().setForcePendingWebGLPolicy(false);
220 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
221     m_page->settings().setAllowsAirPlayForMediaPlayback(false);
222 #endif
223
224     m_backup.restoreTo(*settings());
225     m_backup = Backup(*settings());
226
227     InternalSettingsGenerated::resetToConsistentState();
228 }
229
230 Settings* InternalSettings::settings() const
231 {
232     if (!page())
233         return 0;
234     return &page()->settings();
235 }
236
237 void InternalSettings::setTouchEventEmulationEnabled(bool enabled, ExceptionCode& ec)
238 {
239 #if ENABLE(TOUCH_EVENTS)
240     InternalSettingsGuardForSettings();
241     settings()->setTouchEventEmulationEnabled(enabled);
242 #else
243     UNUSED_PARAM(enabled);
244     UNUSED_PARAM(ec);
245 #endif
246 }
247
248 void InternalSettings::setStandardFontFamily(const String& family, const String& script, ExceptionCode& ec)
249 {
250     InternalSettingsGuardForSettings();
251     UScriptCode code = scriptNameToCode(script);
252     if (code == USCRIPT_INVALID_CODE)
253         return;
254     m_backup.m_standardFontFamilies.add(code, settings()->standardFontFamily(code));
255     settings()->setStandardFontFamily(family, code);
256 }
257
258 void InternalSettings::setSerifFontFamily(const String& family, const String& script, ExceptionCode& ec)
259 {
260     InternalSettingsGuardForSettings();
261     UScriptCode code = scriptNameToCode(script);
262     if (code == USCRIPT_INVALID_CODE)
263         return;
264     m_backup.m_serifFontFamilies.add(code, settings()->serifFontFamily(code));
265     settings()->setSerifFontFamily(family, code);
266 }
267
268 void InternalSettings::setSansSerifFontFamily(const String& family, const String& script, ExceptionCode& ec)
269 {
270     InternalSettingsGuardForSettings();
271     UScriptCode code = scriptNameToCode(script);
272     if (code == USCRIPT_INVALID_CODE)
273         return;
274     m_backup.m_sansSerifFontFamilies.add(code, settings()->sansSerifFontFamily(code));
275     settings()->setSansSerifFontFamily(family, code);
276 }
277
278 void InternalSettings::setFixedFontFamily(const String& family, const String& script, ExceptionCode& ec)
279 {
280     InternalSettingsGuardForSettings();
281     UScriptCode code = scriptNameToCode(script);
282     if (code == USCRIPT_INVALID_CODE)
283         return;
284     m_backup.m_fixedFontFamilies.add(code, settings()->fixedFontFamily(code));
285     settings()->setFixedFontFamily(family, code);
286 }
287
288 void InternalSettings::setCursiveFontFamily(const String& family, const String& script, ExceptionCode& ec)
289 {
290     InternalSettingsGuardForSettings();
291     UScriptCode code = scriptNameToCode(script);
292     if (code == USCRIPT_INVALID_CODE)
293         return;
294     m_backup.m_cursiveFontFamilies.add(code, settings()->cursiveFontFamily(code));
295     settings()->setCursiveFontFamily(family, code);
296 }
297
298 void InternalSettings::setFantasyFontFamily(const String& family, const String& script, ExceptionCode& ec)
299 {
300     InternalSettingsGuardForSettings();
301     UScriptCode code = scriptNameToCode(script);
302     if (code == USCRIPT_INVALID_CODE)
303         return;
304     m_backup.m_fantasyFontFamilies.add(code, settings()->fantasyFontFamily(code));
305     settings()->setFantasyFontFamily(family, code);
306 }
307
308 void InternalSettings::setPictographFontFamily(const String& family, const String& script, ExceptionCode& ec)
309 {
310     InternalSettingsGuardForSettings();
311     UScriptCode code = scriptNameToCode(script);
312     if (code == USCRIPT_INVALID_CODE)
313         return;
314     m_backup.m_pictographFontFamilies.add(code, settings()->pictographFontFamily(code));
315     settings()->setPictographFontFamily(family, code);
316 }
317
318 void InternalSettings::setTextAutosizingEnabled(bool enabled, ExceptionCode& ec)
319 {
320 #if ENABLE(TEXT_AUTOSIZING)
321     InternalSettingsGuardForSettings();
322     settings()->setTextAutosizingEnabled(enabled);
323 #else
324     UNUSED_PARAM(enabled);
325     UNUSED_PARAM(ec);
326 #endif
327 }
328
329 void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height, ExceptionCode& ec)
330 {
331 #if ENABLE(TEXT_AUTOSIZING)
332     InternalSettingsGuardForSettings();
333     settings()->setTextAutosizingWindowSizeOverride(IntSize(width, height));
334 #else
335     UNUSED_PARAM(width);
336     UNUSED_PARAM(height);
337     UNUSED_PARAM(ec);
338 #endif
339 }
340
341 void InternalSettings::setMediaTypeOverride(const String& mediaType, ExceptionCode& ec)
342 {
343     InternalSettingsGuardForSettings();
344     settings()->setMediaTypeOverride(mediaType);
345 }
346
347 void InternalSettings::setTextAutosizingFontScaleFactor(float fontScaleFactor, ExceptionCode& ec)
348 {
349 #if ENABLE(TEXT_AUTOSIZING)
350     InternalSettingsGuardForSettings();
351     settings()->setTextAutosizingFontScaleFactor(fontScaleFactor);
352 #else
353     UNUSED_PARAM(fontScaleFactor);
354     UNUSED_PARAM(ec);
355 #endif
356 }
357
358 void InternalSettings::setCSSShapesEnabled(bool enabled, ExceptionCode& ec)
359 {
360     UNUSED_PARAM(ec);
361     RuntimeEnabledFeatures::sharedFeatures().setCSSShapesEnabled(enabled);
362 }
363
364 void InternalSettings::setCanStartMedia(bool enabled, ExceptionCode& ec)
365 {
366     InternalSettingsGuardForSettings();
367     m_page->setCanStartMedia(enabled);
368 }
369
370 void InternalSettings::setWirelessPlaybackDisabled(bool available)
371 {
372 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
373     m_page->settings().setAllowsAirPlayForMediaPlayback(available);
374 #else
375     UNUSED_PARAM(available);
376 #endif
377 }
378
379 void InternalSettings::setEditingBehavior(const String& editingBehavior, ExceptionCode& ec)
380 {
381     InternalSettingsGuardForSettings();
382     if (equalIgnoringCase(editingBehavior, "win"))
383         settings()->setEditingBehaviorType(EditingWindowsBehavior);
384     else if (equalIgnoringCase(editingBehavior, "mac"))
385         settings()->setEditingBehaviorType(EditingMacBehavior);
386     else if (equalIgnoringCase(editingBehavior, "unix"))
387         settings()->setEditingBehaviorType(EditingUnixBehavior);
388     else if (equalIgnoringCase(editingBehavior, "ios"))
389         settings()->setEditingBehaviorType(EditingIOSBehavior);
390     else
391         ec = SYNTAX_ERR;
392 }
393
394 void InternalSettings::setShouldDisplayTrackKind(const String& kind, bool enabled, ExceptionCode& ec)
395 {
396     InternalSettingsGuardForSettings();
397
398 #if ENABLE(VIDEO_TRACK)
399     if (!page())
400         return;
401     CaptionUserPreferences* captionPreferences = page()->group().captionPreferences();
402
403     if (equalIgnoringCase(kind, "Subtitles"))
404         captionPreferences->setUserPrefersSubtitles(enabled);
405     else if (equalIgnoringCase(kind, "Captions"))
406         captionPreferences->setUserPrefersCaptions(enabled);
407     else if (equalIgnoringCase(kind, "TextDescriptions"))
408         captionPreferences->setUserPrefersTextDescriptions(enabled);
409     else
410         ec = SYNTAX_ERR;
411 #else
412     UNUSED_PARAM(kind);
413     UNUSED_PARAM(enabled);
414 #endif
415 }
416
417 bool InternalSettings::shouldDisplayTrackKind(const String& kind, ExceptionCode& ec)
418 {
419     InternalSettingsGuardForSettingsReturn(false);
420
421 #if ENABLE(VIDEO_TRACK)
422     if (!page())
423         return false;
424     CaptionUserPreferences* captionPreferences = page()->group().captionPreferences();
425
426     if (equalIgnoringCase(kind, "Subtitles"))
427         return captionPreferences->userPrefersSubtitles();
428     if (equalIgnoringCase(kind, "Captions"))
429         return captionPreferences->userPrefersCaptions();
430     if (equalIgnoringCase(kind, "TextDescriptions"))
431         return captionPreferences->userPrefersTextDescriptions();
432
433     ec = SYNTAX_ERR;
434     return false;
435 #else
436     UNUSED_PARAM(kind);
437     return false;
438 #endif
439 }
440
441 void InternalSettings::setStorageBlockingPolicy(const String& mode, ExceptionCode& ec)
442 {
443     InternalSettingsGuardForSettings();
444
445     if (mode == "AllowAll")
446         settings()->setStorageBlockingPolicy(SecurityOrigin::AllowAllStorage);
447     else if (mode == "BlockThirdParty")
448         settings()->setStorageBlockingPolicy(SecurityOrigin::BlockThirdPartyStorage);
449     else if (mode == "BlockAll")
450         settings()->setStorageBlockingPolicy(SecurityOrigin::BlockAllStorage);
451     else
452         ec = SYNTAX_ERR;
453 }
454
455 void InternalSettings::setLangAttributeAwareFormControlUIEnabled(bool enabled)
456 {
457     RuntimeEnabledFeatures::sharedFeatures().setLangAttributeAwareFormControlUIEnabled(enabled);
458 }
459
460 void InternalSettings::setImagesEnabled(bool enabled, ExceptionCode& ec)
461 {
462     InternalSettingsGuardForSettings();
463     settings()->setImagesEnabled(enabled);
464 }
465
466 void InternalSettings::setMinimumTimerInterval(double intervalInSeconds, ExceptionCode& ec)
467 {
468     InternalSettingsGuardForSettings();
469     settings()->setMinimumDOMTimerInterval(intervalInSeconds);
470 }
471
472 void InternalSettings::setDefaultVideoPosterURL(const String& url, ExceptionCode& ec)
473 {
474     InternalSettingsGuardForSettings();
475     settings()->setDefaultVideoPosterURL(url);
476 }
477
478 void InternalSettings::setForcePendingWebGLPolicy(bool forced, ExceptionCode& ec)
479 {
480     InternalSettingsGuardForSettings();
481     settings()->setForcePendingWebGLPolicy(forced);
482 }
483
484 void InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls(double time, ExceptionCode& ec)
485 {
486     InternalSettingsGuardForSettings();
487     settings()->setTimeWithoutMouseMovementBeforeHidingControls(time);
488 }
489
490 void InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode& ec)
491 {
492     InternalSettingsGuardForSettings();
493     settings()->setUseLegacyBackgroundSizeShorthandBehavior(enabled);
494 }
495
496 void InternalSettings::setAutoscrollForDragAndDropEnabled(bool enabled, ExceptionCode& ec)
497 {
498     InternalSettingsGuardForSettings();
499     settings()->setAutoscrollForDragAndDropEnabled(enabled);
500 }
501
502 void InternalSettings::setFontFallbackPrefersPictographs(bool preferPictographs, ExceptionCode& ec)
503 {
504     InternalSettingsGuardForSettings();
505     settings()->setFontFallbackPrefersPictographs(preferPictographs);
506 }
507
508 void InternalSettings::setPluginReplacementEnabled(bool enabled)
509 {
510     RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(enabled);
511 }
512
513 void InternalSettings::setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground, ExceptionCode& ec)
514 {
515     InternalSettingsGuardForSettings();
516     settings()->setBackgroundShouldExtendBeyondPage(hasExtendedBackground);
517 }
518
519 void InternalSettings::setShouldConvertPositionStyleOnCopy(bool convert, ExceptionCode& ec)
520 {
521     InternalSettingsGuardForSettings();
522     settings()->setShouldConvertPositionStyleOnCopy(convert);
523 }
524
525 void InternalSettings::setScrollingTreeIncludesFrames(bool enabled, ExceptionCode& ec)
526 {
527     InternalSettingsGuardForSettings();
528     settings()->setScrollingTreeIncludesFrames(enabled);
529 }
530
531 void InternalSettings::setAllowsInlineMediaPlayback(bool allows, ExceptionCode& ec)
532 {
533     InternalSettingsGuardForSettings();
534     settings()->setAllowsInlineMediaPlayback(allows);
535 }
536
537 void InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute(bool requires, ExceptionCode& ec)
538 {
539     InternalSettingsGuardForSettings();
540     settings()->setInlineMediaPlaybackRequiresPlaysInlineAttribute(requires);
541 }
542
543 // If you add to this list, make sure that you update the Backup class for test reproducability!
544
545 }