Bug 1662838 part 2: Remove nsIContentViewer's unused pausePainting() and resumePainting() APIs. r=tnikkel
These APIs are entirely unused (aside from one usage in a test, which part 1 in this patch series removed), so this patch shouldn't impact behavior at all. Historical note: we briefly removed these APIs once before, in this commit: https://hg.mozilla.org/mozilla-central/rev/c216ff19d690 ...but we brought them back because we had a motivating use case at the time. We don't have any such motivating use cases any more, though. So, this patch here is essentially a modernized version of that older commit. Differential Revision: https://phabricator.services.mozilla.com/D108148
This commit is contained in:
@@ -288,18 +288,6 @@ interface nsIContentViewer : nsISupports
|
|||||||
void getContentSizeConstrained(in long maxWidth, in long maxHeight,
|
void getContentSizeConstrained(in long maxWidth, in long maxHeight,
|
||||||
out long width, out long height);
|
out long width, out long height);
|
||||||
|
|
||||||
/**
|
|
||||||
* Instruct the refresh driver to discontinue painting until further
|
|
||||||
* notice.
|
|
||||||
*/
|
|
||||||
void pausePainting();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instruct the refresh driver to resume painting after a previous call to
|
|
||||||
* pausePainting().
|
|
||||||
*/
|
|
||||||
void resumePainting();
|
|
||||||
|
|
||||||
[noscript, notxpcom] Encoding getHintCharset();
|
[noscript, notxpcom] Encoding getHintCharset();
|
||||||
[noscript, notxpcom] void setHintCharset(in Encoding aEncoding);
|
[noscript, notxpcom] void setHintCharset(in Encoding aEncoding);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -836,7 +836,6 @@ PresShell::PresShell(Document* aDocument)
|
|||||||
mFontSizeInflationForceEnabled(false),
|
mFontSizeInflationForceEnabled(false),
|
||||||
mFontSizeInflationDisabledInMasterProcess(false),
|
mFontSizeInflationDisabledInMasterProcess(false),
|
||||||
mFontSizeInflationEnabled(false),
|
mFontSizeInflationEnabled(false),
|
||||||
mPaintingIsFrozen(false),
|
|
||||||
mIsNeverPainting(false),
|
mIsNeverPainting(false),
|
||||||
mResolutionUpdated(false),
|
mResolutionUpdated(false),
|
||||||
mResolutionUpdatedByApz(false),
|
mResolutionUpdatedByApz(false),
|
||||||
@@ -905,13 +904,6 @@ PresShell::~PresShell() {
|
|||||||
mLastCallbackEventRequest == nullptr,
|
mLastCallbackEventRequest == nullptr,
|
||||||
"post-reflow queues not empty. This means we're leaking");
|
"post-reflow queues not empty. This means we're leaking");
|
||||||
|
|
||||||
// Verify that if painting was frozen, but we're being removed from the tree,
|
|
||||||
// that we now re-enable painting on our refresh driver, since it may need to
|
|
||||||
// be re-used by another presentation.
|
|
||||||
if (mPaintingIsFrozen) {
|
|
||||||
mPresContext->RefreshDriver()->Thaw();
|
|
||||||
}
|
|
||||||
|
|
||||||
MOZ_ASSERT(mAllocatedPointers.IsEmpty(),
|
MOZ_ASSERT(mAllocatedPointers.IsEmpty(),
|
||||||
"Some pres arena objects were not freed");
|
"Some pres arena objects were not freed");
|
||||||
|
|
||||||
@@ -11379,22 +11371,6 @@ bool PresShell::DetermineFontSizeInflationState() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PresShell::PausePainting() {
|
|
||||||
if (GetPresContext()->RefreshDriver()->GetPresContext() != GetPresContext())
|
|
||||||
return;
|
|
||||||
|
|
||||||
mPaintingIsFrozen = true;
|
|
||||||
GetPresContext()->RefreshDriver()->Freeze();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PresShell::ResumePainting() {
|
|
||||||
if (GetPresContext()->RefreshDriver()->GetPresContext() != GetPresContext())
|
|
||||||
return;
|
|
||||||
|
|
||||||
mPaintingIsFrozen = false;
|
|
||||||
GetPresContext()->RefreshDriver()->Thaw();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PresShell::SyncWindowProperties(nsView* aView) {
|
void PresShell::SyncWindowProperties(nsView* aView) {
|
||||||
nsIFrame* frame = aView->GetFrame();
|
nsIFrame* frame = aView->GetFrame();
|
||||||
if (frame && mPresContext) {
|
if (frame && mPresContext) {
|
||||||
|
|||||||
@@ -681,20 +681,6 @@ class PresShell final : public nsStubDocumentObserver,
|
|||||||
*/
|
*/
|
||||||
bool IsPaintingSuppressed() const { return mPaintingSuppressed; }
|
bool IsPaintingSuppressed() const { return mPaintingSuppressed; }
|
||||||
|
|
||||||
/**
|
|
||||||
* Pause painting by freezing the refresh driver of this and all parent
|
|
||||||
* presentations. This may not have the desired effect if this pres shell
|
|
||||||
* has its own refresh driver.
|
|
||||||
*/
|
|
||||||
void PausePainting();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resume painting by thawing the refresh driver of this and all parent
|
|
||||||
* presentations. This may not have the desired effect if this pres shell
|
|
||||||
* has its own refresh driver.
|
|
||||||
*/
|
|
||||||
void ResumePainting();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unsuppress painting.
|
* Unsuppress painting.
|
||||||
*/
|
*/
|
||||||
@@ -3080,8 +3066,6 @@ class PresShell final : public nsStubDocumentObserver,
|
|||||||
bool mFontSizeInflationDisabledInMasterProcess : 1;
|
bool mFontSizeInflationDisabledInMasterProcess : 1;
|
||||||
bool mFontSizeInflationEnabled : 1;
|
bool mFontSizeInflationEnabled : 1;
|
||||||
|
|
||||||
bool mPaintingIsFrozen : 1;
|
|
||||||
|
|
||||||
// If a document belongs to an invisible DocShell, this flag must be set
|
// If a document belongs to an invisible DocShell, this flag must be set
|
||||||
// to true, so we can avoid any paint calls for widget related to this
|
// to true, so we can avoid any paint calls for widget related to this
|
||||||
// presshell.
|
// presshell.
|
||||||
|
|||||||
@@ -2690,28 +2690,6 @@ nsDocumentViewer::SetHintCharset(const Encoding* aEncoding) {
|
|||||||
CallChildren(childFn);
|
CallChildren(childFn);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsDocumentViewer::PausePainting() {
|
|
||||||
CallChildren([](nsDocumentViewer* aChild) { aChild->PausePainting(); });
|
|
||||||
|
|
||||||
if (PresShell* presShell = GetPresShell()) {
|
|
||||||
presShell->PausePainting();
|
|
||||||
}
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsDocumentViewer::ResumePainting() {
|
|
||||||
CallChildren([](nsDocumentViewer* aChild) { aChild->ResumePainting(); });
|
|
||||||
|
|
||||||
if (PresShell* presShell = GetPresShell()) {
|
|
||||||
presShell->ResumePainting();
|
|
||||||
}
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsresult nsDocumentViewer::GetContentSizeInternal(int32_t* aWidth,
|
nsresult nsDocumentViewer::GetContentSizeInternal(int32_t* aWidth,
|
||||||
int32_t* aHeight,
|
int32_t* aHeight,
|
||||||
nscoord aMaxWidth,
|
nscoord aMaxWidth,
|
||||||
|
|||||||
Reference in New Issue
Block a user