Bug 568612 - Remove GetURIGeckoFlags/SetURIGeckoFlags because they haven't been used since places landed. r=roc

--HG--
extra : rebase_source : 537a482cc6a4da3e39e55cc6aaa0df474308125b
This commit is contained in:
Doug Turner 2010-05-30 09:38:42 -07:00
parent 4afb409bce
commit 0e6c63e08e
2 changed files with 2 additions and 74 deletions

View File

@ -566,13 +566,7 @@ nsHTMLScrollFrame::GuessVScrollbarNeeded(const ScrollReflowState& aState)
return PR_FALSE;
if (mInner.mIsRoot) {
// For viewports, try getting a hint from global history
// as to whether we had a vertical scrollbar last time.
PRBool hint;
nsresult rv = mInner.GetVScrollbarHintFromGlobalHistory(&hint);
if (NS_SUCCEEDED(rv))
return hint;
// No hint. Assume that there will be a scrollbar; it seems to me
// Assume that there will be a scrollbar; it seems to me
// that 'most pages' do have a scrollbar, and anyway, it's cheaper
// to do an extra reflow for the pages that *don't* need a
// scrollbar (because on average they will have less content).
@ -866,11 +860,6 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
if (!InInitialReflow() && !mInner.mHadNonInitialReflow) {
mInner.mHadNonInitialReflow = PR_TRUE;
if (mInner.mIsRoot) {
// For viewports, record whether we needed a vertical scrollbar
// after the first non-initial reflow.
mInner.SaveVScrollbarStateToGlobalHistory();
}
}
if (mInner.mIsRoot && oldScrolledAreaBounds != newScrolledAreaBounds) {
@ -1297,8 +1286,6 @@ nsGfxScrollFrameInner::nsGfxScrollFrameInner(nsContainerFrame* aOuter,
mIsXUL(aIsXUL),
mSupppressScrollbarUpdate(PR_FALSE),
mSkippedScrollbarLayout(PR_FALSE),
mDidLoadHistoryVScrollbarHint(PR_FALSE),
mHistoryVScrollbarHint(PR_FALSE),
mHadNonInitialReflow(PR_FALSE),
mHorizontalOverflow(PR_FALSE),
mVerticalOverflow(PR_FALSE),
@ -3323,59 +3310,6 @@ static nsIURI* GetDocURI(nsIFrame* aFrame)
return doc->GetDocumentURI();
}
void
nsGfxScrollFrameInner::SaveVScrollbarStateToGlobalHistory()
{
NS_ASSERTION(mIsRoot, "Only use this on viewports");
// If the hint is the same as the one we loaded, don't bother
// saving it
if (mDidLoadHistoryVScrollbarHint &&
(mHistoryVScrollbarHint == mHasVerticalScrollbar))
return;
nsIURI* uri = GetDocURI(mOuter);
if (!uri)
return;
nsCOMPtr<nsIGlobalHistory3> history(do_GetService(NS_GLOBALHISTORY2_CONTRACTID));
if (!history)
return;
PRUint32 flags = 0;
if (mHasVerticalScrollbar) {
flags |= NS_GECKO_FLAG_NEEDS_VERTICAL_SCROLLBAR;
}
history->SetURIGeckoFlags(uri, flags);
// if it fails, we don't care
}
nsresult
nsGfxScrollFrameInner::GetVScrollbarHintFromGlobalHistory(PRBool* aVScrollbarNeeded)
{
NS_ASSERTION(mIsRoot, "Only use this on viewports");
NS_ASSERTION(!mDidLoadHistoryVScrollbarHint,
"Should only load a hint once, it can be expensive");
nsIURI* uri = GetDocURI(mOuter);
if (!uri)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIGlobalHistory3> history(do_GetService(NS_GLOBALHISTORY2_CONTRACTID));
if (!history)
return NS_ERROR_FAILURE;
PRUint32 flags;
nsresult rv = history->GetURIGeckoFlags(uri, &flags);
if (NS_FAILED(rv))
return rv;
*aVScrollbarNeeded = (flags & NS_GECKO_FLAG_NEEDS_VERTICAL_SCROLLBAR) != 0;
mDidLoadHistoryVScrollbarHint = PR_TRUE;
mHistoryVScrollbarHint = *aVScrollbarNeeded;
return NS_OK;
}
nsPresState*
nsGfxScrollFrameInner::SaveState(nsIStatefulFrame::SpecialStateID aStateID)
{

View File

@ -160,8 +160,6 @@ public:
nsPresState* SaveState(nsIStatefulFrame::SpecialStateID aStateID);
void RestoreState(nsPresState* aState);
void SaveVScrollbarStateToGlobalHistory();
nsresult GetVScrollbarHintFromGlobalHistory(PRBool* aVScrollbarNeeded);
nsIFrame* GetScrolledFrame() const { return mScrolledFrame; }
nsIBox* GetScrollbarBox(PRBool aVertical) const {
@ -272,11 +270,7 @@ public:
// it might not strictly be needed next time mSupppressScrollbarUpdate is
// false.
PRPackedBool mSkippedScrollbarLayout:1;
// Did we load a hint from global history
// about whether a vertical scrollbar is required?
PRPackedBool mDidLoadHistoryVScrollbarHint:1;
// The value of the hint loaded
PRPackedBool mHistoryVScrollbarHint:1;
PRPackedBool mHadNonInitialReflow:1;
// State used only by PostScrollEvents so we know
// which overflow states have changed.