Chromium Code Reviews| 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(); |