HTMLSelectElement::elementRectRelativeToViewport doesn't work in Android if minimum-scale > 1 |
||||
Issue descriptionIf we revert r408903, <select> popup doesn't open in some applications with Android WebView. See Issue 632561 for the details. https://bugs.chromium.org/p/chromium/issues/detail?id=632561#c22 : > document().view()->convertToRootFrame(document().view()->boundsRect()); > is (0, 0, 321,430) > And document().view()->contentsToViewport(roundedIntRect(layoutObject()->absoluteBoundingBoxFloatRect())) is: > (398, 251, 350, 51) The former rect looks wrong. It should be a viewport size in DIP, and I guess it should be something like (0, 0, 800, 1280) if device scale factor is 2.0.
,
Aug 2 2016
For example, I loaded this URL http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select onto a webview app on pixel C. document().view()->convertToRootFrame(document().view()->boundsRect()); is (0, 0, 321, 419) And document().view()->contentsToViewport(roundedIntRect(layoutObject()->absoluteBoundingBoxFloatRect())) is: (314, 198, 275, 40)
,
Aug 5 2016
I found the root cause.
The trigger is WebViewImpl::minimumPageScaleFactor() > 1. This issue is reproducible with Google Chrome for Android by specifying viewport meta like:
<meta name="viewport" content="minimum-scale=2.0">
blink::WebViewImpl::mainFrameSize() returns viewport size scaled by minimumPageScaleFactor(). So FrameView::boundsRect() is smaller than the DIP size if minimumPageScaleFactor() is larger than 1.
We should use FrameView::visibleContentRect() or VisualViewport::size() instead of FrameView::boundsRect().
,
Aug 8 2016
,
Aug 9 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/48565e7338d3f8d0cbfdb082f51e609b7bfd4624 commit 48565e7338d3f8d0cbfdb082f51e609b7bfd4624 Author: tkent <tkent@chromium.org> Date: Tue Aug 09 03:43:07 2016 Fix element visibility check for validation bubbles and SELECT popups. - Do not use FrameView::boundsRect() for element visibility check It's scaled by minimum-scale. We should use VisualViewport::size(). - Introduce Element::visibleBoundsInViewport() to merge duplicated code in HTMLSelectElement and ValidationMessageClientImpl. BUG= 633457 Review-Url: https://codereview.chromium.org/2215333002 Cr-Commit-Position: refs/heads/master@{#410567} [modify] https://crrev.com/48565e7338d3f8d0cbfdb082f51e609b7bfd4624/third_party/WebKit/Source/core/dom/Element.cpp [modify] https://crrev.com/48565e7338d3f8d0cbfdb082f51e609b7bfd4624/third_party/WebKit/Source/core/dom/Element.h [modify] https://crrev.com/48565e7338d3f8d0cbfdb082f51e609b7bfd4624/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp [modify] https://crrev.com/48565e7338d3f8d0cbfdb082f51e609b7bfd4624/third_party/WebKit/Source/core/html/HTMLSelectElement.h [modify] https://crrev.com/48565e7338d3f8d0cbfdb082f51e609b7bfd4624/third_party/WebKit/Source/core/html/HTMLSelectElementTest.cpp [modify] https://crrev.com/48565e7338d3f8d0cbfdb082f51e609b7bfd4624/third_party/WebKit/Source/web/PopupMenuImpl.cpp [modify] https://crrev.com/48565e7338d3f8d0cbfdb082f51e609b7bfd4624/third_party/WebKit/Source/web/ValidationMessageClientImpl.cpp [modify] https://crrev.com/48565e7338d3f8d0cbfdb082f51e609b7bfd4624/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp [add] https://crrev.com/48565e7338d3f8d0cbfdb082f51e609b7bfd4624/third_party/WebKit/Source/web/tests/data/viewport-select.html
,
Aug 9 2016
|
||||
►
Sign in to add a comment |
||||
Comment 1 by hush@chromium.org
, Aug 2 2016