示例#1
0
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();
}
示例#3
0
void InternalSettings::setEnableScrollAnimator(bool enabled, ExceptionCode& ec)
{
#if ENABLE(SMOOTH_SCROLLING)
    InternalSettingsGuardForSettings();
    settings()->setEnableScrollAnimator(enabled);
#else
    UNUSED_PARAM(enabled);
    UNUSED_PARAM(ec);
#endif
}
示例#4
0
void InternalSettings::setTouchEventEmulationEnabled(bool enabled, ExceptionCode& ec)
{
#if ENABLE(TOUCH_EVENTS)
    InternalSettingsGuardForSettings();
    settings()->setTouchEventEmulationEnabled(enabled);
#else
    UNUSED_PARAM(enabled);
    UNUSED_PARAM(ec);
#endif
}
示例#5
0
void InternalSettings::setTextAutosizingEnabled(bool enabled, ExceptionCode& ec)
{
#if ENABLE(TEXT_AUTOSIZING)
    InternalSettingsGuardForSettings();
    settings()->setTextAutosizingEnabled(enabled);
#else
    UNUSED_PARAM(enabled);
    UNUSED_PARAM(ec);
#endif
}
示例#6
0
void InternalSettings::setTextAutosizingFontScaleFactor(float fontScaleFactor, ExceptionCode& ec)
{
#if ENABLE(TEXT_AUTOSIZING)
    InternalSettingsGuardForSettings();
    settings()->setTextAutosizingFontScaleFactor(fontScaleFactor);
#else
    UNUSED_PARAM(fontScaleFactor);
    UNUSED_PARAM(ec);
#endif
}
示例#7
0
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
}
示例#8
0
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.");
}
示例#10
0
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.");
}
示例#12
0
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);
}
示例#16
0
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);
}
示例#18
0
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
}
示例#19
0
void InternalSettings::setAutoscrollForDragAndDropEnabled(bool enabled, ExceptionCode& ec)
{
    InternalSettingsGuardForSettings();
    settings()->setAutoscrollForDragAndDropEnabled(enabled);
}
示例#20
0
void InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode& ec)
{
    InternalSettingsGuardForSettings();
    settings()->setUseLegacyBackgroundSizeShorthandBehavior(enabled);
}
示例#21
0
void InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls(double time, ExceptionCode& ec)
{
    InternalSettingsGuardForSettings();
    settings()->setTimeWithoutMouseMovementBeforeHidingControls(time);
}
示例#22
0
void InternalSettings::setDefaultVideoPosterURL(const String& url, ExceptionCode& ec)
{
    InternalSettingsGuardForSettings();
    settings()->setDefaultVideoPosterURL(url);
}
示例#23
0
void InternalSettings::setMinimumTimerInterval(double intervalInSeconds, ExceptionCode& ec)
{
    InternalSettingsGuardForSettings();
    settings()->setMinDOMTimerInterval(intervalInSeconds);
}
示例#24
0
void InternalSettings::setImagesEnabled(bool enabled, ExceptionCode& ec)
{
    InternalSettingsGuardForSettings();
    settings()->setImagesEnabled(enabled);
}
示例#25
0
void InternalSettings::setWindowFocusRestricted(bool restricted, ExceptionCode& ec)
{
    InternalSettingsGuardForSettings();
    settings()->setWindowFocusRestricted(restricted);
}
示例#26
0
void InternalSettings::setFontFallbackPrefersPictographs(bool preferPictographs, ExceptionCode& ec)
{
    InternalSettingsGuardForSettings();
    settings()->setFontFallbackPrefersPictographs(preferPictographs);
}
示例#27
0
void InternalSettings::setMediaTypeOverride(const String& mediaType, ExceptionCode& ec)
{
    InternalSettingsGuardForSettings();
    settings()->setMediaTypeOverride(mediaType);
}
示例#28
0
void InternalSettings::setMockScrollbarsEnabled(bool enabled, ExceptionCode& ec)
{
    InternalSettingsGuardForSettings();
    settings()->setMockScrollbarsEnabled(enabled);
}
示例#29
0
void InternalSettings::setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground, ExceptionCode& ec)
{
    InternalSettingsGuardForSettings();
    settings()->setBackgroundShouldExtendBeyondPage(hasExtendedBackground);
}
示例#30
0
void InternalSettings::setCanStartMedia(bool enabled, ExceptionCode& ec)
{
    InternalSettingsGuardForSettings();
    m_page->setCanStartMedia(enabled);
}