Commit 627ef069 authored by huangs's avatar huangs Committed by Commit bot

[Net Internals Page] Fix Element Shrinkage from Pinch-to-Zoom

Under pinch-to-zoom, there's no extra redraw event. However, the old
WindowView.resetGeometry() code was sensitive to dimensions
(window.innerWidth/innerHeight) that change with pinch-to-zoom. So when
page is pinch-to-zoomed in, refreshing or resizing triggers redraw,
causing inconsistent element sizing.

Our fix is to use dimensions that are insensitive to pinch-to-zoom,
i.e., document.documentElement.clientWidth/clientHeight. Under 100%
pinch-to-zoom, these are identical to the old dimensions except when
scroll bars are present.

BUG=481842

Review URL: https://codereview.chromium.org/1494783002

Cr-Commit-Position: refs/heads/master@{#363007}
parent d41fd222
...@@ -193,7 +193,8 @@ var WindowView = (function() { ...@@ -193,7 +193,8 @@ var WindowView = (function() {
}, },
resetGeometry: function() { resetGeometry: function() {
this.setGeometry(0, 0, window.innerWidth, window.innerHeight); this.setGeometry(0, 0, document.documentElement.clientWidth,
document.documentElement.clientHeight);
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment