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