зеркало из https://github.com/mozilla/pjs.git
Bug 741683 - move nsAccessNodeScrollTo to nsCoreUtils, r=surkov, m=hub
Bug 741683 - move nsAccessNodeScrollTo to nsCoreUtils, r=surkov, m=hub
This commit is contained in:
Родитель
12aebaafa2
Коммит
ec2abb5885
|
@ -252,31 +252,6 @@ nsAccessNode::IsPrimaryForNode() const
|
|||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void
|
||||
nsAccessNode::ScrollTo(PRUint32 aScrollType)
|
||||
{
|
||||
if (!mDoc)
|
||||
return;
|
||||
|
||||
nsIPresShell* shell = mDoc->PresShell();
|
||||
if (!shell)
|
||||
return;
|
||||
|
||||
nsIFrame *frame = GetFrame();
|
||||
if (!frame)
|
||||
return;
|
||||
|
||||
nsIContent* content = frame->GetContent();
|
||||
if (!content)
|
||||
return;
|
||||
|
||||
nsIPresShell::ScrollAxis vertical, horizontal;
|
||||
nsCoreUtils::ConvertScrollTypeToPercents(aScrollType, &vertical, &horizontal);
|
||||
shell->ScrollContentIntoView(content, vertical, horizontal,
|
||||
nsIPresShell::SCROLL_OVERFLOW_HIDDEN);
|
||||
}
|
||||
|
||||
void
|
||||
nsAccessNode::Language(nsAString& aLanguage)
|
||||
{
|
||||
|
|
|
@ -152,7 +152,6 @@ public:
|
|||
* Interface methods on nsIAccessible shared with ISimpleDOM.
|
||||
*/
|
||||
void Language(nsAString& aLocale);
|
||||
void ScrollTo(PRUint32 aType);
|
||||
|
||||
protected:
|
||||
nsPresContext* GetPresContext();
|
||||
|
|
|
@ -2240,7 +2240,7 @@ nsAccessible::DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex)
|
|||
NS_IMETHODIMP
|
||||
nsAccessible::ScrollTo(PRUint32 aHow)
|
||||
{
|
||||
nsAccessNode::ScrollTo(aHow);
|
||||
nsCoreUtils::ScrollTo(mDoc->PresShell(), mContent, aHow);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -726,6 +726,17 @@ nsCoreUtils::IsColumnHidden(nsITreeColumn *aColumn)
|
|||
nsGkAtoms::_true, eCaseMatters);
|
||||
}
|
||||
|
||||
void
|
||||
nsCoreUtils::ScrollTo(nsIPresShell* aPresShell, nsIContent* aContent,
|
||||
PRUint32 aScrollType)
|
||||
{
|
||||
nsIPresShell::ScrollAxis vertical, horizontal;
|
||||
ConvertScrollTypeToPercents(aScrollType, &vertical, &horizontal);
|
||||
aPresShell->ScrollContentIntoView(aContent, vertical, horizontal,
|
||||
nsIPresShell::SCROLL_OVERFLOW_HIDDEN);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessibleDOMStringList
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -335,6 +335,12 @@ public:
|
|||
*/
|
||||
static bool IsColumnHidden(nsITreeColumn *aColumn);
|
||||
|
||||
/**
|
||||
* Scroll content into view.
|
||||
*/
|
||||
static void ScrollTo(nsIPresShell* aPresShell, nsIContent* aContent,
|
||||
PRUint32 aScrollType);
|
||||
|
||||
/**
|
||||
* Return true if the given node is table header element.
|
||||
*/
|
||||
|
|
|
@ -397,7 +397,7 @@ __try {
|
|||
aScrollTopLeft ? nsIAccessibleScrollType::SCROLL_TYPE_TOP_LEFT :
|
||||
nsIAccessibleScrollType::SCROLL_TYPE_BOTTOM_RIGHT;
|
||||
|
||||
ScrollTo(scrollType);
|
||||
nsCoreUtils::ScrollTo(mDoc->PresShell(), mContent, scrollType);
|
||||
return S_OK;
|
||||
} __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
|
||||
|
||||
|
|
|
@ -1229,7 +1229,7 @@ __try {
|
|||
if (IsDefunct())
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
|
||||
nsAccessNode::ScrollTo(aScrollType);
|
||||
nsCoreUtils::ScrollTo(mDoc->PresShell(), mContent, aScrollType);
|
||||
return S_OK;
|
||||
|
||||
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
|
||||
|
|
Загрузка…
Ссылка в новой задаче