Rename Orientation to ScrollDirection to avoid a naming conflict
MozReview-Commit-ID: 1qvFdGvJZDO
--- a/dom/animation/ScrollTimeline.cpp
+++ b/dom/animation/ScrollTimeline.cpp
@@ -36,17 +36,17 @@ JSObject*
ScrollTimeline::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return ScrollTimelineBinding::Wrap(aCx, this, aGivenProto);
}
/* static */ already_AddRefed<ScrollTimeline>
ScrollTimeline::Constructor(const GlobalObject& aGlobal,
Element& scrollElement,
- const Orientation orientation,
+ const ScrollDirection orientation,
const Optional<double>& maxTime,
ErrorResult& aRv)
{
nsIDocument* doc = AnimationUtils::GetCurrentRealmDocument(aGlobal.Context());
if (!doc) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
@@ -128,17 +128,17 @@ ScrollTimeline::CalculateTimeRange()
mTimeRange = StickyTimeDuration::Max(endTime, mTimeRange);
}
}
void
ScrollTimeline::QueryScrollValues()
{
if (mElement) {
- if (mOrientation == Orientation::Horizontal) {
+ if (mOrientation == ScrollDirection::Horizontal) {
mCurrentScroll = mElement->ScrollLeft();
mMinScroll = mElement->ScrollLeftMin();
mMaxScroll = mElement->ScrollLeftMax();
} else {
mCurrentScroll = mElement->ScrollTop();
mMinScroll = mElement->ScrollTopMin();
mMaxScroll = mElement->ScrollTopMax();
}
--- a/dom/animation/ScrollTimeline.h
+++ b/dom/animation/ScrollTimeline.h
@@ -36,17 +36,17 @@ private:
};
class ScrollTimeline final
: public AnimationTimeline
{
public:
ScrollTimeline(nsIDocument* aDocument,
Element* aTarget,
- Orientation aOrientation,
+ ScrollDirection aOrientation,
const Optional<double>& maxTime)
: AnimationTimeline(aDocument->GetParentObject())
, mDocument(aDocument)
, mOrientation(aOrientation)
, mElement(aTarget)
, mCurrentScroll(0)
, mMinScroll(0)
, mMaxScroll(0)
@@ -73,17 +73,17 @@ public:
AnimationTimeline)
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
static already_AddRefed<ScrollTimeline>
Constructor(const GlobalObject& aGlobal,
Element& scrollElement,
- const Orientation orientation,
+ const ScrollDirection orientation,
const Optional<double>& maxTime,
ErrorResult& aRv);
virtual Nullable<TimeDuration> GetCurrentTime() const override;
bool TracksWallclockTime() const override
{
return true;
@@ -103,17 +103,17 @@ public:
protected:
nsIScrollableFrame* GetScrollFrame() const;
void CalculateTimeRange();
nsCOMPtr<nsIDocument> mDocument;
- Orientation mOrientation;
+ ScrollDirection mOrientation;
double mMaxTime;
ScrollPositionListener* mScrollPositionListener;
RefPtr<Element> mElement;
StickyTimeDuration mTimeRange;
double mCurrentScroll, mMinScroll, mMaxScroll;
};
} // namespace dom
--- a/dom/webidl/ScrollTimeline.webidl
+++ b/dom/webidl/ScrollTimeline.webidl
@@ -5,16 +5,16 @@
*
* The origin of this IDL file is
* https://w3c.github.io/web-animations/#documenttimeline
*
* Copyright © 2016 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
-enum Orientation { "vertical", "horizontal" };
+enum ScrollDirection { "vertical", "horizontal" };
[Func="nsDocument::IsWebAnimationsEnabled",
Constructor (Element scrollSource,
- Orientation orientation,
+ ScrollDirection direction,
optional double maxTime)]
interface ScrollTimeline : AnimationTimeline {
};