mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
e100f477c7
commit
fdc3d37feb
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user