Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Issue 11862015: Merge 139356 (Closed)

Created:
7 years, 11 months ago by kerz_chromium
Modified:
7 years, 11 months ago
Reviewers:
commit-queue
CC:
chromium-reviews
Base URL:
http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Visibility:
Public.

Description

Merge 139356 > Fix scale of screen.width, window.outerWidth and @media device-width when page scale not applied in compositor. > https://bugs.webkit.org/show_bug.cgi?id=106460 > > Patch by John Mellor <johnme@chromium.org>; on 2013-01-10 > Reviewed by Kenneth Rohde Christiansen. > > Source/WebCore: > > screen.width, window.outerWidth and @media device-width should be in > density independent (UI) pixels, not physical screen pixels. > > This already works on most ports (including iOS). However Chrome for > Android currently internally sizes its windows in physical screen pixels > instead of density independent pixels, and this leaks through in the > sizes provided to WebCore. > > This patch scales these sizes appropriately before they reach JavaScript, > on platforms where the applyPageScaleFactorInCompositor setting is false > (i.e. just Chrome for Android). Once Chrome for Android switches over to > the same coordinate space, the applyPageScaleFactorInCompositor setting > will be removed, along with any code (such as this) that depends on it. > > The effect of this patch on Chrome for Android when viewing a page with > a width=device-width viewport on a Galaxy Nexus (720x1280 @ dPR 2) is: > @media device-width changes from 720 to 360 > screen.width changes from 720 to 360 > screen.availWidth changes from 720 to 360 > window.outerWidth changes from 720 to 360 > window.innerWidth remains 360 (at overview zoom) > @media width remains 360 > document.documentElement.clientWidth remains 360 > document.documentElement.offsetWidth remains 360 > document.documentElement.scrollWidth remains 360 > document.body.clientWidth remains 360 > document.body.offsetWidth remains 360 > document.body.scrollWidth remains 360 > And similarly for heights (though they are slightly less than 640, since > toolbars etc. get subtracted from the available height). > > No new tests, as applyDeviceScaleFactorInCompositor appears to always be > true in DumpRenderTree, so this situation cannot occur there. > > * page/Settings.in: > Added applyDeviceScaleFactorInCompositor setting, which allows > detecting whether we need to normalize the scale. > * platform/chromium/PlatformScreenChromium.cpp: > (WebCore::toUserSpace): > Static function for normalizing screen rect scale. > (WebCore::screenRect): > Uses toUserSpace. > (WebCore::screenAvailableRect): > Uses toUserSpace. > * rendering/TextAutosizer.cpp: > (WebCore::TextAutosizer::processSubtree): > Use applyDeviceScaleFactorInCompositor instead of > applyPageScaleFactorInCompositor, to scale the window rect correctly > on platforms other than Chrome for Android. > > Source/WebKit/chromium: > > 1. Exposes the existing applyDeviceScaleFactorInCompositor from > WebSettings on Settings (and stores the value there instead), so it can > be accessed from WebCore. > > 2. Changes ChromeClientImpl::windowRect to return values in density > independent (UI) pixels pixels instead of physical screen pixels (see > explanation in Source/WebCore/ChangeLog). > > * src/ChromeClientImpl.cpp: > (WebKit::ChromeClientImpl::windowRect): > Normalizes window rect scale. > * src/WebSettingsImpl.cpp: > (WebKit::WebSettingsImpl::WebSettingsImpl): > (WebKit::WebSettingsImpl::setApplyDeviceScaleFactorInCompositor): > (WebKit::WebSettingsImpl::applyDeviceScaleFactorInCompositor): > (WebKit): > * src/WebSettingsImpl.h: > (WebSettingsImpl): TBR=commit-queue@webkit.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=139472

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11168 lines, -17 lines) Patch
M Source/WebCore/ChangeLog View 1 chunk +9950 lines, -0 lines 0 comments Download
M Source/WebCore/page/Settings.in View 1 chunk +1 line, -0 lines 0 comments Download
M Source/WebCore/platform/chromium/PlatformScreenChromium.cpp View 3 chunks +18 lines, -2 lines 0 comments Download
M Source/WebCore/rendering/TextAutosizer.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/WebKit/chromium/ChangeLog View 1 chunk +1179 lines, -0 lines 0 comments Download
M Source/WebKit/chromium/src/ChromeClientImpl.cpp View 1 chunk +12 lines, -10 lines 0 comments Download
M Source/WebKit/chromium/src/WebSettingsImpl.h View 2 chunks +1 line, -2 lines 0 comments Download
M Source/WebKit/chromium/src/WebSettingsImpl.cpp View 3 chunks +6 lines, -2 lines 0 comments Download

Messages

Total messages: 1 (0 generated)
kerz_chromium
7 years, 11 months ago (2013-01-11 19:39:12 UTC) #1

          

Powered by Google App Engine
This is Rietveld 408576698