Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Unified Diff: Source/core/dom/Element.cpp

Issue 134443003: Implement CSSOM Smooth Scroll API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/frame/FrameView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 41a571aff9a0c9bec59490b80bc32245ec66f04d..3ae6cedca335918ec21e4b3a6bce43b3fa931ad4 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -682,13 +682,13 @@ int Element::scrollTop()
return 0;
}
-void Element::setScrollLeft(int newLeft)
+void Element::setScrollLeftInternal(int newLeft, ScrollBehavior scrollBehavior)
{
document().updateLayoutIgnorePendingStylesheets();
if (document().documentElement() != this) {
if (RenderBox* rend = renderBox())
- rend->setScrollLeft(roundf(newLeft * rend->style()->effectiveZoom()));
+ rend->setScrollLeft(roundf(newLeft * rend->style()->effectiveZoom()), scrollBehavior);
return;
}
@@ -703,7 +703,7 @@ void Element::setScrollLeft(int newLeft)
if (!view)
return;
- view->setScrollPosition(IntPoint(roundf(newLeft * frame->pageZoomFactor()), view->scrollY()));
+ view->setScrollPosition(IntPoint(roundf(newLeft * frame->pageZoomFactor()), view->scrollY()), scrollBehavior);
}
}
@@ -724,17 +724,16 @@ void Element::setScrollLeft(const Dictionary& scrollOptionsHorizontal, Exception
return;
}
- // FIXME: Use scrollBehavior to decide whether to scroll smoothly or instantly.
- setScrollLeft(position);
+ setScrollLeft(position, scrollBehavior);
}
-void Element::setScrollTop(int newTop)
+void Element::setScrollTopInternal(int newTop, ScrollBehavior scrollBehavior)
{
document().updateLayoutIgnorePendingStylesheets();
if (document().documentElement() != this) {
if (RenderBox* rend = renderBox())
- rend->setScrollTop(roundf(newTop * rend->style()->effectiveZoom()));
+ rend->setScrollTop(roundf(newTop * rend->style()->effectiveZoom()), scrollBehavior);
return;
}
@@ -749,7 +748,7 @@ void Element::setScrollTop(int newTop)
if (!view)
return;
- view->setScrollPosition(IntPoint(view->scrollX(), roundf(newTop * frame->pageZoomFactor())));
+ view->setScrollPosition(IntPoint(view->scrollX(), roundf(newTop * frame->pageZoomFactor())), scrollBehavior);
}
}
@@ -770,8 +769,7 @@ void Element::setScrollTop(const Dictionary& scrollOptionsVertical, ExceptionSta
return;
}
- // FIXME: Use scrollBehavior to decide whether to scroll smoothly or instantly.
- setScrollTop(position);
+ setScrollTop(position, scrollBehavior);
}
int Element::scrollWidth()
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/frame/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698