зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1010538 - Part 7 - Add support to Element.ScrollLeft and Element.ScrollTop. r=mstange
- Setting Element.ScrollLeft or Element.ScrollRight will now scroll smoothly if the scroll-behavior CSS property is set to "smooth".
This commit is contained in:
Родитель
05cb19a985
Коммит
a1a1d61fae
|
@ -747,8 +747,13 @@ public:
|
|||
{
|
||||
nsIScrollableFrame* sf = GetScrollFrame();
|
||||
if (sf) {
|
||||
nsIScrollableFrame::ScrollMode scrollMode = nsIScrollableFrame::INSTANT;
|
||||
if (sf->GetScrollbarStyles().mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) {
|
||||
scrollMode = nsIScrollableFrame::SMOOTH_MSD;
|
||||
}
|
||||
sf->ScrollToCSSPixels(CSSIntPoint(sf->GetScrollPositionCSSPixels().x,
|
||||
aScrollTop));
|
||||
aScrollTop),
|
||||
scrollMode);
|
||||
}
|
||||
}
|
||||
int32_t ScrollLeft()
|
||||
|
@ -760,8 +765,14 @@ public:
|
|||
{
|
||||
nsIScrollableFrame* sf = GetScrollFrame();
|
||||
if (sf) {
|
||||
nsIScrollableFrame::ScrollMode scrollMode = nsIScrollableFrame::INSTANT;
|
||||
if (sf->GetScrollbarStyles().mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) {
|
||||
scrollMode = nsIScrollableFrame::SMOOTH_MSD;
|
||||
}
|
||||
|
||||
sf->ScrollToCSSPixels(CSSIntPoint(aScrollLeft,
|
||||
sf->GetScrollPositionCSSPixels().y));
|
||||
sf->GetScrollPositionCSSPixels().y),
|
||||
scrollMode);
|
||||
}
|
||||
}
|
||||
/* Scrolls without flushing the layout.
|
||||
|
|
Загрузка…
Ссылка в новой задаче