Backout changeset 25061ce7382b (bug 770041) because DLBI is being backed out

This commit is contained in:
Ehsan Akhgari 2012-07-03 19:39:44 -04:00
parent 79d797ac12
commit e99c7405d0
3 changed files with 14 additions and 31 deletions

View File

@ -143,8 +143,7 @@ nsPresContext::IsDOMPaintEventPending()
if (!mInvalidateRequests.mRequests.IsEmpty()) {
return true;
}
nsRootPresContext* rpc = GetDisplayRootPresContext();
if (rpc && rpc->mRefreshDriver->ViewManagerFlushIsPending()) {
if (GetRootPresContext()->mRefreshDriver->ViewManagerFlushIsPending()) {
// Since we're promising that there will be a MozAfterPaint event
// fired, we record an empty invalidation in case display list
// invalidation doesn't invalidate anything further.
@ -1198,6 +1197,18 @@ nsPresContext::GetParentPresContext()
return f->PresContext();
}
}
// Not sure if this is always strictly the parent, but it works for GetRootPresContext
// where the current pres context has no frames.
nsIDocument *doc = Document();
if (doc) {
doc = doc->GetParentDocument();
if (doc) {
shell = doc->GetShell();
if (shell) {
return shell->GetPresContext();
}
}
}
return nsnull;
}
@ -1222,33 +1233,6 @@ nsPresContext::GetRootPresContext()
nsPresContext* pc = this;
for (;;) {
nsPresContext* parent = pc->GetParentPresContext();
if (!parent)
break;
pc = parent;
}
return pc->IsRoot() ? static_cast<nsRootPresContext*>(pc) : nsnull;
}
nsRootPresContext*
nsPresContext::GetDisplayRootPresContext()
{
nsPresContext* pc = this;
for (;;) {
nsPresContext* parent = pc->GetParentPresContext();
if (!parent) {
// Not sure if this is always strictly the parent, but it works for GetRootPresContext
// where the current pres context has no frames.
nsIDocument *doc = pc->Document();
if (doc) {
doc = doc->GetParentDocument();
if (doc) {
nsIPresShell* shell = doc->GetShell();
if (shell) {
parent = shell->GetPresContext();
}
}
}
}
if (!parent || parent == pc)
break;
pc = parent;

View File

@ -198,7 +198,6 @@ public:
* be found (e.g. it's detached).
*/
nsRootPresContext* GetRootPresContext();
nsRootPresContext* GetDisplayRootPresContext();
virtual bool IsRoot() { return false; }
nsIDocument* Document() const

View File

@ -4670,7 +4670,7 @@ nsIFrame::IsInvalid()
void
nsIFrame::SchedulePaint(PRUint32 aFlags)
{
nsPresContext *pres = PresContext()->GetDisplayRootPresContext();
nsPresContext *pres = PresContext()->GetRootPresContext();
if (HasAnyStateBits(NS_FRAME_IN_POPUP) || !pres) {
nsIFrame *displayRoot = nsLayoutUtils::GetDisplayRootFrame(this);
NS_ASSERTION(displayRoot, "Need a display root to schedule a paint!");