Created attachment 311013 [details] stack See attached stack, it seems a bit unnecessary (and fragile) to do that. One way of fixing it would be to call SetEnableRendering() in DocumentViewerImpl::Show()/Hide().
Comment on attachment 311014 [details] [diff] [review] wip I like this
Doesn't that disable rendering for the whole viewmanager tree, though? That doesn't seem like the right thing to be doing, does it?
Comment on attachment 311014 [details] [diff] [review] wip of course, you're right :-(. The safest thing to do here would be to just have nsViewManager::UpdateView drop invalidation on the floor if the view observer has been disconnected.
Created attachment 546883 [details] [diff] [review] wip2 Like so? It passed on Try and I tested it manually on Linux/WinXP/OSX and I didn't see any problems.
Why do we want to do this? If we have a change to the view tree that affects the rendering of the window why shouldn't we invalidate?
If the view manager has no observer then it's not connected to a visible presentation, I guess.
That document doesn't care about the invalidate, but a parent document might need to repaint if a child document goes away.
Wouldn't the child document going away already have triggered the invalidation?