Bug 1560237 - Rename ScrollFrameHelper::GetFrameForScrollSnap to ScrollFrameHelper::GetFrameForStyle. r=botond

The function will also be used for `scroll-behavior` property in a later patch
in this commit series, so it needs a more reasonable name.

Differential Revision: https://phabricator.services.mozilla.com/D35738

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Hiroyuki Ikezoe 2019-06-26 20:59:14 +00:00
parent 0670fe9a3f
commit a377b45fe1
2 changed files with 11 additions and 7 deletions

View File

@ -5409,7 +5409,7 @@ nsIFrame* ScrollFrameHelper::GetFrameForDir() const {
return frame;
}
nsIFrame* ScrollFrameHelper::GetFrameForScrollSnap() const {
nsIFrame* ScrollFrameHelper::GetFrameForStyle() const {
nsIFrame* styleFrame = nullptr;
if (mIsRoot) {
if (const Element* rootElement =
@ -5425,7 +5425,7 @@ nsIFrame* ScrollFrameHelper::GetFrameForScrollSnap() const {
bool ScrollFrameHelper::NeedsScrollSnap() const {
if (StaticPrefs::layout_css_scroll_snap_v1_enabled()) {
nsIFrame* scrollSnapFrame = GetFrameForScrollSnap();
nsIFrame* scrollSnapFrame = GetFrameForStyle();
if (!scrollSnapFrame) {
return false;
}
@ -6869,7 +6869,7 @@ static nsMargin ResolveScrollPaddingStyle(
}
nsMargin ScrollFrameHelper::GetScrollPadding() const {
nsIFrame* styleFrame = GetFrameForScrollSnap();
nsIFrame* styleFrame = GetFrameForStyle();
if (!styleFrame) {
return nsMargin();
}
@ -6886,7 +6886,7 @@ layers::ScrollSnapInfo ScrollFrameHelper::ComputeScrollSnapInfo(
ScrollSnapInfo result;
nsIFrame* scrollSnapFrame = GetFrameForScrollSnap();
nsIFrame* scrollSnapFrame = GetFrameForStyle();
if (!scrollSnapFrame) {
return result;
}

View File

@ -347,9 +347,13 @@ class ScrollFrameHelper : public nsIReflowCallback {
private:
nsIFrame* GetFrameForDir() const; // helper for Is{Physical,Bidi}LTR to find
// the frame whose directionality we use
nsIFrame* GetFrameForScrollSnap() const; // helper to find the frame whose
// scroll-snap-type and
// scroll-padding we use
// helper to find the frame that style data for this scrollable frame is
// stored.
//
// NOTE: Use GetFrameForDir() if you want to know `writing-mode` or `dir`
// properties. Use GetScrollStylesFromFrame() if you want to know `overflow`
// and `overflow-behavior` properties.
nsIFrame* GetFrameForStyle() const;
// This is the for the old unspecced scroll snap implementation.
ScrollSnapInfo ComputeOldScrollSnapInfo() const;