Update DSF after swap in root local frame

Desktop / Chromium - Jaebaek Seo [chromium.org] - 13 October 2017 04:24 EDT

Opening a new tab and visiting site A and visiting site B render elements of site B smaller than correctly rendered elements when --use-zoom-for-dsf is enabled in Android. This is because the device scale factor (DSF) is not updated when the root local frame is swapped in.

Let's assume that the frame of site A is hosted by process A. When visiting site B, process B is created and it hosts the frame of site B. At this moment, the frame node tree of process B has a LocalFrame that is the frame of site B and the one of process A has a RemoteFrame that points B's LocalFrame. If there is no more message to site B from site A, process A swaps in the frame of site B as its root LocalFrame and process B swaps out it.

However, the zoom level is scaled by DSF only once (i.e., when the RemoteFrame of process A is created) and it is actually not scaled because the frame is not LocalFrame. This CL updates the zoom level by DSF, after swapping in the frame of site B as LocalFrame of process A.

Bug: 737777 Change-Id: I21754ee9f62e99c40c3f9ebdb3d4cc4b2fcf03bb Reviewed-on: https://chromium-review.googlesource.com/690415

02dffc8 Update DSF after swap in root local frame
content/renderer/render_frame_impl.cc | 1 +
content/renderer/render_view_browsertest.cc | 49 ++++++++++++++++++++++
content/renderer/render_view_impl.h | 5 ++-
.../WebKit/Source/core/exported/WebViewImpl.h | 3 ++
third_party/WebKit/public/web/WebView.h | 2 +
5 files changed, 58 insertions(+), 2 deletions(-)

Upstream: git.chromium.org

  • Share