mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 449734 part 3 - Update nsThebesDeviceContext::mWidget. r=roc a=blocking2.0:betaN
This commit is contained in:
parent
aea63d061e
commit
48db0466a9
@ -288,10 +288,6 @@ nsThebesDeviceContext::nsThebesDeviceContext()
|
||||
mWidget = nsnull;
|
||||
mFontAliasTable = nsnull;
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
mInitialized = PR_FALSE;
|
||||
#endif
|
||||
|
||||
mDepth = 0;
|
||||
mWidth = 0;
|
||||
mHeight = 0;
|
||||
@ -694,14 +690,14 @@ nsThebesDeviceContext::SetDPI()
|
||||
NS_IMETHODIMP
|
||||
nsThebesDeviceContext::Init(nsIWidget *aWidget)
|
||||
{
|
||||
mWidget = aWidget;
|
||||
if (mScreenManager && mWidget == aWidget)
|
||||
return NS_OK;
|
||||
|
||||
mWidget = aWidget;
|
||||
SetDPI();
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_ASSERTION(!mInitialized, "device context is initialized twice!");
|
||||
mInitialized = PR_TRUE;
|
||||
#endif
|
||||
if (mScreenManager)
|
||||
return NS_OK;
|
||||
|
||||
// register as a memory-pressure observer to free font resources
|
||||
// in low-memory situations.
|
||||
|
@ -160,9 +160,6 @@ protected:
|
||||
nsCOMPtr<nsIAtom> mLocaleLanguage; // XXX temp fix for performance bug
|
||||
nsHashtable* mFontAliasTable;
|
||||
nsIWidget* mWidget;
|
||||
#ifdef NS_DEBUG
|
||||
PRBool mInitialized;
|
||||
#endif
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIScreenManager> mScreenManager;
|
||||
|
@ -58,7 +58,7 @@ using mozilla::layout::RenderFrameParent;
|
||||
#include "nsIDocShellTreeOwner.h"
|
||||
#include "nsIBaseWindow.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsIMarkupDocumentViewer.h"
|
||||
#include "nsIDocumentViewer.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIComponentManager.h"
|
||||
@ -938,6 +938,31 @@ EndSwapDocShellsForDocument(nsIDocument* aDocument, void*)
|
||||
{
|
||||
NS_PRECONDITION(aDocument, "");
|
||||
|
||||
// Our docshell and view trees have been updated for the new hierarchy.
|
||||
// Now also update all nsThebesDeviceContext::mWidget to that of the
|
||||
// container view in the new hierarchy.
|
||||
nsCOMPtr<nsISupports> container = aDocument->GetContainer();
|
||||
nsCOMPtr<nsIDocShell> ds = do_QueryInterface(container);
|
||||
if (ds) {
|
||||
nsCOMPtr<nsIContentViewer> cv;
|
||||
ds->GetContentViewer(getter_AddRefs(cv));
|
||||
while (cv) {
|
||||
nsCOMPtr<nsIDocumentViewer> dv = do_QueryInterface(cv);
|
||||
if (dv) {
|
||||
nsCOMPtr<nsPresContext> pc;
|
||||
dv->GetPresContext(getter_AddRefs(pc));
|
||||
nsIDeviceContext* dc = pc ? pc->DeviceContext() : nsnull;
|
||||
if (dc) {
|
||||
nsIView* v = dv->FindContainerView();
|
||||
dc->Init(v ? v->GetNearestWidget(nsnull) : nsnull);
|
||||
}
|
||||
}
|
||||
nsCOMPtr<nsIContentViewer> prev;
|
||||
cv->GetPreviousViewer(getter_AddRefs(prev));
|
||||
cv = prev;
|
||||
}
|
||||
}
|
||||
|
||||
aDocument->EnumerateFreezableElements(
|
||||
nsObjectFrame::EndSwapDocShells, nsnull);
|
||||
aDocument->EnumerateSubDocuments(EndSwapDocShellsForDocument, nsnull);
|
||||
|
Loading…
Reference in New Issue
Block a user