Title: [164267] trunk/Source/WebKit2
Revision
164267
Author
[email protected]
Date
2014-02-17 19:50:41 -0800 (Mon, 17 Feb 2014)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (164266 => 164267)


--- trunk/Source/WebKit2/ChangeLog	2014-02-18 02:50:50 UTC (rev 164266)
+++ trunk/Source/WebKit2/ChangeLog	2014-02-18 03:50:41 UTC (rev 164267)
@@ -1,3 +1,15 @@
+2014-02-17  Sam Weinig  <[email protected]>
+
+        [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):
+
 2014-02-17  Gyuyoung Kim  <[email protected]>
 
         [CoordinatedGraphics][EFL] Remove view_source functions.

Modified: trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp (164266 => 164267)


--- trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp	2014-02-18 02:50:50 UTC (rev 164266)
+++ trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp	2014-02-18 03:50:41 UTC (rev 164267)
@@ -31,6 +31,10 @@
 #include <WebCore/Settings.h>
 #include <wtf/NeverDestroyed.h>
 
+#if PLATFORM(IOS)
+#import <WebKitSystemInterfaceIOS.h>
+#endif
+
 namespace WebKit {
 
 namespace WebPreferencesKey {

Modified: trunk/Source/WebKit2/Shared/WebPreferencesStore.h (164266 => 164267)


--- trunk/Source/WebKit2/Shared/WebPreferencesStore.h	2014-02-18 02:50:50 UTC (rev 164266)
+++ trunk/Source/WebKit2/Shared/WebPreferencesStore.h	2014-02-18 03:50:41 UTC (rev 164267)
@@ -66,8 +66,20 @@
 
 #if PLATFORM(IOS)
 #define DEFAULT_FRAME_FLATTENING_ENABLED true
+#define DEFAULT_SHOULD_PRINT_BACKGROUNDS true
+#define DEFAULT_TEXT_AREAS_ARE_RESIZABLE false
+#define DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY false
+#define DEFAULT_SHOULD_RESPECT_IMAGE_ORIENTATION true
+#define DEFAULT_MINIMUM_FONT_ZOOM_SIZE WKGetMinimumZoomFontSize()
+#define DEFAULT_PASSWORD_ECHO_ENABLED true
 #else
 #define DEFAULT_FRAME_FLATTENING_ENABLED false
+#define DEFAULT_SHOULD_PRINT_BACKGROUNDS false
+#define DEFAULT_TEXT_AREAS_ARE_RESIZABLE true
+#define DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY true
+#define DEFAULT_SHOULD_RESPECT_IMAGE_ORIENTATION false
+#define DEFAULT_MINIMUM_FONT_ZOOM_SIZE 0
+#define DEFAULT_PASSWORD_ECHO_ENABLED false
 #endif
 
 #if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
@@ -98,8 +110,8 @@
     macro(DeveloperExtrasEnabled, developerExtrasEnabled, Bool, bool, false) \
     macro(_javascript_ExperimentsEnabled, _javascript_ExperimentsEnabled, Bool, bool, false) \
     macro(PrivateBrowsingEnabled, privateBrowsingEnabled, Bool, bool, false) \
-    macro(TextAreasAreResizable, textAreasAreResizable, Bool, bool, true) \
-    macro(_javascript_CanOpenWindowsAutomatically, _javascript_CanOpenWindowsAutomatically, Bool, bool, true) \
+    macro(TextAreasAreResizable, textAreasAreResizable, Bool, bool, DEFAULT_TEXT_AREAS_ARE_RESIZABLE) \
+    macro(_javascript_CanOpenWindowsAutomatically, _javascript_CanOpenWindowsAutomatically, Bool, bool, DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY) \
     macro(HyperlinkAuditingEnabled, hyperlinkAuditingEnabled, Bool, bool, true) \
     macro(NeedsSiteSpecificQuirks, needsSiteSpecificQuirks, Bool, bool, false) \
     macro(AcceleratedCompositingEnabled, acceleratedCompositingEnabled, Bool, bool, true) \
@@ -140,7 +152,7 @@
     macro(InspectorStartsAttached, inspectorStartsAttached, Bool, bool, true) \
     macro(ShowsToolTipOverTruncatedText, showsToolTipOverTruncatedText, Bool, bool, false) \
     macro(MockScrollbarsEnabled, mockScrollbarsEnabled, Bool, bool, false) \
-    macro(WebAudioEnabled, webAudioEnabled, Bool, bool, false) \
+    macro(WebAudioEnabled, webAudioEnabled, Bool, bool, true) \
     macro(ApplicationChromeModeEnabled, applicationChromeMode, Bool, bool, false) \
     macro(SuppressesIncrementalRendering, suppressesIncrementalRendering, Bool, bool, false) \
     macro(BackspaceKeyNavigationEnabled, backspaceKeyNavigationEnabled, Bool, bool, true) \
@@ -149,7 +161,7 @@
     macro(ShouldDisplayCaptions, shouldDisplayCaptions, Bool, bool, false) \
     macro(ShouldDisplayTextDescriptions, shouldDisplayTextDescriptions, Bool, bool, false) \
     macro(NotificationsEnabled, notificationsEnabled, Bool, bool, true) \
-    macro(ShouldRespectImageOrientation, shouldRespectImageOrientation, Bool, bool, false) \
+    macro(ShouldRespectImageOrientation, shouldRespectImageOrientation, Bool, bool, DEFAULT_SHOULD_RESPECT_IMAGE_ORIENTATION) \
     macro(WantsBalancedSetDefersLoadingBehavior, wantsBalancedSetDefersLoadingBehavior, Bool, bool, false) \
     macro(RequestAnimationFrameEnabled, requestAnimationFrameEnabled, Bool, bool, true) \
     macro(DiagnosticLoggingEnabled, diagnosticLoggingEnabled, Bool, bool, false) \
@@ -191,15 +203,24 @@
     macro(MediaSourceEnabled, mediaSourceEnabled, Bool, bool, false) \
     macro(ViewGestureDebuggingEnabled, viewGestureDebuggingEnabled, Bool, bool, false) \
     macro(ShouldConvertPositionStyleOnCopy, shouldConvertPositionStyleOnCopy, Bool, bool, false) \
-    \
+    macro(Standalone, standalone, Bool, bool, false) \
+    macro(TelephoneNumberParsingEnabled, telephoneNumberParsingEnabled, Bool, bool, false) \
+    macro(AlwaysUseBaselineOfPrimaryFont, alwaysUseBaselineOfPrimaryFont, Bool, bool, false) \
+    macro(AllowMultiElementImplicitSubmission, allowMultiElementImplicitSubmission, Bool, bool, false) \
+    macro(AlwaysUseAcceleratedOverflowScroll, alwaysUseAcceleratedOverflowScroll, Bool, bool, false) \
+    macro(PasswordEchoEnabled, passwordEchoEnabled, Bool, bool, DEFAULT_PASSWORD_ECHO_ENABLED)
 
 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
     macro(PDFScaleFactor, pdfScaleFactor, Double, double, 0) \
     macro(IncrementalRenderingSuppressionTimeout, incrementalRenderingSuppressionTimeout, Double, double, 5) \
     macro(MinimumFontSize, minimumFontSize, Double, double, 0) \
     macro(MinimumLogicalFontSize, minimumLogicalFontSize, Double, double, 9) \
+    macro(MinimumZoomFontSize, minimumZoomFontSize, Double, double, DEFAULT_MINIMUM_FONT_ZOOM_SIZE) \
     macro(DefaultFontSize, defaultFontSize, Double, double, 16) \
     macro(DefaultFixedFontSize, defaultFixedFontSize, Double, double, 13) \
+    macro(LayoutInterval, layoutInterval, Double, double, -1) \
+    macro(MaxParseDuration, maxParseDuration, Double, double, -1) \
+    macro(PasswordEchoDuration, passwordEchoDuration, Double, double, 2) \
     \
 
 #define FOR_EACH_WEBKIT_FLOAT_PREFERENCE(macro) \
@@ -215,13 +236,23 @@
     macro(InspectorAttachedHeight, inspectorAttachedHeight, UInt32, uint32_t, 300) \
     macro(InspectorAttachedWidth, inspectorAttachedWidth, UInt32, uint32_t, 750) \
     macro(InspectorAttachmentSide, inspectorAttachmentSide, UInt32, uint32_t, 0) \
+    macro(MaximumDecodedImageSize, maximumDecodedImageSize, UInt32, uint32_t, 20 * 1024 * 1024) \
     \
 
 #if PLATFORM(COCOA)
 
+#if PLATFORM(IOS)
+#define DEFAULT_CURSIVE_FONT_FAMILY "Snell Roundhand"
+#define DEFAULT_PICTOGRAPH_FONT_FAMILY "AppleColorEmoji"
+#else
+#define DEFAULT_CURSIVE_FONT_FAMILY "Apple Chancery"
+#define DEFAULT_PICTOGRAPH_FONT_FAMILY "Apple Color Emoji"
+#endif
+
+
 #define FOR_EACH_WEBKIT_FONT_FAMILY_PREFERENCE(macro) \
     macro(StandardFontFamily, standardFontFamily, String, String, "Times") \
-    macro(CursiveFontFamily, cursiveFontFamily, String, String, "Apple Chancery") \
+    macro(CursiveFontFamily, cursiveFontFamily, String, String, DEFAULT_CURSIVE_FONT_FAMILY) \
     macro(FantasyFontFamily, fantasyFontFamily, String, String, "Papyrus") \
     macro(FixedFontFamily, fixedFontFamily, String, String, "Courier") \
     macro(SansSerifFontFamily, sansSerifFontFamily, String, String, "Helvetica") \

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (164266 => 164267)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-02-18 02:50:50 UTC (rev 164266)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-02-18 03:50:41 UTC (rev 164267)
@@ -2508,6 +2508,10 @@
     settings.setAVKitEnabled(true);
 #endif
 
+#if ENABLE(IOS_TEXT_AUTOSIZING)
+    settings.setMinimumZoomFontSize(store.getDoubleValueForKey(WebPreferencesKey::minimumZoomFontSizeKey()));
+#endif
+
 #if ENABLE(WEB_AUDIO)
     settings.setWebAudioEnabled(store.getBoolValueForKey(WebPreferencesKey::webAudioEnabledKey()));
 #endif
@@ -2577,6 +2581,19 @@
 
     settings.setShouldConvertPositionStyleOnCopy(store.getBoolValueForKey(WebPreferencesKey::shouldConvertPositionStyleOnCopyKey()));
 
+    settings.setStandalone(store.getBoolValueForKey(WebPreferencesKey::standaloneKey()));
+    settings.setTelephoneNumberParsingEnabled(store.getBoolValueForKey(WebPreferencesKey::telephoneNumberParsingEnabledKey()));
+    settings.setAlwaysUseBaselineOfPrimaryFont(store.getBoolValueForKey(WebPreferencesKey::alwaysUseBaselineOfPrimaryFontKey()));
+    settings.setAllowMultiElementImplicitSubmission(store.getBoolValueForKey(WebPreferencesKey::allowMultiElementImplicitSubmissionKey()));
+    settings.setAlwaysUseAcceleratedOverflowScroll(store.getBoolValueForKey(WebPreferencesKey::alwaysUseAcceleratedOverflowScrollKey()));
+
+    settings.setPasswordEchoEnabled(store.getBoolValueForKey(WebPreferencesKey::passwordEchoEnabledKey()));
+    settings.setPasswordEchoDurationInSeconds(store.getDoubleValueForKey(WebPreferencesKey::passwordEchoDurationKey()));
+    
+    settings.setLayoutInterval(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::duration<double>(store.getDoubleValueForKey(WebPreferencesKey::layoutIntervalKey()))));
+    settings.setMaxParseDuration(store.getDoubleValueForKey(WebPreferencesKey::maxParseDurationKey()));
+    settings.setMaximumDecodedImageSize(store.getUInt32ValueForKey(WebPreferencesKey::maximumDecodedImageSizeKey()));
+
     if (store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey())) {
         if (m_processSuppressionDisabledByWebPreference.isActive())
             m_processSuppressionDisabledByWebPreference.endActivity();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to