void InternalSettings::setSerifFontFamily(const String& family, const String& script, ExceptionCode& ec) { InternalSettingsGuardForSettings(); UScriptCode code = scriptNameToCode(script); if (code == USCRIPT_INVALID_CODE) return; m_backup.m_serifFontFamilies.add(code, settings()->serifFontFamily(code)); settings()->setSerifFontFamily(family, code); }
void InternalSettings::setPictographFontFamily(const AtomicString& family, const String& script, ExceptionState& exceptionState) { InternalSettingsGuardForSettings(); UScriptCode code = scriptNameToCode(script); if (code == USCRIPT_INVALID_CODE) return; if (settings()->genericFontFamilySettings().updatePictograph(family, code)) settings()->notifyGenericFontFamilyChange(); }
void InternalSettings::setEnableScrollAnimator(bool enabled, ExceptionCode& ec) { #if ENABLE(SMOOTH_SCROLLING) InternalSettingsGuardForSettings(); settings()->setEnableScrollAnimator(enabled); #else UNUSED_PARAM(enabled); UNUSED_PARAM(ec); #endif }
void InternalSettings::setTouchEventEmulationEnabled(bool enabled, ExceptionCode& ec) { #if ENABLE(TOUCH_EVENTS) InternalSettingsGuardForSettings(); settings()->setTouchEventEmulationEnabled(enabled); #else UNUSED_PARAM(enabled); UNUSED_PARAM(ec); #endif }
void InternalSettings::setTextAutosizingEnabled(bool enabled, ExceptionCode& ec) { #if ENABLE(TEXT_AUTOSIZING) InternalSettingsGuardForSettings(); settings()->setTextAutosizingEnabled(enabled); #else UNUSED_PARAM(enabled); UNUSED_PARAM(ec); #endif }
void InternalSettings::setTextAutosizingFontScaleFactor(float fontScaleFactor, ExceptionCode& ec) { #if ENABLE(TEXT_AUTOSIZING) InternalSettingsGuardForSettings(); settings()->setTextAutosizingFontScaleFactor(fontScaleFactor); #else UNUSED_PARAM(fontScaleFactor); UNUSED_PARAM(ec); #endif }
void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height, ExceptionCode& ec) { #if ENABLE(TEXT_AUTOSIZING) InternalSettingsGuardForSettings(); settings()->setTextAutosizingWindowSizeOverride(IntSize(width, height)); #else UNUSED_PARAM(width); UNUSED_PARAM(height); UNUSED_PARAM(ec); #endif }
void InternalSettings::setEditingBehavior(const String& editingBehavior, ExceptionCode& ec) { InternalSettingsGuardForSettings(); if (equalIgnoringCase(editingBehavior, "win")) settings()->setEditingBehaviorType(EditingWindowsBehavior); else if (equalIgnoringCase(editingBehavior, "mac")) settings()->setEditingBehaviorType(EditingMacBehavior); else if (equalIgnoringCase(editingBehavior, "unix")) settings()->setEditingBehaviorType(EditingUnixBehavior); else ec = SYNTAX_ERR; }
void InternalSettings::setImageAnimationPolicy(const String& policy, ExceptionState& exceptionState) { InternalSettingsGuardForSettings(); if (equalIgnoringCase(policy, "allowed")) settings()->setImageAnimationPolicy(ImageAnimationPolicyAllowed); else if (equalIgnoringCase(policy, "once")) settings()->setImageAnimationPolicy(ImageAnimationPolicyAnimateOnce); else if (equalIgnoringCase(policy, "none")) settings()->setImageAnimationPolicy(ImageAnimationPolicyNoAnimation); else exceptionState.throwDOMException(SyntaxError, "The image animation policy provided ('" + policy + "') is invalid."); }
void InternalSettings::setStorageBlockingPolicy(const String& mode, ExceptionCode& ec) { InternalSettingsGuardForSettings(); if (mode == "AllowAll") settings()->setStorageBlockingPolicy(SecurityOrigin::AllowAllStorage); else if (mode == "BlockThirdParty") settings()->setStorageBlockingPolicy(SecurityOrigin::BlockThirdPartyStorage); else if (mode == "BlockAll") settings()->setStorageBlockingPolicy(SecurityOrigin::BlockAllStorage); else ec = SYNTAX_ERR; }
void InternalSettings::setEditingBehavior(const String& editingBehavior, ExceptionState& exceptionState) { InternalSettingsGuardForSettings(); if (equalIgnoringCase(editingBehavior, "win")) settings()->setEditingBehaviorType(EditingWindowsBehavior); else if (equalIgnoringCase(editingBehavior, "mac")) settings()->setEditingBehaviorType(EditingMacBehavior); else if (equalIgnoringCase(editingBehavior, "unix")) settings()->setEditingBehaviorType(EditingUnixBehavior); else if (equalIgnoringCase(editingBehavior, "android")) settings()->setEditingBehaviorType(EditingAndroidBehavior); else exceptionState.throwDOMException(SyntaxError, "The editing behavior type provided ('" + editingBehavior + "') is invalid."); }
void InternalSettings::setViewportStyle(const String& style, ExceptionState& exceptionState) { InternalSettingsGuardForSettings(); if (equalIgnoringCase(style, "default")) settings()->setViewportStyle(WebViewportStyle::Default); else if (equalIgnoringCase(style, "mobile")) settings()->setViewportStyle(WebViewportStyle::Mobile); else if (equalIgnoringCase(style, "television")) settings()->setViewportStyle(WebViewportStyle::Television); else exceptionState.throwDOMException( SyntaxError, "The viewport style type provided ('" + style + "') is invalid."); }
void InternalSettings::setTextTrackKindUserPreference(const String& preference, ExceptionState& exceptionState) { InternalSettingsGuardForSettings(); String token = preference.stripWhiteSpace(); TextTrackKindUserPreference userPreference = TextTrackKindUserPreference::Default; if (token == "default") userPreference = TextTrackKindUserPreference::Default; else if (token == "captions") userPreference = TextTrackKindUserPreference::Captions; else if (token == "subtitles") userPreference = TextTrackKindUserPreference::Subtitles; else exceptionState.throwDOMException(SyntaxError, "The user preference for text track kind " + preference + ")' is invalid."); settings()->setTextTrackKindUserPreference(userPreference); }
void InternalSettings::setPrimaryHoverType(const String& type, ExceptionState& exceptionState) { InternalSettingsGuardForSettings(); String token = type.stripWhiteSpace(); HoverType hoverType = HoverTypeNone; if (token == "none") hoverType = HoverTypeNone; else if (token == "on-demand") hoverType = HoverTypeOnDemand; else if (token == "hover") hoverType = HoverTypeHover; else exceptionState.throwDOMException(SyntaxError, "The hover type token ('" + token + ")' is invalid."); settings()->setPrimaryHoverType(hoverType); }
void InternalSettings::setPrimaryPointerType(const String& pointer, ExceptionState& exceptionState) { InternalSettingsGuardForSettings(); String token = pointer.stripWhiteSpace(); PointerType type = PointerTypeNone; if (token == "coarse") type = PointerTypeCoarse; else if (token == "fine") type = PointerTypeFine; else if (token == "none") type = PointerTypeNone; else exceptionState.throwDOMException(SyntaxError, "The pointer type token ('" + token + ")' is invalid."); settings()->setPrimaryPointerType(type); }
void InternalSettings::setShouldDisplayTrackKind(const String& kind, bool enabled, ExceptionCode& ec) { InternalSettingsGuardForSettings(); #if ENABLE(VIDEO_TRACK) if (equalIgnoringCase(kind, "Subtitles")) settings()->setShouldDisplaySubtitles(enabled); else if (equalIgnoringCase(kind, "Captions")) settings()->setShouldDisplayCaptions(enabled); else if (equalIgnoringCase(kind, "TextDescriptions")) settings()->setShouldDisplayTextDescriptions(enabled); else ec = SYNTAX_ERR; #else UNUSED_PARAM(kind); UNUSED_PARAM(enabled); #endif }
void InternalSettings::setDisplayModeOverride(const String& displayMode, ExceptionState& exceptionState) { InternalSettingsGuardForSettings(); String token = displayMode.stripWhiteSpace(); WebDisplayMode mode = WebDisplayModeBrowser; if (token == "browser") mode = WebDisplayModeBrowser; else if (token == "minimal-ui") mode = WebDisplayModeMinimalUi; else if (token == "standalone") mode = WebDisplayModeStandalone; else if (token == "fullscreen") mode = WebDisplayModeFullscreen; else exceptionState.throwDOMException(SyntaxError, "The display-mode token ('" + token + ")' is invalid."); settings()->setDisplayModeOverride(mode); }
void InternalSettings::setShouldDisplayTrackKind(const String& kind, bool enabled, ExceptionCode& ec) { InternalSettingsGuardForSettings(); #if ENABLE(VIDEO_TRACK) if (!page()) return; CaptionUserPreferences* captionPreferences = page()->group().captionPreferences(); if (equalIgnoringCase(kind, "Subtitles")) captionPreferences->setUserPrefersSubtitles(enabled); else if (equalIgnoringCase(kind, "Captions")) captionPreferences->setUserPrefersCaptions(enabled); else if (equalIgnoringCase(kind, "TextDescriptions")) captionPreferences->setUserPrefersTextDescriptions(enabled); else ec = SYNTAX_ERR; #else UNUSED_PARAM(kind); UNUSED_PARAM(enabled); #endif }
void InternalSettings::setAutoscrollForDragAndDropEnabled(bool enabled, ExceptionCode& ec) { InternalSettingsGuardForSettings(); settings()->setAutoscrollForDragAndDropEnabled(enabled); }
void InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode& ec) { InternalSettingsGuardForSettings(); settings()->setUseLegacyBackgroundSizeShorthandBehavior(enabled); }
void InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls(double time, ExceptionCode& ec) { InternalSettingsGuardForSettings(); settings()->setTimeWithoutMouseMovementBeforeHidingControls(time); }
void InternalSettings::setDefaultVideoPosterURL(const String& url, ExceptionCode& ec) { InternalSettingsGuardForSettings(); settings()->setDefaultVideoPosterURL(url); }
void InternalSettings::setMinimumTimerInterval(double intervalInSeconds, ExceptionCode& ec) { InternalSettingsGuardForSettings(); settings()->setMinDOMTimerInterval(intervalInSeconds); }
void InternalSettings::setImagesEnabled(bool enabled, ExceptionCode& ec) { InternalSettingsGuardForSettings(); settings()->setImagesEnabled(enabled); }
void InternalSettings::setWindowFocusRestricted(bool restricted, ExceptionCode& ec) { InternalSettingsGuardForSettings(); settings()->setWindowFocusRestricted(restricted); }
void InternalSettings::setFontFallbackPrefersPictographs(bool preferPictographs, ExceptionCode& ec) { InternalSettingsGuardForSettings(); settings()->setFontFallbackPrefersPictographs(preferPictographs); }
void InternalSettings::setMediaTypeOverride(const String& mediaType, ExceptionCode& ec) { InternalSettingsGuardForSettings(); settings()->setMediaTypeOverride(mediaType); }
void InternalSettings::setMockScrollbarsEnabled(bool enabled, ExceptionCode& ec) { InternalSettingsGuardForSettings(); settings()->setMockScrollbarsEnabled(enabled); }
void InternalSettings::setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground, ExceptionCode& ec) { InternalSettingsGuardForSettings(); settings()->setBackgroundShouldExtendBeyondPage(hasExtendedBackground); }
void InternalSettings::setCanStartMedia(bool enabled, ExceptionCode& ec) { InternalSettingsGuardForSettings(); m_page->setCanStartMedia(enabled); }