Changeset 121555 in webkit
- Timestamp:
- Jun 29, 2012 5:51:57 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r121554 r121555 1 2012-06-29 Konrad Piascik <kpiascik@rim.com> 2 3 Don't hardcode target dpi of 160 (it should be 96 on desktop) 4 https://bugs.webkit.org/show_bug.cgi?id=88114 5 6 Reviewed by Adam Barth. 7 8 No behavioural change, current tests in fast/viewport cover all 9 functionality. 10 11 * WebCore.exp.in: Updated symbol for computeViewportAttributes. 12 * dom/ViewportArguments.cpp: Use new parameter for devicePixelRatio 13 and don't calculate it anymore. 14 (WebCore::computeViewportAttributes): 15 * dom/ViewportArguments.h: Change the deviceDPI parameter to 16 devicePixelRatio and put the onus 17 on the embedder to supply the 18 correct value. Add temporary constant. 19 (WebCore): 20 1 21 2012-06-29 Vineet Chaudhary <rgf748@motorola.com> 2 22 -
trunk/Source/WebCore/WebCore.exp.in
r121522 r121555 607 607 __ZN7WebCore25HistoryPropertyListWriterC2Ev 608 608 __ZN7WebCore25addLanguageChangeObserverEPvPFvS0_E 609 __ZN7WebCore25computeViewportAttributesENS_17ViewportArgumentsEiii iNS_7IntSizeE609 __ZN7WebCore25computeViewportAttributesENS_17ViewportArgumentsEiiifNS_7IntSizeE 610 610 __ZN7WebCore26UserTypingGestureIndicator27processingUserTypingGestureEv 611 611 __ZN7WebCore26UserTypingGestureIndicator28focusedElementAtGestureStartEv -
trunk/Source/WebCore/dom/ViewportArguments.cpp
r119534 r121555 42 42 namespace WebCore { 43 43 44 // FIXME: We shouldn't hardcode the targetDPI to 160. 45 // See https://bugs.webkit.org/show_bug.cgi?id=88114 46 static float targetDPI = 160; 47 48 ViewportAttributes computeViewportAttributes(ViewportArguments args, int desktopWidth, int deviceWidth, int deviceHeight, int deviceDPI, IntSize visibleViewport) 44 ViewportAttributes computeViewportAttributes(ViewportArguments args, int desktopWidth, int deviceWidth, int deviceHeight, float devicePixelRatio, IntSize visibleViewport) 49 45 { 50 46 ViewportAttributes result; … … 55 51 ASSERT(availableWidth > 0 && availableHeight > 0); 56 52 57 result.devicePixelRatio = device DPI / targetDPI;53 result.devicePixelRatio = devicePixelRatio; 58 54 59 55 // Resolve non-'auto' width and height to pixel values. -
trunk/Source/WebCore/dom/ViewportArguments.h
r120874 r121555 73 73 ValueDeviceWidth = -3, 74 74 ValueDeviceHeight = -4, 75 ValueDeviceDPI = -5,76 ValueLowDPI = -6,77 ValueMediumDPI = -7,78 ValueHighDPI = -879 75 }; 80 76 … … 113 109 return !(*this == other); 114 110 } 111 // FIXME: We're going to keep this constant around until all embedders 112 // refactor their code to no longer need it. 113 static const int deprecatedTargetDPI = 160; 115 114 }; 116 115 117 ViewportAttributes computeViewportAttributes(ViewportArguments args, int desktopWidth, int deviceWidth, int deviceHeight, int deviceDPI, IntSize visibleViewport); 116 ViewportAttributes computeViewportAttributes(ViewportArguments args, int desktopWidth, int deviceWidth, int deviceHeight, float devicePixelRatio, IntSize visibleViewport); 117 118 118 void restrictMinimumScaleFactorToViewportSize(ViewportAttributes& result, IntSize visibleViewport); 119 119 void restrictScaleFactorToInitialScaleIfNotUserScalable(ViewportAttributes& result); -
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r121400 r121555 3445 3445 int deviceWidth = Platform::Graphics::Screen::primaryScreen()->width(); 3446 3446 int deviceHeight = Platform::Graphics::Screen::primaryScreen()->height(); 3447 FloatSize currentPPI = Platform::Graphics::Screen::primaryScreen()->pixelsPerInch(-1); 3448 int deviceDPI = int(roundf((currentPPI.width() + currentPPI.height()) / 2)); 3449 ViewportAttributes result = computeViewportAttributes(m_viewportArguments, desktopWidth, deviceWidth, deviceHeight, deviceDPI, m_defaultLayoutSize); 3447 ViewportAttributes result = computeViewportAttributes(m_viewportArguments, desktopWidth, deviceWidth, deviceHeight, m_webSettings->devicePixelRatio(), m_defaultLayoutSize); 3450 3448 m_page->setDeviceScaleFactor(result.devicePixelRatio); 3451 3449 return IntSize(result.layoutSize.width(), result.layoutSize.height()); -
trunk/Source/WebKit/blackberry/Api/WebSettings.cpp
r121255 r121555 25 25 #include "WebString.h" 26 26 #include <Base64.h> 27 #include <BlackBerryPlatformDeviceInfo.h> 27 28 #include <BlackBerryPlatformFontInfo.h> 29 #include <BlackBerryPlatformScreen.h> 28 30 #include <Color.h> 31 #include <FloatSize.h> 29 32 #include <PageCache.h> 33 #include <ViewportArguments.h> 30 34 #include <wtf/HashSet.h> 31 35 #include <wtf/Vector.h> … … 59 63 DEFINE_STATIC_LOCAL(String, BlackBerryCredentialAutofillEnabled, ("BlackBerryCredentialAutofillEnabled")); 60 64 DEFINE_STATIC_LOCAL(String, BlackBerryFormAutofillEnabled, ("BlackBerryFormAutofillEnabled")); 65 DEFINE_STATIC_LOCAL(String, BlackBerryDevicePixelRatio, ("BlackBerryDevicePixelRatio")); 61 66 DEFINE_STATIC_LOCAL(String, SpatialNavigationEnabled, ("SpatialNavigationEnabled")); 62 67 DEFINE_STATIC_LOCAL(String, WebKitDatabasePath, ("WebKitDatabasePath")); … … 174 179 settings->m_private->setBoolean(BlackBerryFormAutofillEnabled, false); 175 180 181 if (BlackBerry::Platform::DeviceInfo::instance()->isMobile()) { 182 WebCore::FloatSize currentPPI = Platform::Graphics::Screen::primaryScreen()->pixelsPerInch(-1); 183 int deviceDPI = int(roundf((currentPPI.width() + currentPPI.height()) / 2)); 184 settings->m_private->setDouble(BlackBerryDevicePixelRatio, deviceDPI / WebCore::ViewportArguments::deprecatedTargetDPI); 185 } else 186 settings->m_private->setDouble(BlackBerryDevicePixelRatio, 1); 187 176 188 settings->m_private->setInteger(WebKitDefaultFontSize, 16); 177 189 settings->m_private->setInteger(WebKitDefaultFixedFontSize, 13); … … 826 838 } 827 839 840 double WebSettings::devicePixelRatio() const 841 { 842 return m_private->getDouble(BlackBerryDevicePixelRatio); 843 } 844 845 void WebSettings::setDevicePixelRatio(double ratio) 846 { 847 m_private->setDouble(BlackBerryDevicePixelRatio, ratio); 848 } 849 828 850 } // namespace WebKit 829 851 } // namespace BlackBerry -
trunk/Source/WebKit/blackberry/Api/WebSettings.h
r121255 r121555 238 238 void setFormAutofillEnabled(bool); 239 239 240 double devicePixelRatio() const; 241 void setDevicePixelRatio(double); 242 240 243 private: 241 244 WebSettingsPrivate* m_private; -
trunk/Source/WebKit/blackberry/Api/WebViewportArguments.cpp
r120874 r121555 86 86 } 87 87 88 float WebViewportArguments:: targetDensityDpi() const88 float WebViewportArguments::devicePixelRatio() const 89 89 { 90 90 return 0; 91 91 } 92 92 93 void WebViewportArguments::set TargetDensityDpi(float)93 void WebViewportArguments::setDevicePixelRatio(float) 94 94 { 95 95 } -
trunk/Source/WebKit/blackberry/Api/WebViewportArguments.h
r119527 r121555 51 51 ValueDeviceWidth = -3, 52 52 ValueDeviceHeight = -4, 53 ValueDeviceDPI = -5,54 ValueLowDPI = -6,55 ValueMediumDPI = -7,56 ValueHighDPI = -857 53 }; 58 54 … … 72 68 void setHeight(float); 73 69 74 // FIXME: Can we remove these functions? WebKit no longer supports targetDensityDpi. 75 float targetDensityDpi() const; 76 void setTargetDensityDpi(float); 70 float devicePixelRatio() const; 71 void setDevicePixelRatio(float); 77 72 78 73 float userScalable() const; -
trunk/Source/WebKit/blackberry/ChangeLog
r121516 r121555 1 2012-06-29 Konrad Piascik <kpiascik@rim.com> 2 3 Don't hardcode target dpi of 160 (it should be 96 on desktop) 4 https://bugs.webkit.org/show_bug.cgi?id=88114 5 6 Reviewed by Adam Barth. 7 8 Added new WebSetting to specify what the devicePixelRatio should be. 9 Updated the call to computeViewportAttributes. 10 11 * Api/WebPage.cpp: 12 (BlackBerry::WebKit::WebPagePrivate::recomputeVirtualViewportFromViewportArguments): 13 * Api/WebSettings.cpp: 14 (WebKit): 15 (BlackBerry::WebKit::WebSettings::standardSettings): 16 (BlackBerry::WebKit::WebSettings::devicePixelRatio): 17 (BlackBerry::WebKit::WebSettings::setDevicePixelRatio): 18 * Api/WebSettings.h: 19 * WebKitSupport/DumpRenderTreeSupport.cpp: 20 (DumpRenderTreeSupport::dumpConfigurationForViewport): 21 1 22 2012-06-28 Jason Liu <jason.liu@torchmobile.com.cn> 2 23 -
trunk/Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp
r121381 r121555 88 88 { 89 89 ViewportArguments arguments = mainFrame->page()->viewportArguments(); 90 ViewportAttributes attrs = computeViewportAttributes(arguments, /* default layout width for non-mobile pages */ 980, deviceWidth, deviceHeight, deviceDPI , IntSize(availableWidth, availableHeight));90 ViewportAttributes attrs = computeViewportAttributes(arguments, /* default layout width for non-mobile pages */ 980, deviceWidth, deviceHeight, deviceDPI / ViewportArguments::deprecatedTargetDPI, IntSize(availableWidth, availableHeight)); 91 91 restrictMinimumScaleFactorToViewportSize(attrs, IntSize(availableWidth, availableHeight)); 92 92 restrictScaleFactorToInitialScaleIfNotUserScalable(attrs); -
trunk/Source/WebKit/chromium/ChangeLog
r121532 r121555 1 2012-06-29 Konrad Piascik <kpiascik@rim.com> 2 3 Don't hardcode target dpi of 160 (it should be 96 on desktop) 4 https://bugs.webkit.org/show_bug.cgi?id=88114 5 6 Reviewed by Adam Barth. 7 8 Updated the call to computeViewportAttributes. 9 10 * src/ChromeClientImpl.cpp: 11 (WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange): 12 1 13 2012-06-29 Amy Ousterhout <aousterh@chromium.org> 2 14 -
trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp
r121213 r121555 656 656 ViewportAttributes computed = computeViewportAttributes( 657 657 args, settings->layoutFallbackWidth(), deviceRect.width, deviceRect.height, 658 dpi , IntSize(deviceRect.width, deviceRect.height));658 dpi / ViewportArguments::deprecatedTargetDPI, IntSize(deviceRect.width, deviceRect.height)); 659 659 660 660 if (m_webView->ignoreViewportTagMaximumScale()) { -
trunk/Source/WebKit/efl/ChangeLog
r121409 r121555 1 2012-06-29 Konrad Piascik <kpiascik@rim.com> 2 3 Don't hardcode target dpi of 160 (it should be 96 on desktop) 4 https://bugs.webkit.org/show_bug.cgi?id=88114 5 6 Reviewed by Adam Barth. 7 8 Updated the call to computeViewportAttributes. 9 10 * WebCoreSupport/DumpRenderTreeSupportEfl.cpp: 11 (DumpRenderTreeSupportEfl::dumpConfigurationForViewport): 12 * ewk/ewk_view.cpp: 13 (_ewk_view_viewport_attributes_compute): 14 1 15 2012-06-27 Sheriff Bot <webkit.review.bot@gmail.com> 2 16 -
trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
r120294 r121555 588 588 /* default layout width for non-mobile pages */ 980, 589 589 deviceSize.width(), deviceSize.height(), 590 deviceDPI ,590 deviceDPI / WebCore::ViewportArguments::deprecatedTargetDPI, 591 591 availableSize); 592 592 restrictMinimumScaleFactorToViewportSize(attributes, availableSize); -
trunk/Source/WebKit/efl/ewk/ewk_view.cpp
r121381 r121555 1238 1238 WebCore::IntRect deviceRect = enclosingIntRect(priv->page->chrome()->client()->windowRect()); 1239 1239 1240 WebCore::ViewportAttributes attributes = WebCore::computeViewportAttributes(priv->viewportArguments, desktopWidth, deviceRect.width(), deviceRect.height(), deviceDPI , availableRect.size());1240 WebCore::ViewportAttributes attributes = WebCore::computeViewportAttributes(priv->viewportArguments, desktopWidth, deviceRect.width(), deviceRect.height(), deviceDPI / WebCore::ViewportArguments::deprecatedTargetDPI, availableRect.size()); 1241 1241 WebCore::restrictMinimumScaleFactorToViewportSize(attributes, availableRect.size()); 1242 1242 WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(attributes); -
trunk/Source/WebKit/gtk/ChangeLog
r121381 r121555 1 2012-06-29 Konrad Piascik <kpiascik@rim.com> 2 3 Don't hardcode target dpi of 160 (it should be 96 on desktop) 4 https://bugs.webkit.org/show_bug.cgi?id=88114 5 6 Reviewed by Adam Barth. 7 8 Updated the call to computeViewportAttributes. 9 10 * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: 11 (DumpRenderTreeSupportGtk::dumpConfigurationForViewport): 12 * webkit/webkitviewportattributes.cpp: 13 (webkitViewportAttributesRecompute): 14 1 15 2012-06-25 Mark Hahnenberg <mhahnenberg@apple.com> 2 16 -
trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
r121381 r121555 624 624 625 625 ViewportArguments arguments = webView->priv->corePage->mainFrame()->document()->viewportArguments(); 626 ViewportAttributes attrs = computeViewportAttributes(arguments, /* default layout width for non-mobile pages */ 980, deviceWidth, deviceHeight, deviceDPI , IntSize(availableWidth, availableHeight));626 ViewportAttributes attrs = computeViewportAttributes(arguments, /* default layout width for non-mobile pages */ 980, deviceWidth, deviceHeight, deviceDPI / ViewportArguments::deprecatedTargetDPI, IntSize(availableWidth, availableHeight)); 627 627 restrictMinimumScaleFactorToViewportSize(attrs, IntSize(availableWidth, availableHeight)); 628 628 restrictScaleFactorToInitialScaleIfNotUserScalable(attrs); -
trunk/Source/WebKit/gtk/webkit/webkitviewportattributes.cpp
r99195 r121555 535 535 ViewportArguments arguments = webView->priv->corePage->mainFrame()->document()->viewportArguments(); 536 536 537 ViewportAttributes attributes = computeViewportAttributes(arguments, priv->desktopWidth, priv->deviceWidth, priv->deviceHeight, priv->deviceDPI , IntSize(priv->availableWidth, priv->availableHeight));537 ViewportAttributes attributes = computeViewportAttributes(arguments, priv->desktopWidth, priv->deviceWidth, priv->deviceHeight, priv->deviceDPI / ViewportArguments::deprecatedTargetDPI, IntSize(priv->availableWidth, priv->availableHeight)); 538 538 restrictMinimumScaleFactorToViewportSize(attributes, IntSize(priv->availableWidth, priv->availableHeight)); 539 539 restrictScaleFactorToInitialScaleIfNotUserScalable(attributes); -
trunk/Source/WebKit/qt/Api/qwebpage.cpp
r120704 r121555 2560 2560 } 2561 2561 2562 WebCore::ViewportAttributes conf = WebCore::computeViewportAttributes(d->viewportArguments(), desktopWidth, deviceWidth, deviceHeight, qt_defaultDpi() , availableSize);2562 WebCore::ViewportAttributes conf = WebCore::computeViewportAttributes(d->viewportArguments(), desktopWidth, deviceWidth, deviceHeight, qt_defaultDpi() / WebCore::ViewportArguments::deprecatedTargetDPI, availableSize); 2563 2563 WebCore::restrictMinimumScaleFactorToViewportSize(conf, availableSize); 2564 2564 WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(conf); -
trunk/Source/WebKit/qt/ChangeLog
r121429 r121555 1 2012-06-29 Konrad Piascik <kpiascik@rim.com> 2 3 Don't hardcode target dpi of 160 (it should be 96 on desktop) 4 https://bugs.webkit.org/show_bug.cgi?id=88114 5 6 Reviewed by Adam Barth. 7 8 Updated the call to computeViewportAttributes. 9 10 * Api/qwebpage.cpp: 11 (QWebPage::viewportAttributesForSize): 12 * WebCoreSupport/DumpRenderTreeSupportQt.cpp: 13 (DumpRenderTreeSupportQt::viewportAsText): 14 1 15 2012-06-28 Alexander Pavlov <apavlov@chromium.org> 2 16 -
trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
r121429 r121555 743 743 744 744 WebCore::ViewportAttributes conf = WebCore::computeViewportAttributes(args, 745 /* desktop-width */ 980,746 /* device-width */ deviceSize.width(),747 /* device-height */ deviceSize.height(),748 /* device -dpi */ deviceDPI,745 /* desktop-width */ 980, 746 /* device-width */ deviceSize.width(), 747 /* device-height */ deviceSize.height(), 748 /* devicePixelRatio */ deviceDPI / WebCore::ViewportArguments::deprecatedTargetDPI, 749 749 availableSize); 750 750 WebCore::restrictMinimumScaleFactorToViewportSize(conf, availableSize); -
trunk/Source/WebKit2/ChangeLog
r121536 r121555 1 2012-06-29 Konrad Piascik <kpiascik@rim.com> 2 3 Don't hardcode target dpi of 160 (it should be 96 on desktop) 4 https://bugs.webkit.org/show_bug.cgi?id=88114 5 6 Reviewed by Adam Barth. 7 8 Updated the call to computeViewportAttributes. 9 10 * WebProcess/WebPage/WebPage.cpp: 11 (WebKit::WebPage::sendViewportAttributesChanged): 12 (WebKit::WebPage::viewportConfigurationAsText): 13 1 14 2012-06-29 Sheriff Bot <webkit.review.bot@gmail.com> 2 15 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r121381 r121555 919 919 int deviceHeight = (settings->deviceHeight() > 0) ? settings->deviceHeight() : m_viewportSize.height(); 920 920 921 ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, deviceWidth, deviceHeight, static_cast<int>(160 * m_page->deviceScaleFactor()), m_viewportSize);921 ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, deviceWidth, deviceHeight, m_page->deviceScaleFactor(), m_viewportSize); 922 922 923 923 setResizesToContentsUsingLayoutSize(IntSize(static_cast<int>(attr.layoutSize.width()), static_cast<int>(attr.layoutSize.height()))); … … 3123 3123 { 3124 3124 ViewportArguments arguments = mainFrame()->document()->viewportArguments(); 3125 ViewportAttributes attrs = WebCore::computeViewportAttributes(arguments, /* default layout width for non-mobile pages */ 980, deviceWidth, deviceHeight, deviceDPI, IntSize(availableWidth, availableHeight));3125 ViewportAttributes attrs = WebCore::computeViewportAttributes(arguments, /* default layout width for non-mobile pages */ 980, deviceWidth, deviceHeight, m_page->deviceScaleFactor(), IntSize(availableWidth, availableHeight)); 3126 3126 WebCore::restrictMinimumScaleFactorToViewportSize(attrs, IntSize(availableWidth, availableHeight)); 3127 3127 WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(attrs);
Note: See TracChangeset
for help on using the changeset viewer.