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

Unified Diff: third_party/WebKit/Source/core/html/HTMLSelectElement.cpp

Issue 2215333002: Fix element visibility check for validation bubbles and SELECT popups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename to visibleBoundsInVisualViewport(), etc. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
index 7ca8bc148263b660afa5d064085642e28925c4a2..a3ad40d6045e743b750416e47ca154f69bb7cb58 100644
--- a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
@@ -1822,18 +1822,6 @@ const ComputedStyle* HTMLSelectElement::itemComputedStyle(Element& element) cons
return element.computedStyle() ? element.computedStyle() : element.ensureComputedStyle();
}
-IntRect HTMLSelectElement::elementRectRelativeToViewport() const
-{
- if (!layoutObject())
- return IntRect();
- // Initialize with this frame rectangle relative to the viewport.
- IntRect rect = document().view()->convertToRootFrame(document().view()->boundsRect());
- // We don't use absoluteBoundingBoxRect() because it can return an IntRect
- // larger the actual size by 1px.
- rect.intersect(document().view()->contentsToViewport(roundedIntRect(layoutObject()->absoluteBoundingBoxFloatRect())));
- return rect;
-}
-
LayoutUnit HTMLSelectElement::clientPaddingLeft() const
{
if (layoutObject() && layoutObject()->isMenuList())
@@ -1920,12 +1908,8 @@ void HTMLSelectElement::showPopup()
return;
if (!layoutObject() || !layoutObject()->isMenuList())
return;
- // Disable visibility check on Android. elementRectRelativeToViewport()
- // doesn't work well on Android WebView. crbug.com/632561
-#if !OS(ANDROID)
- if (elementRectRelativeToViewport().isEmpty())
+ if (visibleBoundsInVisualViewport().isEmpty())
return;
-#endif
if (!m_popup)
m_popup = document().frameHost()->chromeClient().openPopupMenu(*document().frame(), *this);
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLSelectElement.h ('k') | third_party/WebKit/Source/core/html/HTMLSelectElementTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698