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

Unified Diff: Source/web/PopupContainer.cpp

Issue 1109213002: Make createWindow (mostly) work with OOPIF (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix popup unit test failures Created 5 years, 8 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: Source/web/PopupContainer.cpp
diff --git a/Source/web/PopupContainer.cpp b/Source/web/PopupContainer.cpp
index 01bc2c8b875a85d107f1db65925528ee0034a094..1b218d0500d616aa642238b1240ca74bb7f38240 100644
--- a/Source/web/PopupContainer.cpp
+++ b/Source/web/PopupContainer.cpp
@@ -200,7 +200,10 @@ IntRect PopupContainer::layoutAndCalculateWidgetRect(int targetControlHeight, co
IntRect widgetRectInScreen;
// If the popup would extend past the bottom of the screen, open upwards
// instead.
- IntRect screen = screenAvailableRect(m_frameView.get());
+ Widget* rootWidget = m_frameView.get();
+ while (rootWidget->parent())
+ rootWidget = rootWidget->parent();
+ IntRect screen = rootWidget->hostWindow() ? screenAvailableRect(*rootWidget->hostWindow()) : IntRect();
dcheng 2015/05/04 17:38:11 Does m_frameView->root() not work here?
// Use popupInitialCoordinate.x() + rightOffset because RTL position
// needs to be considered.
float pageScaleFactor = m_frameView->frame().page()->pageScaleFactor();

Powered by Google App Engine
This is Rietveld 408576698