From 42c1cf9ea34c66fa085e15b49dba67cf06915153 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 25 May 2017 13:39:44 -0400 Subject: [PATCH] Bug 1364360 part 2. Make Element::GetScrollFrame take a flush type, not a "should I flush?" boolean. r=ehsan --- dom/base/Element.cpp | 11 +++++------ dom/base/Element.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 35b64a8f9f2f..8d60587347d1 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -663,7 +663,7 @@ Element::GetStyledFrame() } nsIScrollableFrame* -Element::GetScrollFrame(nsIFrame **aStyledFrame, bool aFlushLayout) +Element::GetScrollFrame(nsIFrame **aStyledFrame, FlushType aFlushType) { // it isn't clear what to return for SVG nodes, so just return nothing if (IsSVGElement()) { @@ -673,9 +673,8 @@ Element::GetScrollFrame(nsIFrame **aStyledFrame, bool aFlushLayout) return nullptr; } - // Inline version of GetStyledFrame to use FlushType::None if needed. - nsIFrame* frame = - GetPrimaryFrame(aFlushLayout ? FlushType::Layout : FlushType::None); + // Inline version of GetStyledFrame to use the given FlushType. + nsIFrame* frame = GetPrimaryFrame(aFlushType); if (frame) { frame = nsLayoutUtils::GetStyleFrame(frame); } @@ -895,7 +894,7 @@ Element::SetScrollLeft(int32_t aScrollLeft) bool Element::ScrollByNoFlush(int32_t aDx, int32_t aDy) { - nsIScrollableFrame* sf = GetScrollFrame(nullptr, false); + nsIScrollableFrame* sf = GetScrollFrame(nullptr, FlushType::None); if (!sf) { return false; } @@ -917,7 +916,7 @@ Element::ScrollByNoFlush(int32_t aDx, int32_t aDy) void Element::MozScrollSnap() { - nsIScrollableFrame* sf = GetScrollFrame(nullptr, false); + nsIScrollableFrame* sf = GetScrollFrame(nullptr, FlushType::None); if (sf) { sf->ScrollSnap(); } diff --git a/dom/base/Element.h b/dom/base/Element.h index 66cca1b8bd13..3a2e54d76556 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -1593,7 +1593,7 @@ private: nsRect GetClientAreaRect(); nsIScrollableFrame* GetScrollFrame(nsIFrame **aStyledFrame = nullptr, - bool aFlushLayout = true); + FlushType aFlushType = FlushType::Layout); // Data members EventStates mState;