Bug 757362. Use the displayport for the dirty rect (if one is set) when building the display list for a subdocument so that position: fixed items are correctly included. r=roc

This commit is contained in:
Timothy Nikkel 2012-06-20 17:35:54 -05:00
parent f8ade67ce6
commit 8a5d3ce14d

View File

@ -298,10 +298,17 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsRect dirty;
if (subdocRootFrame) {
// get the dirty rect relative to the root frame of the subdoc
dirty = aDirtyRect + GetOffsetToCrossDoc(subdocRootFrame);
// and convert into the appunits of the subdoc
dirty = dirty.ConvertAppUnitsRoundOut(parentAPD, subdocAPD);
nsIDocument* doc = subdocRootFrame->PresContext()->Document();
nsIContent* root = doc ? doc->GetRootElement() : nsnull;
nsRect displayPort;
if (root && nsLayoutUtils::GetDisplayPort(root, &displayPort)) {
dirty = displayPort;
} else {
// get the dirty rect relative to the root frame of the subdoc
dirty = aDirtyRect + GetOffsetToCrossDoc(subdocRootFrame);
// and convert into the appunits of the subdoc
dirty = dirty.ConvertAppUnitsRoundOut(parentAPD, subdocAPD);
}
aBuilder->EnterPresShell(subdocRootFrame, dirty);
}