Create an api for easily converting between the coordinate systems of two

frames or two views.  Use this to fix the auto-positioning of abs pos boxes to
work no matter how their containing block and the block their placeholder lives
in are related, and convert various other callers to the new API.  Bug 266968,
r+sr=roc


git-svn-id: svn://10.0.0.236/trunk@164857 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2004-11-03 16:16:57 +00:00
parent fb9a00759f
commit f53f98f7f3
23 changed files with 249 additions and 569 deletions

View File

@@ -3015,18 +3015,11 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
ComputeBackgroundAnchorPoint(aColor, viewportArea, viewportArea, tileWidth, tileHeight, anchor);
// Convert the anchor point to aForFrame's coordinate space
nsIView* view = aForFrame->GetView();
if (!view) {
nsPoint offset;
aForFrame->GetOffsetFromView(aPresContext, offset, &view);
anchor -= offset;
}
nsPoint offset(0, 0);
nsIView* view = aForFrame->GetClosestView(&offset);
anchor -= offset;
NS_ASSERTION(view, "expected a view");
while (view && (view != viewportView)) {
anchor -= view->GetPosition();
// Get the parent view until we reach the viewport view
view = view->GetParent();
}
anchor -= view->GetOffsetTo(viewportView);
} else {
if (frameType == nsLayoutAtoms::canvasFrame) {
// If the frame is the canvas, the image is placed relative to