- Revision
- 92773
- Author
- [email protected]
- Date
- 2011-08-10 09:27:17 -0700 (Wed, 10 Aug 2011)
Log Message
Add device specific settings to support viewport computing
https://bugs.webkit.org/show_bug.cgi?id=65984
Patch by Lars Knudsen <[email protected]> on 2011-08-10
Reviewed by Kenneth Rohde Christiansen.
Source/WebCore:
Based on patch by Zalan Bujtas.
Added settings for device size, dpi and layout fallback width
to support viewport computing.
* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(WebCore::Settings::setLayoutFallbackWidth):
(WebCore::Settings::layoutFallbackWidth):
(WebCore::Settings::setDeviceWidth):
(WebCore::Settings::deviceWidth):
(WebCore::Settings::setDeviceHeight):
(WebCore::Settings::deviceHeight):
(WebCore::Settings::setDeviceDPI):
(WebCore::Settings::deviceDPI):
Source/WebKit2:
Expose new viewport related WebCore settings to WebKit2.
* Shared/WebPreferencesStore.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (92772 => 92773)
--- trunk/Source/WebCore/ChangeLog 2011-08-10 15:49:40 UTC (rev 92772)
+++ trunk/Source/WebCore/ChangeLog 2011-08-10 16:27:17 UTC (rev 92773)
@@ -1,3 +1,27 @@
+2011-08-10 Lars Knudsen <[email protected]>
+
+ Add device specific settings to support viewport computing
+ https://bugs.webkit.org/show_bug.cgi?id=65984
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Based on patch by Zalan Bujtas.
+
+ Added settings for device size, dpi and layout fallback width
+ to support viewport computing.
+
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ * page/Settings.h:
+ (WebCore::Settings::setLayoutFallbackWidth):
+ (WebCore::Settings::layoutFallbackWidth):
+ (WebCore::Settings::setDeviceWidth):
+ (WebCore::Settings::deviceWidth):
+ (WebCore::Settings::setDeviceHeight):
+ (WebCore::Settings::deviceHeight):
+ (WebCore::Settings::setDeviceDPI):
+ (WebCore::Settings::deviceDPI):
+
2011-08-10 Benjamin Poulain <[email protected]>
Unify the way we generate HTML for an image in the Clipboard
Modified: trunk/Source/WebCore/page/Settings.cpp (92772 => 92773)
--- trunk/Source/WebCore/page/Settings.cpp 2011-08-10 15:49:40 UTC (rev 92772)
+++ trunk/Source/WebCore/page/Settings.cpp 2011-08-10 16:27:17 UTC (rev 92773)
@@ -114,7 +114,11 @@
, m_defaultFixedFontSize(0)
, m_validationMessageTimerMagnification(50)
, m_minimumAccelerated2dCanvasSize(128 * 128)
+ , m_layoutFallbackWidth(980)
+ , m_deviceDPI(240)
, m_maximumDecodedImageSize(numeric_limits<size_t>::max())
+ , m_deviceWidth(480)
+ , m_deviceHeight(854)
#if ENABLE(DOM_STORAGE)
, m_sessionStorageQuota(StorageMap::noQuota)
#endif
Modified: trunk/Source/WebCore/page/Settings.h (92772 => 92773)
--- trunk/Source/WebCore/page/Settings.h 2011-08-10 15:49:40 UTC (rev 92772)
+++ trunk/Source/WebCore/page/Settings.h 2011-08-10 16:27:17 UTC (rev 92773)
@@ -423,6 +423,18 @@
void setCrossOriginCheckInGetMatchedCSSRulesDisabled(bool flag) { m_crossOriginCheckInGetMatchedCSSRulesDisabled = flag; }
bool crossOriginCheckInGetMatchedCSSRulesDisabled() const { return m_crossOriginCheckInGetMatchedCSSRulesDisabled; }
+ void setLayoutFallbackWidth(int width) { m_layoutFallbackWidth = width; }
+ int layoutFallbackWidth() const { return m_layoutFallbackWidth; }
+
+ void setDeviceWidth(int width) { m_deviceWidth = width; }
+ int deviceWidth() const { return m_deviceWidth; }
+
+ void setDeviceHeight(int height) { m_deviceHeight = height; }
+ int deviceHeight() const { return m_deviceHeight; }
+
+ void setDeviceDPI(int deviceDPI) { m_deviceDPI = deviceDPI; }
+ int deviceDPI() const { return m_deviceDPI; }
+
void setForceCompositingMode(bool flag) { m_forceCompositingMode = flag; }
bool forceCompositingMode() { return m_forceCompositingMode; }
@@ -471,7 +483,11 @@
int m_defaultFixedFontSize;
int m_validationMessageTimerMagnification;
int m_minimumAccelerated2dCanvasSize;
+ int m_layoutFallbackWidth;
+ int m_deviceDPI;
size_t m_maximumDecodedImageSize;
+ int m_deviceWidth;
+ int m_deviceHeight;
#if ENABLE(DOM_STORAGE)
unsigned m_sessionStorageQuota;
#endif
Modified: trunk/Source/WebKit2/ChangeLog (92772 => 92773)
--- trunk/Source/WebKit2/ChangeLog 2011-08-10 15:49:40 UTC (rev 92772)
+++ trunk/Source/WebKit2/ChangeLog 2011-08-10 16:27:17 UTC (rev 92773)
@@ -1,3 +1,16 @@
+2011-08-10 Lars Knudsen <[email protected]>
+
+ Add device specific settings to support viewport computing
+ https://bugs.webkit.org/show_bug.cgi?id=65984
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Expose new viewport related WebCore settings to WebKit2.
+
+ * Shared/WebPreferencesStore.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences):
+
2011-08-09 John Sullivan <[email protected]>
WKPageCopyPendingAPIRequestURL returns stale result if policy decision set to Ignore
Modified: trunk/Source/WebKit2/Shared/WebPreferencesStore.h (92772 => 92773)
--- trunk/Source/WebKit2/Shared/WebPreferencesStore.h 2011-08-10 15:49:40 UTC (rev 92772)
+++ trunk/Source/WebKit2/Shared/WebPreferencesStore.h 2011-08-10 16:27:17 UTC (rev 92773)
@@ -103,6 +103,10 @@
macro(MinimumLogicalFontSize, minimumLogicalFontSize, UInt32, uint32_t, 9) \
macro(DefaultFontSize, defaultFontSize, UInt32, uint32_t, 16) \
macro(DefaultFixedFontSize, defaultFixedFontSize, UInt32, uint32_t, 13) \
+ macro(LayoutFallbackWidth, layoutFallbackWidth, UInt32, uint32_t, 980) \
+ macro(DeviceDPI, deviceDPI, UInt32, uint32_t, 240) \
+ macro(DeviceWidth, deviceWidth, UInt32, uint32_t, 480) \
+ macro(DeviceHeight, deviceHeight, UInt32, uint32_t, 854) \
macro(PDFDisplayMode, pdfDisplayMode, UInt32, uint32_t, 1) \
macro(EditableLinkBehavior, editableLinkBehavior, UInt32, uint32_t, WebCore::EditableLinkNeverLive) \
\
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (92772 => 92773)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2011-08-10 15:49:40 UTC (rev 92772)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2011-08-10 16:27:17 UTC (rev 92773)
@@ -1580,6 +1580,10 @@
settings->setMinimumLogicalFontSize(store.getUInt32ValueForKey(WebPreferencesKey::minimumLogicalFontSizeKey()));
settings->setDefaultFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFontSizeKey()));
settings->setDefaultFixedFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFixedFontSizeKey()));
+ settings->setLayoutFallbackWidth(store.getUInt32ValueForKey(WebPreferencesKey::layoutFallbackWidthKey()));
+ settings->setDeviceDPI(store.getUInt32ValueForKey(WebPreferencesKey::deviceDPIKey()));
+ settings->setDeviceWidth(store.getUInt32ValueForKey(WebPreferencesKey::deviceWidthKey()));
+ settings->setDeviceHeight(store.getUInt32ValueForKey(WebPreferencesKey::deviceHeightKey()));
settings->setEditableLinkBehavior(static_cast<WebCore::EditableLinkBehavior>(store.getUInt32ValueForKey(WebPreferencesKey::editableLinkBehaviorKey())));
settings->setAcceleratedCompositingEnabled(store.getBoolValueForKey(WebPreferencesKey::acceleratedCompositingEnabledKey()) && LayerTreeHost::supportsAcceleratedCompositing());