From c79fb6b7965b4e10faba97e715c1ccb016c1f64a Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Mon, 5 Nov 2012 23:43:44 +0100 Subject: [PATCH] Bug 807174 - Drop-down list used inside a frameset document renders outside the frame. r=roc a=lsblakk --- layout/forms/nsComboboxControlFrame.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index f5e216503aa..9f7197fd949 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -653,11 +653,12 @@ nsComboboxControlFrame::GetAvailableDropdownSpace(nscoord* aAbove, } nscoord minY; - if (!PresContext()->IsChrome()) { - nsIFrame* root = PresContext()->PresShell()->GetRootFrame(); + nsPresContext* pc = PresContext()->GetToplevelContentDocumentPresContext(); + nsIFrame* root = pc ? pc->PresShell()->GetRootFrame() : nullptr; + if (root) { minY = root->GetScreenRectInAppUnits().y; - if (mLastDropDownBelowScreenY < root->GetScreenRectInAppUnits().y) { - // Don't allow the drop-down to be placed above the top of the root frame. + if (mLastDropDownBelowScreenY < minY) { + // Don't allow the drop-down to be placed above the content area. return; } } else {