Need a way to test the tile cache with margins enabled
[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_originalCSSExclusionsEnabled(RuntimeEnabledFeatures::sharedFeatures().cssExclusionsEnabled())
70     , m_originalCSSShapesEnabled(RuntimeEnabledFeatures::sharedFeatures().cssShapesEnabled())
71 #if ENABLE(SHADOW_DOM)
72     , m_originalShadowDOMEnabled(RuntimeEnabledFeatures::sharedFeatures().shadowDOMEnabled())
73     , m_originalAuthorShadowDOMForAnyElementEnabled(RuntimeEnabledFeatures::sharedFeatures().authorShadowDOMForAnyElementEnabled())
74 #endif
75     , m_originalEditingBehavior(settings.editingBehaviorType())
76 #if ENABLE(TEXT_AUTOSIZING)
77     , m_originalTextAutosizingEnabled(settings.textAutosizingEnabled())
78     , m_originalTextAutosizingWindowSizeOverride(settings.textAutosizingWindowSizeOverride())
79     , m_originalTextAutosizingFontScaleFactor(settings.textAutosizingFontScaleFactor())
80 #endif
81     , m_originalMediaTypeOverride(settings.mediaTypeOverride())
82     , m_originalCanvasUsesAcceleratedDrawing(settings.canvasUsesAcceleratedDrawing())
83     , m_originalMockScrollbarsEnabled(settings.mockScrollbarsEnabled())
84     , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::sharedFeatures().langAttributeAwareFormControlUIEnabled())
85     , m_imagesEnabled(settings.areImagesEnabled())
86     , m_minimumTimerInterval(settings.minDOMTimerInterval())
87 #if ENABLE(VIDEO_TRACK)
88     , m_shouldDisplaySubtitles(settings.shouldDisplaySubtitles())
89     , m_shouldDisplayCaptions(settings.shouldDisplayCaptions())
90     , m_shouldDisplayTextDescriptions(settings.shouldDisplayTextDescriptions())
91 #endif
92     , m_defaultVideoPosterURL(settings.defaultVideoPosterURL())
93     , m_originalTimeWithoutMouseMovementBeforeHidingControls(settings.timeWithoutMouseMovementBeforeHidingControls())
94     , m_useLegacyBackgroundSizeShorthandBehavior(settings.useLegacyBackgroundSizeShorthandBehavior())
95     , m_autoscrollForDragAndDropEnabled(settings.autoscrollForDragAndDropEnabled())
96     , m_pluginReplacementEnabled(RuntimeEnabledFeatures::sharedFeatures().pluginReplacementEnabled())
97 {
98 }
99
100 void InternalSettings::Backup::restoreTo(Settings& settings)
101 {
102     RuntimeEnabledFeatures::sharedFeatures().setCSSExclusionsEnabled(m_originalCSSExclusionsEnabled);
103     RuntimeEnabledFeatures::sharedFeatures().setCSSShapesEnabled(m_originalCSSShapesEnabled);
104 #if ENABLE(SHADOW_DOM)
105     RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled(m_originalShadowDOMEnabled);
106     RuntimeEnabledFeatures::sharedFeatures().setAuthorShadowDOMForAnyElementEnabled(m_originalAuthorShadowDOMForAnyElementEnabled);
107 #endif
108     settings.setEditingBehaviorType(m_originalEditingBehavior);
109
110     for (auto iter = m_standardFontFamilies.begin(); iter != m_standardFontFamilies.end(); ++iter)
111         settings.setStandardFontFamily(iter->value, static_cast<UScriptCode>(iter->key));
112     m_standardFontFamilies.clear();
113
114     for (auto iter = m_fixedFontFamilies.begin(); iter != m_fixedFontFamilies.end(); ++iter)
115         settings.setFixedFontFamily(iter->value, static_cast<UScriptCode>(iter->key));
116     m_fixedFontFamilies.clear();
117
118     for (auto iter = m_serifFontFamilies.begin(); iter != m_serifFontFamilies.end(); ++iter)
119         settings.setSerifFontFamily(iter->value, static_cast<UScriptCode>(iter->key));
120     m_serifFontFamilies.clear();
121
122     for (auto iter = m_sansSerifFontFamilies.begin(); iter != m_sansSerifFontFamilies.end(); ++iter)
123         settings.setSansSerifFontFamily(iter->value, static_cast<UScriptCode>(iter->key));
124     m_sansSerifFontFamilies.clear();
125
126     for (auto iter = m_cursiveFontFamilies.begin(); iter != m_cursiveFontFamilies.end(); ++iter)
127         settings.setCursiveFontFamily(iter->value, static_cast<UScriptCode>(iter->key));
128     m_cursiveFontFamilies.clear();
129
130     for (auto iter = m_fantasyFontFamilies.begin(); iter != m_fantasyFontFamilies.end(); ++iter)
131         settings.setFantasyFontFamily(iter->value, static_cast<UScriptCode>(iter->key));
132     m_fantasyFontFamilies.clear();
133
134     for (auto iter = m_pictographFontFamilies.begin(); iter != m_pictographFontFamilies.end(); ++iter)
135         settings.setPictographFontFamily(iter->value, static_cast<UScriptCode>(iter->key));
136     m_pictographFontFamilies.clear();
137
138 #if ENABLE(TEXT_AUTOSIZING)
139     settings.setTextAutosizingEnabled(m_originalTextAutosizingEnabled);
140     settings.setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindowSizeOverride);
141     settings.setTextAutosizingFontScaleFactor(m_originalTextAutosizingFontScaleFactor);
142 #endif
143     settings.setMediaTypeOverride(m_originalMediaTypeOverride);
144     settings.setCanvasUsesAcceleratedDrawing(m_originalCanvasUsesAcceleratedDrawing);
145     settings.setMockScrollbarsEnabled(m_originalMockScrollbarsEnabled);
146     RuntimeEnabledFeatures::sharedFeatures().setLangAttributeAwareFormControlUIEnabled(m_langAttributeAwareFormControlUIEnabled);
147     settings.setImagesEnabled(m_imagesEnabled);
148     settings.setMinDOMTimerInterval(m_minimumTimerInterval);
149 #if ENABLE(VIDEO_TRACK)
150     settings.setShouldDisplaySubtitles(m_shouldDisplaySubtitles);
151     settings.setShouldDisplayCaptions(m_shouldDisplayCaptions);
152     settings.setShouldDisplayTextDescriptions(m_shouldDisplayTextDescriptions);
153 #endif
154     settings.setDefaultVideoPosterURL(m_defaultVideoPosterURL);
155     settings.setTimeWithoutMouseMovementBeforeHidingControls(m_originalTimeWithoutMouseMovementBeforeHidingControls);
156     settings.setUseLegacyBackgroundSizeShorthandBehavior(m_useLegacyBackgroundSizeShorthandBehavior);
157     settings.setAutoscrollForDragAndDropEnabled(m_autoscrollForDragAndDropEnabled);
158     RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(m_pluginReplacementEnabled);
159 }
160
161 // We can't use RefCountedSupplement because that would try to make InternalSettings RefCounted
162 // and InternalSettings is already RefCounted via its base class, InternalSettingsGenerated.
163 // Instead, we manually make InternalSettings supplement Page.
164 class InternalSettingsWrapper : public Supplement<Page> {
165 public:
166     explicit InternalSettingsWrapper(Page* page)
167         : m_internalSettings(InternalSettings::create(page)) { }
168     virtual ~InternalSettingsWrapper() { m_internalSettings->hostDestroyed(); }
169 #if !ASSERT_DISABLED
170     virtual bool isRefCountedWrapper() const override { return true; }
171 #endif
172     InternalSettings* internalSettings() const { return m_internalSettings.get(); }
173
174 private:
175     RefPtr<InternalSettings> m_internalSettings;
176 };
177
178 const char* InternalSettings::supplementName()
179 {
180     return "InternalSettings";
181 }
182
183 InternalSettings* InternalSettings::from(Page* page)
184 {
185     if (!Supplement<Page>::from(page, supplementName()))
186         Supplement<Page>::provideTo(page, supplementName(), adoptPtr(new InternalSettingsWrapper(page)));
187     return static_cast<InternalSettingsWrapper*>(Supplement<Page>::from(page, supplementName()))->internalSettings();
188 }
189
190 InternalSettings::~InternalSettings()
191 {
192 }
193
194 InternalSettings::InternalSettings(Page* page)
195     : InternalSettingsGenerated(page)
196     , m_page(page)
197     , m_backup(page->settings())
198 {
199 }
200
201 void InternalSettings::resetToConsistentState()
202 {
203     page()->setPageScaleFactor(1, IntPoint(0, 0));
204     page()->setCanStartMedia(true);
205
206     m_backup.restoreTo(*settings());
207     m_backup = Backup(*settings());
208
209     InternalSettingsGenerated::resetToConsistentState();
210 }
211
212 Settings* InternalSettings::settings() const
213 {
214     if (!page())
215         return 0;
216     return &page()->settings();
217 }
218
219 void InternalSettings::setMockScrollbarsEnabled(bool enabled, ExceptionCode& ec)
220 {
221     InternalSettingsGuardForSettings();
222     settings()->setMockScrollbarsEnabled(enabled);
223 }
224
225 static bool urlIsWhitelistedForSetShadowDOMEnabled(const String& url)
226 {
227     // This check is just for preventing fuzzers from crashing because of unintended API calls.
228     // You can list your test if needed.
229     return notFound != url.find("fast/dom/shadow/content-shadow-unknown.html")
230         || notFound != url.find("fast/dom/shadow/insertion-points-with-shadow-disabled.html");
231 }
232
233 void InternalSettings::setShadowDOMEnabled(bool enabled, ExceptionCode& ec)
234 {
235     if (!urlIsWhitelistedForSetShadowDOMEnabled(page()->mainFrame().document()->url().string())) {
236         ec = INVALID_ACCESS_ERR;
237         return;
238     }
239
240 #if ENABLE(SHADOW_DOM)
241     RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled(enabled);
242 #else
243     // Even SHADOW_DOM is off, InternalSettings allows setShadowDOMEnabled(false) to
244     // have broader test coverage. But it cannot be setShadowDOMEnabled(true).
245     if (enabled)
246         ec = INVALID_ACCESS_ERR;
247 #endif
248 }
249
250 void InternalSettings::setAuthorShadowDOMForAnyElementEnabled(bool isEnabled)
251 {
252 #if ENABLE(SHADOW_DOM)
253     RuntimeEnabledFeatures::sharedFeatures().setAuthorShadowDOMForAnyElementEnabled(isEnabled);
254 #else
255     UNUSED_PARAM(isEnabled);
256 #endif
257 }
258
259 void InternalSettings::setTouchEventEmulationEnabled(bool enabled, ExceptionCode& ec)
260 {
261 #if ENABLE(TOUCH_EVENTS)
262     InternalSettingsGuardForSettings();
263     settings()->setTouchEventEmulationEnabled(enabled);
264 #else
265     UNUSED_PARAM(enabled);
266     UNUSED_PARAM(ec);
267 #endif
268 }
269
270 void InternalSettings::setStandardFontFamily(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_standardFontFamilies.add(code, settings()->standardFontFamily(code));
277     settings()->setStandardFontFamily(family, code);
278 }
279
280 void InternalSettings::setSerifFontFamily(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_serifFontFamilies.add(code, settings()->serifFontFamily(code));
287     settings()->setSerifFontFamily(family, code);
288 }
289
290 void InternalSettings::setSansSerifFontFamily(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_sansSerifFontFamilies.add(code, settings()->sansSerifFontFamily(code));
297     settings()->setSansSerifFontFamily(family, code);
298 }
299
300 void InternalSettings::setFixedFontFamily(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_fixedFontFamilies.add(code, settings()->fixedFontFamily(code));
307     settings()->setFixedFontFamily(family, code);
308 }
309
310 void InternalSettings::setCursiveFontFamily(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_cursiveFontFamilies.add(code, settings()->cursiveFontFamily(code));
317     settings()->setCursiveFontFamily(family, code);
318 }
319
320 void InternalSettings::setFantasyFontFamily(const String& family, const String& script, ExceptionCode& ec)
321 {
322     InternalSettingsGuardForSettings();
323     UScriptCode code = scriptNameToCode(script);
324     if (code == USCRIPT_INVALID_CODE)
325         return;
326     m_backup.m_fantasyFontFamilies.add(code, settings()->fantasyFontFamily(code));
327     settings()->setFantasyFontFamily(family, code);
328 }
329
330 void InternalSettings::setPictographFontFamily(const String& family, const String& script, ExceptionCode& ec)
331 {
332     InternalSettingsGuardForSettings();
333     UScriptCode code = scriptNameToCode(script);
334     if (code == USCRIPT_INVALID_CODE)
335         return;
336     m_backup.m_pictographFontFamilies.add(code, settings()->pictographFontFamily(code));
337     settings()->setPictographFontFamily(family, code);
338 }
339
340 void InternalSettings::setTextAutosizingEnabled(bool enabled, ExceptionCode& ec)
341 {
342 #if ENABLE(TEXT_AUTOSIZING)
343     InternalSettingsGuardForSettings();
344     settings()->setTextAutosizingEnabled(enabled);
345 #else
346     UNUSED_PARAM(enabled);
347     UNUSED_PARAM(ec);
348 #endif
349 }
350
351 void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height, ExceptionCode& ec)
352 {
353 #if ENABLE(TEXT_AUTOSIZING)
354     InternalSettingsGuardForSettings();
355     settings()->setTextAutosizingWindowSizeOverride(IntSize(width, height));
356 #else
357     UNUSED_PARAM(width);
358     UNUSED_PARAM(height);
359     UNUSED_PARAM(ec);
360 #endif
361 }
362
363 void InternalSettings::setMediaTypeOverride(const String& mediaType, ExceptionCode& ec)
364 {
365     InternalSettingsGuardForSettings();
366     settings()->setMediaTypeOverride(mediaType);
367 }
368
369 void InternalSettings::setTextAutosizingFontScaleFactor(float fontScaleFactor, ExceptionCode& ec)
370 {
371 #if ENABLE(TEXT_AUTOSIZING)
372     InternalSettingsGuardForSettings();
373     settings()->setTextAutosizingFontScaleFactor(fontScaleFactor);
374 #else
375     UNUSED_PARAM(fontScaleFactor);
376     UNUSED_PARAM(ec);
377 #endif
378 }
379
380 void InternalSettings::setCSSExclusionsEnabled(bool enabled, ExceptionCode& ec)
381 {
382     UNUSED_PARAM(ec);
383     RuntimeEnabledFeatures::sharedFeatures().setCSSExclusionsEnabled(enabled);
384 }
385
386 void InternalSettings::setCSSShapesEnabled(bool enabled, ExceptionCode& ec)
387 {
388     UNUSED_PARAM(ec);
389     RuntimeEnabledFeatures::sharedFeatures().setCSSShapesEnabled(enabled);
390 }
391
392 void InternalSettings::setCanStartMedia(bool enabled, ExceptionCode& ec)
393 {
394     InternalSettingsGuardForSettings();
395     m_page->setCanStartMedia(enabled);
396 }
397
398 void InternalSettings::setEditingBehavior(const String& editingBehavior, ExceptionCode& ec)
399 {
400     InternalSettingsGuardForSettings();
401     if (equalIgnoringCase(editingBehavior, "win"))
402         settings()->setEditingBehaviorType(EditingWindowsBehavior);
403     else if (equalIgnoringCase(editingBehavior, "mac"))
404         settings()->setEditingBehaviorType(EditingMacBehavior);
405     else if (equalIgnoringCase(editingBehavior, "unix"))
406         settings()->setEditingBehaviorType(EditingUnixBehavior);
407     else
408         ec = SYNTAX_ERR;
409 }
410
411 void InternalSettings::setShouldDisplayTrackKind(const String& kind, bool enabled, ExceptionCode& ec)
412 {
413     InternalSettingsGuardForSettings();
414
415 #if ENABLE(VIDEO_TRACK)
416     if (!page())
417         return;
418     CaptionUserPreferences* captionPreferences = page()->group().captionPreferences();
419
420     if (equalIgnoringCase(kind, "Subtitles"))
421         captionPreferences->setUserPrefersSubtitles(enabled);
422     else if (equalIgnoringCase(kind, "Captions"))
423         captionPreferences->setUserPrefersCaptions(enabled);
424     else if (equalIgnoringCase(kind, "TextDescriptions"))
425         captionPreferences->setUserPrefersTextDescriptions(enabled);
426     else
427         ec = SYNTAX_ERR;
428 #else
429     UNUSED_PARAM(kind);
430     UNUSED_PARAM(enabled);
431 #endif
432 }
433
434 bool InternalSettings::shouldDisplayTrackKind(const String& kind, ExceptionCode& ec)
435 {
436     InternalSettingsGuardForSettingsReturn(false);
437
438 #if ENABLE(VIDEO_TRACK)
439     if (!page())
440         return false;
441     CaptionUserPreferences* captionPreferences = page()->group().captionPreferences();
442
443     if (equalIgnoringCase(kind, "Subtitles"))
444         return captionPreferences->userPrefersSubtitles();
445     if (equalIgnoringCase(kind, "Captions"))
446         return captionPreferences->userPrefersCaptions();
447     if (equalIgnoringCase(kind, "TextDescriptions"))
448         return captionPreferences->userPrefersTextDescriptions();
449
450     ec = SYNTAX_ERR;
451     return false;
452 #else
453     UNUSED_PARAM(kind);
454     return false;
455 #endif
456 }
457
458 void InternalSettings::setStorageBlockingPolicy(const String& mode, ExceptionCode& ec)
459 {
460     InternalSettingsGuardForSettings();
461
462     if (mode == "AllowAll")
463         settings()->setStorageBlockingPolicy(SecurityOrigin::AllowAllStorage);
464     else if (mode == "BlockThirdParty")
465         settings()->setStorageBlockingPolicy(SecurityOrigin::BlockThirdPartyStorage);
466     else if (mode == "BlockAll")
467         settings()->setStorageBlockingPolicy(SecurityOrigin::BlockAllStorage);
468     else
469         ec = SYNTAX_ERR;
470 }
471
472 void InternalSettings::setLangAttributeAwareFormControlUIEnabled(bool enabled)
473 {
474     RuntimeEnabledFeatures::sharedFeatures().setLangAttributeAwareFormControlUIEnabled(enabled);
475 }
476
477 void InternalSettings::setImagesEnabled(bool enabled, ExceptionCode& ec)
478 {
479     InternalSettingsGuardForSettings();
480     settings()->setImagesEnabled(enabled);
481 }
482
483 void InternalSettings::setMinimumTimerInterval(double intervalInSeconds, ExceptionCode& ec)
484 {
485     InternalSettingsGuardForSettings();
486     settings()->setMinDOMTimerInterval(intervalInSeconds);
487 }
488
489 void InternalSettings::setDefaultVideoPosterURL(const String& url, ExceptionCode& ec)
490 {
491     InternalSettingsGuardForSettings();
492     settings()->setDefaultVideoPosterURL(url);
493 }
494
495 void InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls(double time, ExceptionCode& ec)
496 {
497     InternalSettingsGuardForSettings();
498     settings()->setTimeWithoutMouseMovementBeforeHidingControls(time);
499 }
500
501 void InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode& ec)
502 {
503     InternalSettingsGuardForSettings();
504     settings()->setUseLegacyBackgroundSizeShorthandBehavior(enabled);
505 }
506
507 void InternalSettings::setAutoscrollForDragAndDropEnabled(bool enabled, ExceptionCode& ec)
508 {
509     InternalSettingsGuardForSettings();
510     settings()->setAutoscrollForDragAndDropEnabled(enabled);
511 }
512
513 void InternalSettings::setFontFallbackPrefersPictographs(bool preferPictographs, ExceptionCode& ec)
514 {
515     InternalSettingsGuardForSettings();
516     settings()->setFontFallbackPrefersPictographs(preferPictographs);
517 }
518
519 void InternalSettings::setPluginReplacementEnabled(bool enabled)
520 {
521     RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(enabled);
522 }
523
524 void InternalSettings::setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground, ExceptionCode& ec)
525 {
526     InternalSettingsGuardForSettings();
527     settings()->setBackgroundShouldExtendBeyondPage(hasExtendedBackground);
528 }
529
530 }