Land bug 72747 in pieces: make users of nsIScrollable use nsIScrollable::Scrollbar_* instead of NS_STYLE_OVERFLOW_*. b=72747 r+sr=roc

This commit is contained in:
dbaron%dbaron.org 2004-09-03 21:58:39 +00:00
Родитель 913724936a
Коммит 8b8587dcc0
9 изменённых файлов: 41 добавлений и 40 удалений

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

@ -689,9 +689,9 @@ DocumentViewerImpl::InitPresentationStuff(PRBool aDoInitialReflow)
// inside the frameset...
sc->SetCurrentScrollbarPreferences(nsIScrollable::ScrollOrientation_Y,
NS_STYLE_OVERFLOW_HIDDEN);
nsIScrollable::Scrollbar_Never);
sc->SetCurrentScrollbarPreferences(nsIScrollable::ScrollOrientation_X,
NS_STYLE_OVERFLOW_HIDDEN);
nsIScrollable::Scrollbar_Never);
} else {
sc->ResetScrollbarPreferences();
}

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

@ -3654,10 +3654,10 @@ HTMLContentSink::StartLayout()
if (mFrameset) {
scrollableContainer->
SetCurrentScrollbarPreferences(nsIScrollable::ScrollOrientation_Y,
NS_STYLE_OVERFLOW_HIDDEN);
nsIScrollable::Scrollbar_Never);
scrollableContainer->
SetCurrentScrollbarPreferences(nsIScrollable::ScrollOrientation_X,
NS_STYLE_OVERFLOW_HIDDEN);
nsIScrollable::Scrollbar_Never);
} else {
scrollableContainer->ResetScrollbarPreferences();
}

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

@ -268,8 +268,8 @@ nsDocShell::nsDocShell():
mMarginHeight(0),
mItemType(typeContent),
mContentListener(nsnull),
mCurrentScrollbarPref(-1, -1),
mDefaultScrollbarPref(-1, -1),
mCurrentScrollbarPref(Scrollbar_Auto, Scrollbar_Auto),
mDefaultScrollbarPref(Scrollbar_Auto, Scrollbar_Auto),
mEditorData(nsnull),
mParent(nsnull),
mTreeOwner(nsnull),

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

@ -275,15 +275,14 @@ ScrollbarsPropImpl::GetVisible(PRBool *aVisible)
do_QueryInterface(mDOMWindow->GetDocShell());
if (scroller) {
PRInt32 prefValue = aVisible ? NS_STYLE_OVERFLOW_AUTO :
NS_STYLE_OVERFLOW_HIDDEN;
PRInt32 prefValue;
scroller->GetDefaultScrollbarPreferences(
nsIScrollable::ScrollOrientation_Y, &prefValue);
if (prefValue == NS_STYLE_OVERFLOW_HIDDEN) // try the other way
if (prefValue == nsIScrollable::Scrollbar_Never) // try the other way
scroller->GetDefaultScrollbarPreferences(
nsIScrollable::ScrollOrientation_X, &prefValue);
if (prefValue == NS_STYLE_OVERFLOW_HIDDEN)
if (prefValue == nsIScrollable::Scrollbar_Never)
*aVisible = PR_FALSE;
}
}
@ -307,8 +306,8 @@ ScrollbarsPropImpl::SetVisible(PRBool aVisible)
do_QueryInterface(mDOMWindow->GetDocShell());
if (scroller) {
PRInt32 prefValue = aVisible ? NS_STYLE_OVERFLOW_AUTO :
NS_STYLE_OVERFLOW_HIDDEN;
PRInt32 prefValue = aVisible ? nsIScrollable::Scrollbar_Auto :
nsIScrollable::Scrollbar_Never ;
scroller->SetDefaultScrollbarPreferences(
nsIScrollable::ScrollOrientation_Y, prefValue);
scroller->SetDefaultScrollbarPreferences(

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

@ -3854,7 +3854,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
PRInt32 scrolling = -1;
// XXX We should get prefs for X and Y and deal with these independently!
scrollableContainer->GetCurrentScrollbarPreferences(nsIScrollable::ScrollOrientation_Y,&scrolling);
if (NS_STYLE_OVERFLOW_HIDDEN == scrolling) {
if (nsIScrollable::Scrollbar_Never == scrolling) {
isScrollable = PR_FALSE;
}
// XXX NS_STYLE_OVERFLOW_SCROLL should create 'always on' scrollbars

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

@ -689,9 +689,9 @@ DocumentViewerImpl::InitPresentationStuff(PRBool aDoInitialReflow)
// inside the frameset...
sc->SetCurrentScrollbarPreferences(nsIScrollable::ScrollOrientation_Y,
NS_STYLE_OVERFLOW_HIDDEN);
nsIScrollable::Scrollbar_Never);
sc->SetCurrentScrollbarPreferences(nsIScrollable::ScrollOrientation_X,
NS_STYLE_OVERFLOW_HIDDEN);
nsIScrollable::Scrollbar_Never);
} else {
sc->ResetScrollbarPreferences();
}

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

@ -648,23 +648,24 @@ nsSubDocumentFrame::ShowDocShell()
PRInt32 scrolling = GetStyleDisplay()->mOverflow;
PRInt32 scrollX, scrollY;
switch (scrolling) {
case NS_STYLE_OVERFLOW_VISIBLE:
case NS_STYLE_OVERFLOW_AUTO:
scrollX = scrollY = nsIScrollable::Scrollbar_Auto;
break;
case NS_STYLE_OVERFLOW_HIDDEN:
case NS_STYLE_OVERFLOW_CLIP:
scrollX = NS_STYLE_OVERFLOW_HIDDEN;
scrollY = NS_STYLE_OVERFLOW_HIDDEN;
scrollX = scrollY = nsIScrollable::Scrollbar_Never;
break;
case NS_STYLE_OVERFLOW_SCROLL:
scrollX = scrollY = nsIScrollable::Scrollbar_Always;
break;
case NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL:
scrollX = NS_STYLE_OVERFLOW_SCROLL;
scrollY = NS_STYLE_OVERFLOW_HIDDEN;
scrollX = nsIScrollable::Scrollbar_Always;
scrollY = nsIScrollable::Scrollbar_Never;
break;
case NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL:
scrollX = NS_STYLE_OVERFLOW_HIDDEN;
scrollY = NS_STYLE_OVERFLOW_SCROLL;
break;
case NS_STYLE_OVERFLOW_VISIBLE:
scrollX = scrollY = NS_STYLE_OVERFLOW_AUTO;
break;
default:
scrollX = scrollY = scrolling;
scrollX = nsIScrollable::Scrollbar_Never;
scrollY = nsIScrollable::Scrollbar_Always;
break;
}

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

@ -648,23 +648,24 @@ nsSubDocumentFrame::ShowDocShell()
PRInt32 scrolling = GetStyleDisplay()->mOverflow;
PRInt32 scrollX, scrollY;
switch (scrolling) {
case NS_STYLE_OVERFLOW_VISIBLE:
case NS_STYLE_OVERFLOW_AUTO:
scrollX = scrollY = nsIScrollable::Scrollbar_Auto;
break;
case NS_STYLE_OVERFLOW_HIDDEN:
case NS_STYLE_OVERFLOW_CLIP:
scrollX = NS_STYLE_OVERFLOW_HIDDEN;
scrollY = NS_STYLE_OVERFLOW_HIDDEN;
scrollX = scrollY = nsIScrollable::Scrollbar_Never;
break;
case NS_STYLE_OVERFLOW_SCROLL:
scrollX = scrollY = nsIScrollable::Scrollbar_Always;
break;
case NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL:
scrollX = NS_STYLE_OVERFLOW_SCROLL;
scrollY = NS_STYLE_OVERFLOW_HIDDEN;
scrollX = nsIScrollable::Scrollbar_Always;
scrollY = nsIScrollable::Scrollbar_Never;
break;
case NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL:
scrollX = NS_STYLE_OVERFLOW_HIDDEN;
scrollY = NS_STYLE_OVERFLOW_SCROLL;
break;
case NS_STYLE_OVERFLOW_VISIBLE:
scrollX = scrollY = NS_STYLE_OVERFLOW_AUTO;
break;
default:
scrollX = scrollY = scrolling;
scrollX = nsIScrollable::Scrollbar_Never;
scrollY = nsIScrollable::Scrollbar_Always;
break;
}

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

@ -3854,7 +3854,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
PRInt32 scrolling = -1;
// XXX We should get prefs for X and Y and deal with these independently!
scrollableContainer->GetCurrentScrollbarPreferences(nsIScrollable::ScrollOrientation_Y,&scrolling);
if (NS_STYLE_OVERFLOW_HIDDEN == scrolling) {
if (nsIScrollable::Scrollbar_Never == scrolling) {
isScrollable = PR_FALSE;
}
// XXX NS_STYLE_OVERFLOW_SCROLL should create 'always on' scrollbars