Bug 807174 - Drop-down list used inside a frameset document renders outside the frame. r=roc

This commit is contained in:
Mats Palmgren 2012-10-31 06:10:38 +01:00
parent 7d3defab82
commit d9d4cc8342

View File

@ -644,11 +644,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 {