Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Unified Diff: third_party/WebKit/Source/core/html/HTMLMarqueeElement.h

Issue 2549443003: Move <marquee> implementation to HTMLMarqueeElement.cpp (Closed)
Patch Set: Add asserts for didParse Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..1dc3aa8846ecb17d881ac3e7f4bbee5929d7392a 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,102 @@ class HTMLMarqueeElement final : public HTMLElement {
bool isHorizontal() const;
+ int scrollAmount() const;
+ void setScrollAmount(int, ExceptionState&);
+
+ int scrollDelay() const;
+ void setScrollDelay(int, ExceptionState&);
+
+ int loop() const;
+ void setLoop(int, ExceptionState&);
+
+ void start();
+ void stop();
+
private:
explicit HTMLMarqueeElement(Document&);
+
+ class RequestAnimationFrameCallback final : public FrameRequestCallback {
tkent 2016/12/06 22:43:11 This class definition should be moved to HTMLMarqu
+ WTF_MAKE_NONCOPYABLE(RequestAnimationFrameCallback);
+
+ public:
+ explicit RequestAnimationFrameCallback(HTMLMarqueeElement* marquee)
+ : 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 final : public EventListener {
tkent 2016/12/06 22:43:11 This class definition should be moved to HTMLMarqu
+ WTF_MAKE_NONCOPYABLE(AnimationFinished);
+
+ public:
+ explicit AnimationFinished(HTMLMarqueeElement* marquee)
+ : 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 {
+ String transformBegin;
+ String transformEnd;
+ double distance;
+ };
+
+ struct Metrics {
+ double contentWidth;
+ double contentHeight;
+ double marqueeWidth;
+ double marqueeHeight;
+ };
+
+ void attributeChangedCallback(const QualifiedName& attr,
+ const String& newValue);
+
+ StringKeyframeEffectModel* createEffectModel(AnimationParameters&);
+
+ void continueAnimation();
+ bool shouldContinue();
+
+ enum Behavior { Scroll, Slide, Alternate };
tkent 2016/12/06 22:43:11 Please prepend 'k' to enum members.
+ Behavior behavior() const;
tkent 2016/12/06 22:43:11 This will prevent naming rule conversion coming so
+
+ enum Direction { Left, Right, Up, Down };
tkent 2016/12/06 22:43:11 Please prepend 'k' to enum members.
+ Direction direction() const;
tkent 2016/12/06 22:43:11 This will prevent naming rule conversion coming so
+
+ bool trueSpeed() const;
tkent 2016/12/06 22:43:11 I don't think this function is necessary. It's us
esprehn 2016/12/07 00:10:00 This is web exposed API.
adithyas 2016/12/08 15:12:11 This function is private, the web exposed API is i
+
+ Metrics getMetrics();
+ AnimationParameters getAnimationParameters();
+ AtomicString createTransform(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

Powered by Google App Engine
This is Rietveld 408576698