Changeset 141481 in webkit
- Timestamp:
- Jan 31, 2013 1:57:00 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r141480 r141481 1 2013-01-31 Jacky Jiang <zhajiang@rim.com> 2 3 [BlackBerry] Bing Images viewport causes layout "fun" 4 https://bugs.webkit.org/show_bug.cgi?id=108393 5 6 Reviewed by Yong Li. 7 Internally reviewed by Arvid Nilsson and partially reviewed by Konrad Piascik. 8 9 PR: 277855 10 On bing.com image search page, JS generated styles for the divs which 11 contained images based on the window.screen and window.innerWidth. 12 Unfortunately the styles for the divs weren't good enough on our device 13 which resulted in three images being overlapped in the same viewport. 14 On our port, we calculate the screen rect base on the physical screen 15 pixels. However, iOS and lastest Android Chrome port already changed it 16 to density-independent (logical) pixels. And also to my knowledge that 17 some websites would generate bad styles for us as well through 18 @media device-width/device-height. 19 To be consistent and fix such kinds of issues, we should use 20 density-independent pixels instead of physical screen pixels. Mainly 21 ported from Chrome port change r139356. The patch will affect 22 screen.width/height, window.outerWidth/outerHeight and 23 @media device-width/device-height. 24 25 * platform/blackberry/PlatformScreenBlackBerry.cpp: 26 (WebCore): 27 (WebCore::toUserSpace): 28 (WebCore::screenAvailableRect): 29 (WebCore::screenRect): 30 1 31 2013-01-31 Max Vujovic <mvujovic@adobe.com> 2 32 -
trunk/Source/WebCore/platform/blackberry/PlatformScreenBlackBerry.cpp
r135165 r141481 1 1 /* 2 2 * Copyright (C) 2009, 2010, 2011 Research In Motion Limited. All rights reserved. 3 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. 3 4 * 4 5 * This library is free software; you can redistribute it and/or … … 21 22 22 23 #include "FloatRect.h" 24 #include "Frame.h" 25 #include "FrameView.h" 23 26 #include "NotImplemented.h" 27 #include "Page.h" 28 #include "Settings.h" 24 29 #include "Widget.h" 25 30 … … 43 48 } 44 49 50 // Use logical (density-independent) pixels instead of physical screen pixels. 51 static FloatRect toUserSpace(FloatRect rect, Widget* widget) 52 { 53 if (widget->isFrameView()) { 54 Page* page = static_cast<FrameView*>(widget)->frame()->page(); 55 if (page && !page->settings()->applyDeviceScaleFactorInCompositor()) 56 rect.scale(1 / page->deviceScaleFactor()); 57 } 58 return rect; 59 } 60 45 61 FloatRect screenAvailableRect(Widget* widget) 46 62 { 47 return FloatRect(FloatPoint(), FloatSize(IntSize(BlackBerry::Platform::Graphics::Screen::primaryScreen()->size()))); 63 if (!widget) 64 return FloatRect(); 65 return toUserSpace(IntRect(IntPoint::zero(), IntSize(BlackBerry::Platform::Graphics::Screen::primaryScreen()->size())), widget); 48 66 } 49 67 50 68 FloatRect screenRect(Widget* widget) 51 69 { 52 return FloatRect(FloatPoint(), FloatSize(IntSize(BlackBerry::Platform::Graphics::Screen::primaryScreen()->size()))); 70 if (!widget) 71 return FloatRect(); 72 return toUserSpace(IntRect(IntPoint::zero(), IntSize(BlackBerry::Platform::Graphics::Screen::primaryScreen()->size())), widget); 53 73 } 54 74 -
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r141276 r141481 6004 6004 coreSettings->setShouldUseCrossOriginProtocolCheck(!webSettings->allowCrossSiteRequests()); 6005 6005 coreSettings->setWebSecurityEnabled(!webSettings->allowCrossSiteRequests()); 6006 coreSettings->setApplyPageScaleFactorInCompositor(webSettings->applyDeviceScaleFactorInCompositor()); 6006 6007 6007 6008 cookieManager().setPrivateMode(webSettings->isPrivateBrowsingEnabled()); -
trunk/Source/WebKit/blackberry/Api/WebSettings.cpp
r140849 r141481 37 37 38 38 DEFINE_STATIC_LOCAL(String, BlackBerryAllowCrossSiteRequests, (ASCIILiteral("BlackBerryAllowCrossSiteRequests"))); 39 DEFINE_STATIC_LOCAL(String, BlackBerryApplyDeviceScaleFactorInCompositor, (ASCIILiteral("BlackBerryApplyDeviceScaleFactorInCompositor"))); 39 40 DEFINE_STATIC_LOCAL(String, BlackBerryAsynchronousSpellChecking, (ASCIILiteral("BlackBerryAsynchronousSpellChecking"))); 40 41 DEFINE_STATIC_LOCAL(String, BlackBerryBackgroundColor, (ASCIILiteral("BlackBerryBackgroundColor"))); … … 180 181 settings->m_private->setBoolean(BlackBerryFormAutofillEnabled, false); 181 182 settings->m_private->setBoolean(BlackBerryAsynchronousSpellChecking, true); 183 settings->m_private->setBoolean(BlackBerryApplyDeviceScaleFactorInCompositor, false); 182 184 183 185 if (BlackBerry::Platform::DeviceInfo::instance()->isMobile()) { … … 843 845 } 844 846 847 bool WebSettings::applyDeviceScaleFactorInCompositor() const 848 { 849 return m_private->getBoolean(BlackBerryApplyDeviceScaleFactorInCompositor); 850 } 851 852 void WebSettings::setApplyPageScaleFactorInCompositor(bool applyDeviceScaleFactorInCompositor) 853 { 854 m_private->setBoolean(BlackBerryApplyDeviceScaleFactorInCompositor, applyDeviceScaleFactorInCompositor); 855 } 856 845 857 } // namespace WebKit 846 858 } // namespace BlackBerry -
trunk/Source/WebKit/blackberry/Api/WebSettings.h
r140849 r141481 245 245 void setBackingStoreEnabled(bool); 246 246 247 bool applyDeviceScaleFactorInCompositor() const; 248 void setApplyPageScaleFactorInCompositor(bool); 249 247 250 private: 248 251 WebSettingsPrivate* m_private; -
trunk/Source/WebKit/blackberry/ChangeLog
r141473 r141481 1 2013-01-31 Jacky Jiang <zhajiang@rim.com> 2 3 [BlackBerry] Bing Images viewport causes layout "fun" 4 https://bugs.webkit.org/show_bug.cgi?id=108393 5 6 Reviewed by Yong Li. 7 Internally reviewed by Arvid Nilsson and partially reviewed by Konrad Piascik. 8 9 PR: 277855 10 Set applyPageScaleFactorInCompositor settting to false by default. 11 Scale down chrome window rect to density-independent pixels. 12 13 * Api/WebPage.cpp: 14 (BlackBerry::WebKit::WebPagePrivate::didChangeSettings): 15 * Api/WebSettings.cpp: 16 (WebKit): 17 (BlackBerry::WebKit::WebSettings::standardSettings): 18 (BlackBerry::WebKit::WebSettings::applyDeviceScaleFactorInCompositor): 19 (BlackBerry::WebKit::WebSettings::setApplyPageScaleFactorInCompositor): 20 * Api/WebSettings.h: 21 * WebCoreSupport/ChromeClientBlackBerry.cpp: 22 (WebCore::ChromeClientBlackBerry::windowRect): 23 1 24 2013-01-31 Enrica Casucci <enrica@apple.com> 2 25 -
trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
r139519 r141481 55 55 #include "SearchPopupMenuBlackBerry.h" 56 56 #include "SecurityOrigin.h" 57 #include "Settings.h" 57 58 #include "SharedPointer.h" 58 59 #include "ViewportArguments.h" … … 166 167 windowSize = window->windowSize(); 167 168 168 return FloatRect(0, 0, windowSize.width(), windowSize.height()); 169 // Use logical (density-independent) pixels instead of physical screen pixels. 170 FloatRect rect = FloatRect(0, 0, windowSize.width(), windowSize.height()); 171 if (!m_webPagePrivate->m_page->settings()->applyDeviceScaleFactorInCompositor()) 172 rect.scale(1 / m_webPagePrivate->m_page->deviceScaleFactor()); 173 return rect; 169 174 } 170 175
Note: See TracChangeset
for help on using the changeset viewer.