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

Unified Diff: sky/engine/core/dom/Element.cpp

Issue 774793002: Remove scrollIntoView* API. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Element.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Element.cpp
diff --git a/sky/engine/core/dom/Element.cpp b/sky/engine/core/dom/Element.cpp
index e9200e792c4d377cd65745fd35d668a051d04533..86f1b1e4214ab52aba5f13047c4aa92945853b6b 100644
--- a/sky/engine/core/dom/Element.cpp
+++ b/sky/engine/core/dom/Element.cpp
@@ -273,35 +273,6 @@ void Element::synchronizeAllAttributes() const
synchronizeAttribute(HTMLNames::styleAttr.localName());
}
-void Element::scrollIntoView(bool alignToTop)
-{
- document().updateLayoutIgnorePendingStylesheets();
-
- if (!renderer())
- return;
-
- LayoutRect bounds = boundingBox();
- // Align to the top / bottom and to the closest edge.
- if (alignToTop)
- renderer()->scrollRectToVisible(bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways);
- else
- renderer()->scrollRectToVisible(bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignBottomAlways);
-}
-
-void Element::scrollIntoViewIfNeeded(bool centerIfNeeded)
-{
- document().updateLayoutIgnorePendingStylesheets();
-
- if (!renderer())
- return;
-
- LayoutRect bounds = boundingBox();
- if (centerIfNeeded)
- renderer()->scrollRectToVisible(bounds, ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded);
- else
- renderer()->scrollRectToVisible(bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
-}
-
int Element::offsetLeft()
{
document().updateLayoutIgnorePendingStylesheets();
« no previous file with comments | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698