зеркало из https://github.com/mozilla/gecko-dev.git
Stop at the viewmanager root when computing offsets for flashing stuff. Bug
188210, r=caillon, sr=kin
This commit is contained in:
Родитель
11a7fe7e34
Коммит
3c752c4794
|
@ -148,11 +148,21 @@ inLayoutUtils::GetClientOrigin(nsIPresContext* aPresContext,
|
|||
nsPoint result(0,0);
|
||||
nsIView* view;
|
||||
aFrame->GetOffsetFromView(aPresContext, result, &view);
|
||||
nsIView* rootView = nsnull;
|
||||
if (view) {
|
||||
nsCOMPtr<nsIViewManager> viewManager;
|
||||
view->GetViewManager(*getter_AddRefs(viewManager));
|
||||
NS_ASSERTION(viewManager, "View must have a viewmanager");
|
||||
viewManager->GetRootView(rootView);
|
||||
}
|
||||
while (view) {
|
||||
nscoord x, y;
|
||||
view->GetPosition(&x, &y);
|
||||
result.x += x;
|
||||
result.y += y;
|
||||
if (view == rootView) {
|
||||
break;
|
||||
}
|
||||
view->GetParent(view);
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -64,7 +64,8 @@ public:
|
|||
static PRBool IsDocumentElement(nsIDOMNode* aNode);
|
||||
/**
|
||||
* This function returns the offset of a frame with respect to the
|
||||
* root view (for use by inFlasher::DrawElementOutline and the like
|
||||
* root view of the aPresContext's viewmanager (for use by
|
||||
* inFlasher::DrawElementOutline and the like)
|
||||
*
|
||||
* @param aFrame the frame whose offset we want
|
||||
* @param aPresContext the presentation context
|
||||
|
|
Загрузка…
Ссылка в новой задаче