mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-08 07:53:54 +00:00
Optimize MoveViewTo() to only move the view if aX != oldX and aY != oldY. This cuts out about 10% on large web pages that slam the status bar, because boxes seem to want to reposition the widget at the same place over and over. r=pavlov
This commit is contained in:
parent
b35887b304
commit
92a8f5fb23
@ -1892,11 +1892,15 @@ NS_IMETHODIMP nsViewManager::MoveViewTo(nsIView *aView, nscoord aX, nscoord aY)
|
||||
{
|
||||
nscoord oldX, oldY;
|
||||
aView->GetPosition(&oldX, &oldY);
|
||||
aView->SetPosition(aX, aY);
|
||||
|
||||
// only do damage control if the view is visible
|
||||
|
||||
if ((aX != oldX) || (aY != oldY)) {
|
||||
// XXXwaterson: there were dire warnings from plitkins about some
|
||||
// rare cases not working when you only move when position has
|
||||
// changed. If they re-occur, move this back outside.
|
||||
aView->SetPosition(aX, aY);
|
||||
|
||||
nsViewVisibility visibility;
|
||||
aView->GetVisibility(visibility);
|
||||
if (visibility != nsViewVisibility_kHide) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user