forked from mirrors/gecko-dev
Bug 1528914 - Tidy the relationship between the doc shell and the pres context. r=qdot
Make it always forward to the document's docshell. We rely on it being setup by the time our stuff runs, and we cannot have multiple pres contexts per document in different docshells anymore. This allows me to also move some state to the document (about whether it's currently loaded in a chrome docshell (nsPresContext::mIsChrome) and whether it's a chrome origin image (nsPresContext::mIsChromeOriginImage), which will help for bug 1490401 / bug 1418159. The pres context already relies on having the docshell available on `Init` and we don't properly handle dynamic changes to it. The reason I store some state like whether the doc URI is chrome:// and whether we're in a chrome docshell is not (only) to avoid recomputing it over and over, but also to allow me to read them from Stylo (main-thread blocked, but poke at that from multiple non-main-threads). Differential Revision: https://phabricator.services.mozilla.com/D20301 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
695a8e0608
commit
a59f4ed1fb
8 changed files with 85 additions and 164 deletions
|
|
@ -1227,6 +1227,8 @@ Document::Document(const char* aContentType)
|
|||
mInUnlinkOrDeletion(false),
|
||||
mHasHadScriptHandlingObject(false),
|
||||
mIsBeingUsedAsImage(false),
|
||||
mDocURISchemeIsChrome(false),
|
||||
mInChromeDocShell(false),
|
||||
mIsSyntheticDocument(false),
|
||||
mHasLinksToUpdateRunnable(false),
|
||||
mFlushingPendingLinkUpdates(false),
|
||||
|
|
@ -2835,6 +2837,8 @@ void Document::SetDocumentURI(nsIURI* aURI) {
|
|||
mDocumentURI = aURI;
|
||||
nsIURI* newBase = GetDocBaseURI();
|
||||
|
||||
mDocURISchemeIsChrome = aURI && IsChromeURI(aURI);
|
||||
|
||||
bool equalBases = false;
|
||||
// Changing just the ref of a URI does not change how relative URIs would
|
||||
// resolve wrt to it, so we can treat the bases as equal as long as they're
|
||||
|
|
@ -4301,6 +4305,9 @@ void Document::SetContainer(nsDocShell* aContainer) {
|
|||
mDocumentContainer = WeakPtr<nsDocShell>();
|
||||
}
|
||||
|
||||
mInChromeDocShell =
|
||||
aContainer && aContainer->ItemType() == nsIDocShellTreeItem::typeChrome;
|
||||
|
||||
EnumerateActivityObservers(NotifyActivityChanged, nullptr);
|
||||
|
||||
// IsTopLevelWindowInactive depends on the docshell, so
|
||||
|
|
|
|||
|
|
@ -2474,6 +2474,16 @@ class Document : public nsINode,
|
|||
return !mParentDocument && !mDisplayDocument;
|
||||
}
|
||||
|
||||
bool IsDocumentURISchemeChrome() const { return mDocURISchemeIsChrome; }
|
||||
|
||||
bool IsInChromeDocShell() const {
|
||||
const Document* root = this;
|
||||
while (const Document* displayDoc = root->GetDisplayDocument()) {
|
||||
root = displayDoc;
|
||||
}
|
||||
return root->mInChromeDocShell;
|
||||
}
|
||||
|
||||
bool IsBeingUsedAsImage() const { return mIsBeingUsedAsImage; }
|
||||
|
||||
void SetIsBeingUsedAsImage() { mIsBeingUsedAsImage = true; }
|
||||
|
|
@ -4007,6 +4017,12 @@ class Document : public nsINode,
|
|||
// True if we're an SVG document being used as an image.
|
||||
bool mIsBeingUsedAsImage : 1;
|
||||
|
||||
// True if our current document URI's scheme is chrome://
|
||||
bool mDocURISchemeIsChrome : 1;
|
||||
|
||||
// True if we're loaded in a chrome docshell.
|
||||
bool mInChromeDocShell : 1;
|
||||
|
||||
// True is this document is synthetic : stand alone image, video, audio
|
||||
// file, etc.
|
||||
bool mIsSyntheticDocument : 1;
|
||||
|
|
|
|||
|
|
@ -3851,10 +3851,6 @@ void nsContentUtils::LogMessageToConsole(const char* aMsg) {
|
|||
sConsoleService->LogStringMessage(NS_ConvertUTF8toUTF16(aMsg).get());
|
||||
}
|
||||
|
||||
bool nsContentUtils::IsChromeDoc(const Document* aDocument) {
|
||||
return aDocument && aDocument->NodePrincipal() == sSystemPrincipal;
|
||||
}
|
||||
|
||||
bool nsContentUtils::IsChildOfSameType(Document* aDoc) {
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(aDoc->GetDocShell());
|
||||
nsCOMPtr<nsIDocShellTreeItem> sameTypeParent;
|
||||
|
|
@ -3888,24 +3884,6 @@ bool nsContentUtils::IsUtf8OnlyPlainTextType(const nsACString& aContentType) {
|
|||
aContentType.EqualsLiteral(TEXT_VTT);
|
||||
}
|
||||
|
||||
// static
|
||||
bool nsContentUtils::IsInChromeDocshell(Document* aDocument) {
|
||||
if (!aDocument) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (aDocument->GetDisplayDocument()) {
|
||||
return IsInChromeDocshell(aDocument->GetDisplayDocument());
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShell = aDocument->GetDocShell();
|
||||
if (!docShell) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return docShell->ItemType() == nsIDocShellTreeItem::typeChrome;
|
||||
}
|
||||
|
||||
// static
|
||||
nsIContentPolicy* nsContentUtils::GetContentPolicy() {
|
||||
if (!sTriedToGetContentPolicy) {
|
||||
|
|
|
|||
|
|
@ -1227,7 +1227,9 @@ class nsContentUtils {
|
|||
/**
|
||||
* Returns true if aDocument is a chrome document
|
||||
*/
|
||||
static bool IsChromeDoc(const Document* aDocument);
|
||||
static bool IsChromeDoc(const Document* aDocument) {
|
||||
return aDocument && aDocument->NodePrincipal() == sSystemPrincipal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if aDocument is in a docshell whose parent is the same type
|
||||
|
|
@ -1250,7 +1252,9 @@ class nsContentUtils {
|
|||
* display purposes. Returns false for null documents or documents
|
||||
* which do not belong to a docshell.
|
||||
*/
|
||||
static bool IsInChromeDocshell(Document* aDocument);
|
||||
static bool IsInChromeDocshell(const Document* aDocument) {
|
||||
return aDocument && aDocument->IsInChromeDocShell();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the content policy service
|
||||
|
|
|
|||
|
|
@ -689,9 +689,6 @@ nsresult nsDocumentViewer::SyncParentSubDocMap() {
|
|||
NS_IMETHODIMP
|
||||
nsDocumentViewer::SetContainer(nsIDocShell* aContainer) {
|
||||
mContainer = static_cast<nsDocShell*>(aContainer);
|
||||
if (mPresContext) {
|
||||
mPresContext->SetContainer(mContainer);
|
||||
}
|
||||
|
||||
// We're loading a new document into the window where this document
|
||||
// viewer lives, sync the parent document's frame element -> sub
|
||||
|
|
@ -953,8 +950,6 @@ nsresult nsDocumentViewer::InitInternal(nsIWidget* aParentWidget,
|
|||
nsCOMPtr<nsILinkHandler> linkHandler;
|
||||
requestor->GetInterface(NS_GET_IID(nsILinkHandler),
|
||||
getter_AddRefs(linkHandler));
|
||||
|
||||
mPresContext->SetContainer(mContainer);
|
||||
mPresContext->SetLinkHandler(linkHandler);
|
||||
}
|
||||
|
||||
|
|
@ -1476,7 +1471,6 @@ static void AttachContainerRecurse(nsIDocShell* aShell) {
|
|||
}
|
||||
RefPtr<nsPresContext> pc = viewer->GetPresContext();
|
||||
if (pc) {
|
||||
pc->SetContainer(static_cast<nsDocShell*>(aShell));
|
||||
nsCOMPtr<nsILinkHandler> handler = do_QueryInterface(aShell);
|
||||
pc->SetLinkHandler(handler);
|
||||
}
|
||||
|
|
@ -1501,7 +1495,9 @@ NS_IMETHODIMP
|
|||
nsDocumentViewer::Open(nsISupports* aState, nsISHEntry* aSHEntry) {
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_INITIALIZED);
|
||||
|
||||
if (mDocument) mDocument->SetContainer(mContainer);
|
||||
if (mDocument) {
|
||||
mDocument->SetContainer(mContainer);
|
||||
}
|
||||
|
||||
nsresult rv = InitInternal(mParentWidget, aState, mBounds, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
|
@ -2171,8 +2167,6 @@ nsDocumentViewer::Show(void) {
|
|||
if (linkHandler) {
|
||||
mPresContext->SetLinkHandler(linkHandler);
|
||||
}
|
||||
|
||||
mPresContext->SetContainer(mContainer);
|
||||
}
|
||||
|
||||
if (mPresContext) {
|
||||
|
|
|
|||
|
|
@ -222,14 +222,11 @@ nsPresContext::nsPresContext(dom::Document* aDocument, nsPresContextType aType)
|
|||
mFontFeatureValuesDirty(true),
|
||||
mSuppressResizeReflow(false),
|
||||
mIsVisual(false),
|
||||
mIsChrome(false),
|
||||
mIsChromeOriginImage(false),
|
||||
mPaintFlashing(false),
|
||||
mPaintFlashingInitialized(false),
|
||||
mHasWarnedAboutPositionedTableParts(false),
|
||||
mHasWarnedAboutTooLargeDashedOrDottedRadius(false),
|
||||
mQuirkSheetAdded(false),
|
||||
mNeedsPrefUpdate(false),
|
||||
mHadNonBlankPaint(false),
|
||||
mHadContentfulPaint(false),
|
||||
mHadContentfulPaintComposite(false)
|
||||
|
|
@ -359,6 +356,15 @@ static bool sLookAndFeelChanged;
|
|||
// one prescontext.
|
||||
static bool sThemeChanged;
|
||||
|
||||
bool nsPresContext::IsChrome() const {
|
||||
return Document()->IsInChromeDocShell();
|
||||
}
|
||||
|
||||
bool nsPresContext::IsChromeOriginImage() const {
|
||||
return Document()->IsBeingUsedAsImage() &&
|
||||
Document()->IsDocumentURISchemeChrome();
|
||||
}
|
||||
|
||||
void nsPresContext::GetDocumentColorPreferences() {
|
||||
// Make sure the preferences are initialized. In the normal run,
|
||||
// they would already be, because gfxPlatform would have been created,
|
||||
|
|
@ -367,7 +373,6 @@ void nsPresContext::GetDocumentColorPreferences() {
|
|||
|
||||
int32_t useAccessibilityTheme = 0;
|
||||
bool usePrefColors = true;
|
||||
bool isChromeDocShell = false;
|
||||
static int32_t sDocumentColorsSetting;
|
||||
static bool sDocumentColorsSettingPrefCached = false;
|
||||
if (!sDocumentColorsSettingPrefCached) {
|
||||
|
|
@ -376,22 +381,7 @@ void nsPresContext::GetDocumentColorPreferences() {
|
|||
"browser.display.document_color_use", 0);
|
||||
}
|
||||
|
||||
dom::Document* doc = mDocument->GetDisplayDocument();
|
||||
if (doc && doc->GetDocShell()) {
|
||||
isChromeDocShell =
|
||||
nsIDocShellTreeItem::typeChrome == doc->GetDocShell()->ItemType();
|
||||
} else {
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShell(mContainer);
|
||||
if (docShell) {
|
||||
isChromeDocShell =
|
||||
nsIDocShellTreeItem::typeChrome == docShell->ItemType();
|
||||
}
|
||||
}
|
||||
|
||||
mIsChromeOriginImage = mDocument->IsBeingUsedAsImage() &&
|
||||
IsChromeURI(mDocument->GetDocumentURI());
|
||||
|
||||
if (isChromeDocShell || mIsChromeOriginImage) {
|
||||
if (IsChrome() || IsChromeOriginImage()) {
|
||||
usePrefColors = false;
|
||||
} else {
|
||||
useAccessibilityTheme =
|
||||
|
|
@ -441,11 +431,10 @@ void nsPresContext::GetDocumentColorPreferences() {
|
|||
if (sDocumentColorsSetting == 1 || mDocument->IsBeingUsedAsImage()) {
|
||||
mUseDocumentColors = true;
|
||||
} else if (sDocumentColorsSetting == 2) {
|
||||
mUseDocumentColors = isChromeDocShell || mIsChromeOriginImage;
|
||||
mUseDocumentColors = IsChrome() || IsChromeOriginImage();
|
||||
} else {
|
||||
MOZ_ASSERT(
|
||||
!useAccessibilityTheme || !(isChromeDocShell || mIsChromeOriginImage),
|
||||
"The accessibility theme should only be on for non-chrome");
|
||||
MOZ_ASSERT(!useAccessibilityTheme || !(IsChrome() || IsChromeOriginImage()),
|
||||
"The accessibility theme should only be on for non-chrome");
|
||||
mUseDocumentColors = !useAccessibilityTheme;
|
||||
}
|
||||
}
|
||||
|
|
@ -678,14 +667,7 @@ void nsPresContext::UpdateAfterPreferencesChanged() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!mContainer) {
|
||||
// Delay updating until there is a container
|
||||
mNeedsPrefUpdate = true;
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShell(mContainer);
|
||||
if (docShell && nsIDocShellTreeItem::typeChrome == docShell->ItemType()) {
|
||||
if (mDocument->IsInChromeDocShell()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -753,7 +735,6 @@ nsresult nsPresContext::Init(nsDeviceContext* aDeviceContext) {
|
|||
"How did we end up with a presshell if our parent doesn't "
|
||||
"have one?");
|
||||
if (parent && parent->GetPresContext()) {
|
||||
// We don't have our container set yet at this point
|
||||
nsCOMPtr<nsIDocShellTreeItem> ourItem = mDocument->GetDocShell();
|
||||
if (ourItem) {
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentItem;
|
||||
|
|
@ -812,32 +793,28 @@ void nsPresContext::AttachShell(nsIPresShell* aShell) {
|
|||
mCounterStyleManager = new mozilla::CounterStyleManager(this);
|
||||
|
||||
dom::Document* doc = mShell->GetDocument();
|
||||
NS_ASSERTION(doc, "expect document here");
|
||||
if (doc) {
|
||||
// Have to update PresContext's mDocument before calling any other methods.
|
||||
mDocument = doc;
|
||||
}
|
||||
MOZ_ASSERT(doc);
|
||||
// Have to update PresContext's mDocument before calling any other methods.
|
||||
mDocument = doc;
|
||||
// Initialize our state from the user preferences, now that we
|
||||
// have a presshell, and hence a document.
|
||||
GetUserPreferences();
|
||||
|
||||
if (doc) {
|
||||
nsIURI* docURI = doc->GetDocumentURI();
|
||||
nsIURI* docURI = doc->GetDocumentURI();
|
||||
|
||||
if (IsDynamic() && docURI) {
|
||||
bool isChrome = false;
|
||||
bool isRes = false;
|
||||
docURI->SchemeIs("chrome", &isChrome);
|
||||
docURI->SchemeIs("resource", &isRes);
|
||||
if (IsDynamic() && docURI) {
|
||||
bool isChrome = false;
|
||||
bool isRes = false;
|
||||
docURI->SchemeIs("chrome", &isChrome);
|
||||
docURI->SchemeIs("resource", &isRes);
|
||||
|
||||
if (!isChrome && !isRes)
|
||||
mImageAnimationMode = mImageAnimationModePref;
|
||||
else
|
||||
mImageAnimationMode = imgIContainer::kNormalAnimMode;
|
||||
}
|
||||
|
||||
UpdateCharSet(doc->GetDocumentCharacterSet());
|
||||
if (!isChrome && !isRes)
|
||||
mImageAnimationMode = mImageAnimationModePref;
|
||||
else
|
||||
mImageAnimationMode = imgIContainer::kNormalAnimMode;
|
||||
}
|
||||
|
||||
UpdateCharSet(doc->GetDocumentCharacterSet());
|
||||
}
|
||||
|
||||
void nsPresContext::DetachShell() {
|
||||
|
|
@ -1302,45 +1279,17 @@ bool nsPresContext::ElementWouldPropagateScrollStyles(const Element& aElement) {
|
|||
return GetPropagatedScrollStylesForViewport(this, &dummy) == &aElement;
|
||||
}
|
||||
|
||||
void nsPresContext::SetContainer(nsIDocShell* aDocShell) {
|
||||
if (aDocShell) {
|
||||
NS_ASSERTION(!(mContainer && mNeedsPrefUpdate),
|
||||
"Should only need pref update if mContainer is null.");
|
||||
mContainer = static_cast<nsDocShell*>(aDocShell);
|
||||
if (mNeedsPrefUpdate) {
|
||||
DispatchPrefChangedRunnableIfNeeded();
|
||||
mNeedsPrefUpdate = false;
|
||||
}
|
||||
} else {
|
||||
mContainer = WeakPtr<nsDocShell>();
|
||||
}
|
||||
UpdateIsChrome();
|
||||
if (mContainer) {
|
||||
GetDocumentColorPreferences();
|
||||
}
|
||||
nsISupports* nsPresContext::GetContainerWeak() const { return GetDocShell(); }
|
||||
|
||||
nsIDocShell* nsPresContext::GetDocShell() const {
|
||||
return mDocument->GetDocShell();
|
||||
}
|
||||
|
||||
nsISupports* nsPresContext::GetContainerWeak() const {
|
||||
return static_cast<nsIDocShell*>(mContainer);
|
||||
}
|
||||
|
||||
nsIDocShell* nsPresContext::GetDocShell() const { return mContainer; }
|
||||
|
||||
/* virtual */ void nsPresContext::Detach() {
|
||||
SetContainer(nullptr);
|
||||
SetLinkHandler(nullptr);
|
||||
}
|
||||
/* virtual */ void nsPresContext::Detach() { SetLinkHandler(nullptr); }
|
||||
|
||||
bool nsPresContext::BidiEnabled() const { return Document()->GetBidiEnabled(); }
|
||||
|
||||
void nsPresContext::SetBidiEnabled() const {
|
||||
if (mShell) {
|
||||
dom::Document* doc = mShell->GetDocument();
|
||||
if (doc) {
|
||||
doc->SetBidiEnabled();
|
||||
}
|
||||
}
|
||||
}
|
||||
void nsPresContext::SetBidiEnabled() const { Document()->SetBidiEnabled(); }
|
||||
|
||||
void nsPresContext::SetBidi(uint32_t aSource) {
|
||||
// Don't do all this stuff unless the options have changed.
|
||||
|
|
@ -1358,10 +1307,7 @@ void nsPresContext::SetBidi(uint32_t aSource) {
|
|||
} else if (IBMBIDI_TEXTTYPE_LOGICAL == GET_BIDI_OPTION_TEXTTYPE(aSource)) {
|
||||
SetVisualMode(false);
|
||||
} else {
|
||||
dom::Document* doc = mShell->GetDocument();
|
||||
if (doc) {
|
||||
SetVisualMode(IsVisualCharset(doc->GetDocumentCharacterSet()));
|
||||
}
|
||||
SetVisualMode(IsVisualCharset(Document()->GetDocumentCharacterSet()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1790,20 +1736,19 @@ void nsPresContext::SetPrintSettings(nsIPrintSettings* aPrintSettings) {
|
|||
}
|
||||
|
||||
bool nsPresContext::EnsureVisible() {
|
||||
nsCOMPtr<nsIDocShell> docShell(mContainer);
|
||||
if (docShell) {
|
||||
nsCOMPtr<nsIContentViewer> cv;
|
||||
docShell->GetContentViewer(getter_AddRefs(cv));
|
||||
// Make sure this is the content viewer we belong with
|
||||
if (cv && cv->GetPresContext() == this) {
|
||||
// OK, this is us. We want to call Show() on the content viewer.
|
||||
nsresult result = cv->Show();
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
nsCOMPtr<nsIDocShell> docShell(GetDocShell());
|
||||
if (!docShell) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
nsCOMPtr<nsIContentViewer> cv;
|
||||
docShell->GetContentViewer(getter_AddRefs(cv));
|
||||
// Make sure this is the content viewer we belong with
|
||||
if (!cv || cv->GetPresContext() != this) {
|
||||
return false;
|
||||
}
|
||||
// OK, this is us. We want to call Show() on the content viewer.
|
||||
nsresult result = cv->Show();
|
||||
return NS_SUCCEEDED(result);
|
||||
}
|
||||
|
||||
#ifdef MOZ_REFLOW_PERF
|
||||
|
|
@ -1814,11 +1759,6 @@ void nsPresContext::CountReflows(const char* aName, nsIFrame* aFrame) {
|
|||
}
|
||||
#endif
|
||||
|
||||
void nsPresContext::UpdateIsChrome() {
|
||||
mIsChrome =
|
||||
mContainer && nsIDocShellTreeItem::typeChrome == mContainer->ItemType();
|
||||
}
|
||||
|
||||
bool nsPresContext::HasAuthorSpecifiedRules(const nsIFrame* aFrame,
|
||||
uint32_t aRuleTypeMask) const {
|
||||
Element* elem = aFrame->GetContent()->AsElement();
|
||||
|
|
@ -2592,12 +2532,8 @@ nscoord nsPresContext::PhysicalMillimetersToAppUnits(float aMM) const {
|
|||
}
|
||||
|
||||
bool nsPresContext::IsDeviceSizePageSize() {
|
||||
bool isDeviceSizePageSize = false;
|
||||
nsCOMPtr<nsIDocShell> docShell(mContainer);
|
||||
if (docShell) {
|
||||
isDeviceSizePageSize = docShell->GetDeviceSizeIsPageSize();
|
||||
}
|
||||
return isDeviceSizePageSize;
|
||||
nsIDocShell* docShell = GetDocShell();
|
||||
return docShell && docShell->GetDeviceSizeIsPageSize();
|
||||
}
|
||||
|
||||
uint64_t nsPresContext::GetRestyleGeneration() const {
|
||||
|
|
|
|||
|
|
@ -413,7 +413,6 @@ class nsPresContext : public nsISupports,
|
|||
bool GetFocusRingOnAnything() const { return mFocusRingOnAnything; }
|
||||
uint8_t GetFocusRingStyle() const { return mFocusRingStyle; }
|
||||
|
||||
void SetContainer(nsIDocShell* aContainer);
|
||||
|
||||
nsISupports* GetContainerWeak() const;
|
||||
|
||||
|
|
@ -425,7 +424,7 @@ class nsPresContext : public nsISupports,
|
|||
|
||||
/**
|
||||
* Detach this pres context - i.e. cancel relevant timers,
|
||||
* SetLinkHandler(null), SetContainer(null) etc.
|
||||
* SetLinkHandler(null), etc.
|
||||
* Only to be used by the DocumentViewer.
|
||||
*/
|
||||
virtual void Detach();
|
||||
|
|
@ -871,9 +870,8 @@ class nsPresContext : public nsISupports,
|
|||
}
|
||||
|
||||
// Is this presentation in a chrome docshell?
|
||||
bool IsChrome() const { return mIsChrome; }
|
||||
bool IsChromeOriginImage() const { return mIsChromeOriginImage; }
|
||||
void UpdateIsChrome();
|
||||
bool IsChrome() const;
|
||||
bool IsChromeOriginImage() const;
|
||||
|
||||
// Public API for native theme code to get style internals.
|
||||
bool HasAuthorSpecifiedRules(const nsIFrame* aFrame,
|
||||
|
|
@ -1195,8 +1193,6 @@ class nsPresContext : public nsISupports,
|
|||
bool mInflationDisabledForShrinkWrap;
|
||||
|
||||
protected:
|
||||
mozilla::WeakPtr<nsDocShell> mContainer;
|
||||
|
||||
float mSystemFontScale; // Internal text zoom factor, defaults to 1.0
|
||||
float mTextZoom; // Text zoom, defaults to 1.0
|
||||
float mEffectiveTextZoom; // Text zoom * system font scale
|
||||
|
|
@ -1323,9 +1319,6 @@ class nsPresContext : public nsISupports,
|
|||
|
||||
unsigned mIsVisual : 1;
|
||||
|
||||
unsigned mIsChrome : 1;
|
||||
unsigned mIsChromeOriginImage : 1;
|
||||
|
||||
// Should we paint flash in this context? Do not use this variable directly.
|
||||
// Use GetPaintFlashing() method instead.
|
||||
mutable unsigned mPaintFlashing : 1;
|
||||
|
|
@ -1338,9 +1331,6 @@ class nsPresContext : public nsISupports,
|
|||
// Have we added quirk.css to the style set?
|
||||
unsigned mQuirkSheetAdded : 1;
|
||||
|
||||
// Is there a pref update to process once we have a container?
|
||||
unsigned mNeedsPrefUpdate : 1;
|
||||
|
||||
// Has NotifyNonBlankPaint been called on this PresContext?
|
||||
unsigned mHadNonBlankPaint : 1;
|
||||
// Has NotifyContentfulPaint been called on this PresContext?
|
||||
|
|
|
|||
|
|
@ -2270,10 +2270,6 @@ nsresult nsPrintJob::ReflowPrintObject(const UniquePtr<nsPrintObject>& aPO) {
|
|||
aPO.get(), aPO->mPresShell.get(), gFrameTypesStr[aPO->mFrameType],
|
||||
adjSize.width, adjSize.height));
|
||||
|
||||
// This docshell stuff is weird; will go away when we stop having multiple
|
||||
// presentations per document
|
||||
aPO->mPresContext->SetContainer(aPO->mDocShell);
|
||||
|
||||
aPO->mPresShell->BeginObservingDocument();
|
||||
|
||||
aPO->mPresContext->SetPageSize(adjSize);
|
||||
|
|
|
|||
Loading…
Reference in a new issue