зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
f214b8a95f
Коммит
58b2482f65
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче