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:
Daniel Holbert 2021-03-13 06:11:34 +00:00
Родитель 3b10d100f6
Коммит 801cf30e07
4 изменённых файлов: 0 добавлений и 74 удалений

Просмотреть файл

@ -288,18 +288,6 @@ interface nsIContentViewer : nsISupports
void getContentSizeConstrained(in long maxWidth, in long maxHeight,
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] void setHintCharset(in Encoding aEncoding);
};

Просмотреть файл

@ -836,7 +836,6 @@ PresShell::PresShell(Document* aDocument)
mFontSizeInflationForceEnabled(false),
mFontSizeInflationDisabledInMasterProcess(false),
mFontSizeInflationEnabled(false),
mPaintingIsFrozen(false),
mIsNeverPainting(false),
mResolutionUpdated(false),
mResolutionUpdatedByApz(false),
@ -905,13 +904,6 @@ PresShell::~PresShell() {
mLastCallbackEventRequest == nullptr,
"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(),
"Some pres arena objects were not freed");
@ -11379,22 +11371,6 @@ bool PresShell::DetermineFontSizeInflationState() {
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) {
nsIFrame* frame = aView->GetFrame();
if (frame && mPresContext) {

Просмотреть файл

@ -681,20 +681,6 @@ class PresShell final : public nsStubDocumentObserver,
*/
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.
*/
@ -3080,8 +3066,6 @@ class PresShell final : public nsStubDocumentObserver,
bool mFontSizeInflationDisabledInMasterProcess : 1;
bool mFontSizeInflationEnabled : 1;
bool mPaintingIsFrozen : 1;
// 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
// presshell.

Просмотреть файл

@ -2690,28 +2690,6 @@ nsDocumentViewer::SetHintCharset(const Encoding* aEncoding) {
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,
int32_t* aHeight,
nscoord aMaxWidth,