Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLMarqueeElement.h |
| diff --git a/third_party/WebKit/Source/core/html/HTMLMarqueeElement.h b/third_party/WebKit/Source/core/html/HTMLMarqueeElement.h |
| index 45a4af5852fe8621399911db29717db1dfaf0f1a..26d07c4ab5095df759d51771d9e751eb5984d438 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLMarqueeElement.h |
| +++ b/third_party/WebKit/Source/core/html/HTMLMarqueeElement.h |
| @@ -23,7 +23,11 @@ |
| #ifndef HTMLMarqueeElement_h |
| #define HTMLMarqueeElement_h |
| +#include "core/animation/Animation.h" |
| +#include "core/animation/KeyframeEffectModel.h" |
| +#include "core/dom/FrameRequestCallback.h" |
| #include "core/html/HTMLElement.h" |
| +#include "wtf/Noncopyable.h" |
| namespace blink { |
| @@ -31,6 +35,8 @@ class HTMLMarqueeElement final : public HTMLElement { |
| DEFINE_WRAPPERTYPEINFO(); |
| public: |
| + DECLARE_VIRTUAL_TRACE(); |
| + |
| static HTMLMarqueeElement* create(Document&); |
| void attributeChanged(const QualifiedName&, |
| @@ -42,8 +48,103 @@ class HTMLMarqueeElement final : public HTMLElement { |
| bool isHorizontal() const; |
| + int scrollAmount(); |
| + void setScrollAmount(int, ExceptionState&); |
| + |
| + int scrollDelay(); |
| + void setScrollDelay(int, ExceptionState&); |
| + |
| + int loop(); |
| + void setLoop(int, ExceptionState&); |
| + |
| + void start(); |
| + void stop(); |
| + |
| private: |
| explicit HTMLMarqueeElement(Document&); |
| + |
| + class RequestAnimationFrameCallback : public FrameRequestCallback { |
| + WTF_MAKE_NONCOPYABLE(RequestAnimationFrameCallback); |
| + |
| + public: |
| + RequestAnimationFrameCallback(HTMLMarqueeElement* marquee) |
|
haraken
2016/12/05 02:10:53
Add explicit.
adithyas
2016/12/05 16:44:27
Added, here and below.
|
| + : m_marquee(marquee) {} |
| + void handleEvent(double) override; |
| + |
| + DEFINE_INLINE_VIRTUAL_TRACE() { |
| + visitor->trace(m_marquee); |
| + FrameRequestCallback::trace(visitor); |
| + } |
| + |
| + private: |
| + Member<HTMLMarqueeElement> m_marquee; |
| + }; |
| + |
| + class AnimationFinished : public EventListener { |
| + WTF_MAKE_NONCOPYABLE(AnimationFinished); |
| + |
| + public: |
| + AnimationFinished(HTMLMarqueeElement* marquee) |
|
haraken
2016/12/05 02:10:53
Add explicit.
|
| + : EventListener(CPPEventListenerType), m_marquee(marquee) {} |
| + |
| + bool operator==(const EventListener& that) const override { |
| + return this == &that; |
| + } |
| + |
| + void handleEvent(ExecutionContext*, Event*) override; |
| + |
| + DEFINE_INLINE_VIRTUAL_TRACE() { |
| + visitor->trace(m_marquee); |
| + EventListener::trace(visitor); |
| + } |
| + |
| + private: |
| + Member<HTMLMarqueeElement> m_marquee; |
| + }; |
| + |
| + struct AnimationParameters { |
| + AtomicString transformBegin; |
|
jbroman
2016/12/03 23:47:31
These should probably be String rather than Atomic
adithyas
2016/12/05 16:44:27
Fixed.
|
| + AtomicString transformEnd; |
| + double distance; |
| + }; |
| + |
| + struct Metrics { |
| + double contentWidth; |
| + double contentHeight; |
| + double marqueeWidth; |
| + double marqueeHeight; |
| + }; |
| + |
| + void initializeAttribute(const QualifiedName& attr); |
| + void attributeChangedCallback(const QualifiedName& attr, |
| + const String& newValue); |
| + |
| + StringKeyframeEffectModel* createEffectModel(AnimationParameters&); |
| + |
| + void continueAnimation(); |
| + bool shouldContinue(); |
| + |
| + enum Behavior { Scroll, Slide, Alternate }; |
| + Behavior behavior() const; |
| + |
| + enum Direction { Left, Right, Up, Down }; |
| + Direction direction() const; |
| + |
| + bool trueSpeed() const; |
| + |
| + Metrics getMetrics(); |
| + AnimationParameters getAnimationParameters(); |
| + AtomicString createTransform(bool isNegative, double value) const; |
| + |
| + static const int kDefaultScrollAmount = 6; |
| + static const int kDefaultScrollDelayMS = 85; |
| + static const int kMinimumScrollDelayMS = 60; |
| + static const int kDefaultLoopLimit = -1; |
| + |
| + int m_continueCallbackRequestId = 0; |
| + int m_loopCount = 0; |
| + Member<Element> m_mover; |
| + Member<Animation> m_player; |
| }; |
| } // namespace blink |