From 7f39371579182209a358c147ae25291762d97258 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Mon, 11 Feb 2019 23:44:51 +0000 Subject: [PATCH] Bug 1526749 - Drop Element.scrollByNoFlush. r=kats,mccr8 It's no longer used since bug 970125. Differential Revision: https://phabricator.services.mozilla.com/D19289 --HG-- extra : moz-landing-system : lando --- dom/base/Element.cpp | 20 -------------------- dom/base/Element.h | 5 ----- dom/webidl/Element.webidl | 7 ------- 3 files changed, 32 deletions(-) diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index c64c375df561..cfe738cedcb5 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -913,26 +913,6 @@ void Element::SetScrollLeft(int32_t aScrollLeft) { } } -bool Element::ScrollByNoFlush(int32_t aDx, int32_t aDy) { - nsIScrollableFrame* sf = GetScrollFrame(nullptr, FlushType::None); - if (!sf) { - return false; - } - - AutoWeakFrame weakRef(sf->GetScrolledFrame()); - - CSSIntPoint before = sf->GetScrollPositionCSSPixels(); - sf->ScrollToCSSPixelsApproximate(CSSIntPoint(before.x + aDx, before.y + aDy)); - - // The frame was destroyed, can't keep on scrolling. - if (!weakRef.IsAlive()) { - return false; - } - - CSSIntPoint after = sf->GetScrollPositionCSSPixels(); - return (before != after); -} - void Element::MozScrollSnap() { nsIScrollableFrame* sf = GetScrollFrame(nullptr, FlushType::None); if (sf) { diff --git a/dom/base/Element.h b/dom/base/Element.h index 37e4a029da4f..f39f82d962de 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -1252,11 +1252,6 @@ class Element : public FragmentOrElement { MOZ_CAN_RUN_SCRIPT void ScrollTo(const ScrollToOptions& aOptions); MOZ_CAN_RUN_SCRIPT void ScrollBy(double aXScrollDif, double aYScrollDif); MOZ_CAN_RUN_SCRIPT void ScrollBy(const ScrollToOptions& aOptions); - /* Scrolls without flushing the layout. - * aDx is the x offset, aDy the y offset in CSS pixels. - * Returns true if we actually scrolled. - */ - MOZ_CAN_RUN_SCRIPT bool ScrollByNoFlush(int32_t aDx, int32_t aDy); MOZ_CAN_RUN_SCRIPT int32_t ScrollTop(); MOZ_CAN_RUN_SCRIPT void SetScrollTop(int32_t aScrollTop); MOZ_CAN_RUN_SCRIPT int32_t ScrollLeft(); diff --git a/dom/webidl/Element.webidl b/dom/webidl/Element.webidl index 995075e72ded..e5f6e2b41d2a 100644 --- a/dom/webidl/Element.webidl +++ b/dom/webidl/Element.webidl @@ -147,13 +147,6 @@ interface Element : Node { [CEReactions, Throws] Attr? setAttributeNodeNS(Attr newAttr); - [ChromeOnly] - /** - * Scrolls the element by (dx, dy) CSS pixels without doing any - * layout flushing. - */ - boolean scrollByNoFlush(long dx, long dy); - [ChromeOnly] DOMMatrixReadOnly getTransformToAncestor(Element ancestor); [ChromeOnly]