Changeset 164267 in webkit


Ignore:
Timestamp:
Feb 17, 2014 7:50:41 PM (10 years ago)
Author:
weinig@apple.com
Message:

[iOS, WebKit2] Add settings and correct default values for settings important on iOS
https://bugs.webkit.org/show_bug.cgi?id=128947

Reviewed by Simon Fraser.

  • Shared/WebPreferencesStore.cpp:
  • Shared/WebPreferencesStore.h:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::updatePreferences):

Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r164266 r164267  
     12014-02-17  Sam Weinig  <sam@webkit.org>
     2
     3        [iOS, WebKit2] Add settings and correct default values for settings important on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=128947
     5
     6        Reviewed by Simon Fraser.
     7
     8        * Shared/WebPreferencesStore.cpp:
     9        * Shared/WebPreferencesStore.h:
     10        * WebProcess/WebPage/WebPage.cpp:
     11        (WebKit::WebPage::updatePreferences):
     12
    1132014-02-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    214
  • trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp

    r161148 r164267  
    3232#include <wtf/NeverDestroyed.h>
    3333
     34#if PLATFORM(IOS)
     35#import <WebKitSystemInterfaceIOS.h>
     36#endif
     37
    3438namespace WebKit {
    3539
  • trunk/Source/WebKit2/Shared/WebPreferencesStore.h

    r164053 r164267  
    6767#if PLATFORM(IOS)
    6868#define DEFAULT_FRAME_FLATTENING_ENABLED true
     69#define DEFAULT_SHOULD_PRINT_BACKGROUNDS true
     70#define DEFAULT_TEXT_AREAS_ARE_RESIZABLE false
     71#define DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY false
     72#define DEFAULT_SHOULD_RESPECT_IMAGE_ORIENTATION true
     73#define DEFAULT_MINIMUM_FONT_ZOOM_SIZE WKGetMinimumZoomFontSize()
     74#define DEFAULT_PASSWORD_ECHO_ENABLED true
    6975#else
    7076#define DEFAULT_FRAME_FLATTENING_ENABLED false
     77#define DEFAULT_SHOULD_PRINT_BACKGROUNDS false
     78#define DEFAULT_TEXT_AREAS_ARE_RESIZABLE true
     79#define DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY true
     80#define DEFAULT_SHOULD_RESPECT_IMAGE_ORIENTATION false
     81#define DEFAULT_MINIMUM_FONT_ZOOM_SIZE 0
     82#define DEFAULT_PASSWORD_ECHO_ENABLED false
    7183#endif
    7284
     
    99111    macro(JavaScriptExperimentsEnabled, javaScriptExperimentsEnabled, Bool, bool, false) \
    100112    macro(PrivateBrowsingEnabled, privateBrowsingEnabled, Bool, bool, false) \
    101     macro(TextAreasAreResizable, textAreasAreResizable, Bool, bool, true) \
    102     macro(JavaScriptCanOpenWindowsAutomatically, javaScriptCanOpenWindowsAutomatically, Bool, bool, true) \
     113    macro(TextAreasAreResizable, textAreasAreResizable, Bool, bool, DEFAULT_TEXT_AREAS_ARE_RESIZABLE) \
     114    macro(JavaScriptCanOpenWindowsAutomatically, javaScriptCanOpenWindowsAutomatically, Bool, bool, DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY) \
    103115    macro(HyperlinkAuditingEnabled, hyperlinkAuditingEnabled, Bool, bool, true) \
    104116    macro(NeedsSiteSpecificQuirks, needsSiteSpecificQuirks, Bool, bool, false) \
     
    141153    macro(ShowsToolTipOverTruncatedText, showsToolTipOverTruncatedText, Bool, bool, false) \
    142154    macro(MockScrollbarsEnabled, mockScrollbarsEnabled, Bool, bool, false) \
    143     macro(WebAudioEnabled, webAudioEnabled, Bool, bool, false) \
     155    macro(WebAudioEnabled, webAudioEnabled, Bool, bool, true) \
    144156    macro(ApplicationChromeModeEnabled, applicationChromeMode, Bool, bool, false) \
    145157    macro(SuppressesIncrementalRendering, suppressesIncrementalRendering, Bool, bool, false) \
     
    150162    macro(ShouldDisplayTextDescriptions, shouldDisplayTextDescriptions, Bool, bool, false) \
    151163    macro(NotificationsEnabled, notificationsEnabled, Bool, bool, true) \
    152     macro(ShouldRespectImageOrientation, shouldRespectImageOrientation, Bool, bool, false) \
     164    macro(ShouldRespectImageOrientation, shouldRespectImageOrientation, Bool, bool, DEFAULT_SHOULD_RESPECT_IMAGE_ORIENTATION) \
    153165    macro(WantsBalancedSetDefersLoadingBehavior, wantsBalancedSetDefersLoadingBehavior, Bool, bool, false) \
    154166    macro(RequestAnimationFrameEnabled, requestAnimationFrameEnabled, Bool, bool, true) \
     
    192204    macro(ViewGestureDebuggingEnabled, viewGestureDebuggingEnabled, Bool, bool, false) \
    193205    macro(ShouldConvertPositionStyleOnCopy, shouldConvertPositionStyleOnCopy, Bool, bool, false) \
    194     \
     206    macro(Standalone, standalone, Bool, bool, false) \
     207    macro(TelephoneNumberParsingEnabled, telephoneNumberParsingEnabled, Bool, bool, false) \
     208    macro(AlwaysUseBaselineOfPrimaryFont, alwaysUseBaselineOfPrimaryFont, Bool, bool, false) \
     209    macro(AllowMultiElementImplicitSubmission, allowMultiElementImplicitSubmission, Bool, bool, false) \
     210    macro(AlwaysUseAcceleratedOverflowScroll, alwaysUseAcceleratedOverflowScroll, Bool, bool, false) \
     211    macro(PasswordEchoEnabled, passwordEchoEnabled, Bool, bool, DEFAULT_PASSWORD_ECHO_ENABLED)
    195212
    196213#define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
     
    199216    macro(MinimumFontSize, minimumFontSize, Double, double, 0) \
    200217    macro(MinimumLogicalFontSize, minimumLogicalFontSize, Double, double, 9) \
     218    macro(MinimumZoomFontSize, minimumZoomFontSize, Double, double, DEFAULT_MINIMUM_FONT_ZOOM_SIZE) \
    201219    macro(DefaultFontSize, defaultFontSize, Double, double, 16) \
    202220    macro(DefaultFixedFontSize, defaultFixedFontSize, Double, double, 13) \
     221    macro(LayoutInterval, layoutInterval, Double, double, -1) \
     222    macro(MaxParseDuration, maxParseDuration, Double, double, -1) \
     223    macro(PasswordEchoDuration, passwordEchoDuration, Double, double, 2) \
    203224    \
    204225
     
    216237    macro(InspectorAttachedWidth, inspectorAttachedWidth, UInt32, uint32_t, 750) \
    217238    macro(InspectorAttachmentSide, inspectorAttachmentSide, UInt32, uint32_t, 0) \
     239    macro(MaximumDecodedImageSize, maximumDecodedImageSize, UInt32, uint32_t, 20 * 1024 * 1024) \
    218240    \
    219241
    220242#if PLATFORM(COCOA)
     243
     244#if PLATFORM(IOS)
     245#define DEFAULT_CURSIVE_FONT_FAMILY "Snell Roundhand"
     246#define DEFAULT_PICTOGRAPH_FONT_FAMILY "AppleColorEmoji"
     247#else
     248#define DEFAULT_CURSIVE_FONT_FAMILY "Apple Chancery"
     249#define DEFAULT_PICTOGRAPH_FONT_FAMILY "Apple Color Emoji"
     250#endif
     251
    221252
    222253#define FOR_EACH_WEBKIT_FONT_FAMILY_PREFERENCE(macro) \
    223254    macro(StandardFontFamily, standardFontFamily, String, String, "Times") \
    224     macro(CursiveFontFamily, cursiveFontFamily, String, String, "Apple Chancery") \
     255    macro(CursiveFontFamily, cursiveFontFamily, String, String, DEFAULT_CURSIVE_FONT_FAMILY) \
    225256    macro(FantasyFontFamily, fantasyFontFamily, String, String, "Papyrus") \
    226257    macro(FixedFontFamily, fixedFontFamily, String, String, "Courier") \
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r164254 r164267  
    25092509#endif
    25102510
     2511#if ENABLE(IOS_TEXT_AUTOSIZING)
     2512    settings.setMinimumZoomFontSize(store.getDoubleValueForKey(WebPreferencesKey::minimumZoomFontSizeKey()));
     2513#endif
     2514
    25112515#if ENABLE(WEB_AUDIO)
    25122516    settings.setWebAudioEnabled(store.getBoolValueForKey(WebPreferencesKey::webAudioEnabledKey()));
     
    25772581
    25782582    settings.setShouldConvertPositionStyleOnCopy(store.getBoolValueForKey(WebPreferencesKey::shouldConvertPositionStyleOnCopyKey()));
     2583
     2584    settings.setStandalone(store.getBoolValueForKey(WebPreferencesKey::standaloneKey()));
     2585    settings.setTelephoneNumberParsingEnabled(store.getBoolValueForKey(WebPreferencesKey::telephoneNumberParsingEnabledKey()));
     2586    settings.setAlwaysUseBaselineOfPrimaryFont(store.getBoolValueForKey(WebPreferencesKey::alwaysUseBaselineOfPrimaryFontKey()));
     2587    settings.setAllowMultiElementImplicitSubmission(store.getBoolValueForKey(WebPreferencesKey::allowMultiElementImplicitSubmissionKey()));
     2588    settings.setAlwaysUseAcceleratedOverflowScroll(store.getBoolValueForKey(WebPreferencesKey::alwaysUseAcceleratedOverflowScrollKey()));
     2589
     2590    settings.setPasswordEchoEnabled(store.getBoolValueForKey(WebPreferencesKey::passwordEchoEnabledKey()));
     2591    settings.setPasswordEchoDurationInSeconds(store.getDoubleValueForKey(WebPreferencesKey::passwordEchoDurationKey()));
     2592   
     2593    settings.setLayoutInterval(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::duration<double>(store.getDoubleValueForKey(WebPreferencesKey::layoutIntervalKey()))));
     2594    settings.setMaxParseDuration(store.getDoubleValueForKey(WebPreferencesKey::maxParseDurationKey()));
     2595    settings.setMaximumDecodedImageSize(store.getUInt32ValueForKey(WebPreferencesKey::maximumDecodedImageSizeKey()));
    25792596
    25802597    if (store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey())) {
Note: See TracChangeset for help on using the changeset viewer.