Adjust for viewport scrollbars when positioning a fixed background. b=402807 r+sr=roc a=blocking1.9

This commit is contained in:
mats.palmgren%bredband.net 2008-02-06 18:22:24 +00:00
Родитель e7c6c707de
Коммит af8fae6ff3
2 изменённых файлов: 15 добавлений и 3 удалений

Просмотреть файл

@ -3591,8 +3591,9 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
nsIFrame* topFrame =
aPresContext->PresShell()->FrameManager()->GetRootFrame();
NS_ASSERTION(topFrame, "no root frame");
nsIFrame* pageContentFrame = nsnull;
if (aPresContext->IsPaginated()) {
nsIFrame* pageContentFrame =
pageContentFrame =
nsLayoutUtils::GetClosestFrameOfType(aForFrame, nsGkAtoms::pageContentFrame);
if (pageContentFrame) {
topFrame = pageContentFrame;
@ -3600,8 +3601,19 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
// else this is an embedded shell and its root frame is what we want
}
// Get the anchor point, relative to the viewport.
nsRect viewportArea = topFrame->GetRect();
if (!pageContentFrame) {
// Subtract the size of scrollbars.
nsIScrollableFrame* scrollableFrame =
aPresContext->PresShell()->GetRootScrollFrameAsScrollable();
if (scrollableFrame) {
nsMargin scrollbars = scrollableFrame->GetActualScrollbarSizes();
viewportArea.Deflate(scrollbars);
}
}
// Get the anchor point, relative to the viewport.
ComputeBackgroundAnchorPoint(aColor, viewportArea, viewportArea, tileWidth, tileHeight, anchor);
// Convert the anchor point from viewport coordinates to aForFrame

Просмотреть файл

@ -618,7 +618,7 @@ skip-if(MOZ_WIDGET_TOOLKIT!="windows") == 391045.html 391045-ref.html # windows-
== 402567-2.html 402567-2-ref.html
== 402567-3.html 402567-3-ref.html
== 402567-4.html 402567-4-ref.html
fails == 402807-1.html 402807-1-ref.html # bug 402807
== 402807-1.html 402807-1-ref.html
== 402950-1.html 402950-1-ref.html
== 403129-1.html 403129-1-ref.html
== 403129-2.html 403129-2-ref.html