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

Unified Diff: Source/core/html/track/TextTrackCue.h

Issue 77853002: Move VTT functionality from TextTrackCue.* to VTTCue.* (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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: Source/core/html/track/TextTrackCue.h
diff --git a/Source/core/html/track/TextTrackCue.h b/Source/core/html/track/TextTrackCue.h
index 6230702e1df9816131332dae52c10dc65a903418..e899f34962c7281b28c446490f6408ace458134f 100644
--- a/Source/core/html/track/TextTrackCue.h
+++ b/Source/core/html/track/TextTrackCue.h
@@ -39,32 +39,21 @@
namespace WebCore {
class Document;
-class DocumentFragment;
class ExceptionState;
-class ExecutionContext;
-class TextTrack;
class TextTrackCue;
// ----------------------------
-class TextTrackCueBox FINAL : public HTMLDivElement {
+class TextTrackCueBox : public HTMLDivElement {
public:
- static PassRefPtr<TextTrackCueBox> create(Document& document, TextTrackCue* cue)
+ static const AtomicString& textTrackCueBoxShadowPseudoId()
{
- return adoptRef(new TextTrackCueBox(document, cue));
+ DEFINE_STATIC_LOCAL(const AtomicString, trackDisplayBoxShadowPseudoId, ("-webkit-media-text-track-display", AtomicString::ConstructFromLiteral));
+ return trackDisplayBoxShadowPseudoId;
}
- TextTrackCue* getCue() const;
- void applyCSSProperties(const IntSize& videoSize);
-
- static const AtomicString& textTrackCueBoxShadowPseudoId();
-
protected:
- TextTrackCueBox(Document&, TextTrackCue*);
-
- virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
-
- TextTrackCue* m_cue;
+ TextTrackCueBox(Document&);
};
// ----------------------------
@@ -78,7 +67,7 @@ public:
return cue;
}
- virtual ~TextTrackCue();
+ virtual ~TextTrackCue() { }
TextTrack* track() const;
void setTrack(TextTrack*);
@@ -95,149 +84,46 @@ public:
bool pauseOnExit() const { return m_pauseOnExit; }
void setPauseOnExit(bool);
- const String& vertical() const;
- void setVertical(const String&, ExceptionState&);
-
- bool snapToLines() const { return m_snapToLines; }
- void setSnapToLines(bool);
-
- int line() const { return m_linePosition; }
- void setLine(int, ExceptionState&);
-
- int position() const { return m_textPosition; }
- void setPosition(int, ExceptionState&);
-
- int size() const { return m_cueSize; }
- void setSize(int, ExceptionState&);
-
- const String& align() const;
- void setAlign(const String&, ExceptionState&);
-
- const String& text() const { return m_content; }
- void setText(const String&);
-
- void parseSettings(const String&);
-
int cueIndex();
void invalidateCueIndex();
- PassRefPtr<DocumentFragment> getCueAsHTML();
- PassRefPtr<DocumentFragment> createCueRenderingTree();
-
using EventTarget::dispatchEvent;
virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE;
- const String& regionId() const { return m_regionId; }
- void setRegionId(const String&);
- void notifyRegionWhenRemovingDisplayTree(bool);
-
bool isActive();
void setIsActive(bool);
- bool hasDisplayTree() const { return m_displayTree; }
- PassRefPtr<TextTrackCueBox> getDisplayTree(const IntSize& videoSize);
- PassRefPtr<HTMLDivElement> element() const { return m_cueBackgroundBox; }
-
- void updateDisplayTree(double);
- void removeDisplayTree();
- void markFutureAndPastNodes(ContainerNode*, double, double);
+ virtual bool hasDisplayTree() const { return false; }
acolwell GONE FROM CHROMIUM 2013/11/20 18:38:45 Do we really need to make all these virtual? If we
gasubic 2013/11/21 03:07:38 Eliminated three: hasDisplayTree, getDisplayTree,
+ virtual PassRefPtr<TextTrackCueBox> getDisplayTree(const IntSize& videoSize) { return 0; }
+ virtual PassRefPtr<HTMLDivElement> element() const { return 0; }
- int calculateComputedLinePosition();
+ virtual void updateDisplayTree(double) { }
+ virtual void removeDisplayTree() { }
+ virtual void notifyRegionWhenRemovingDisplayTree(bool) { }
virtual const AtomicString& interfaceName() const OVERRIDE;
- virtual ExecutionContext* executionContext() const OVERRIDE;
-
- std::pair<double, double> getCSSPosition() const;
-
- CSSValueID getCSSAlignment() const;
- int getCSSSize() const;
- CSSValueID getCSSWritingDirection() const;
- CSSValueID getCSSWritingMode() const;
-
- enum WritingDirection {
- Horizontal = 0,
- VerticalGrowingLeft,
- VerticalGrowingRight,
- NumberOfWritingDirections
- };
- WritingDirection getWritingDirection() const { return m_writingDirection; }
-
- enum CueAlignment {
- Start = 0,
- Middle,
- End,
- Left,
- Right,
- NumberOfAlignments
- };
- CueAlignment getAlignment() const { return m_cueAlignment; }
DEFINE_ATTRIBUTE_EVENT_LISTENER(enter);
DEFINE_ATTRIBUTE_EVENT_LISTENER(exit);
-protected:
- TextTrackCue(Document&, double start, double end, const String& content);
-
-private:
- Document& document() const;
-
- PassRefPtr<TextTrackCueBox> displayTreeInternal();
+ virtual bool isVTTCue() const { return false; }
- void createVTTNodeTree();
- void copyVTTNodeToDOMTree(ContainerNode* VTTNode, ContainerNode* root);
-
- std::pair<double, double> getPositionCoordinates() const;
-
- void determineTextDirection();
- void calculateDisplayParameters();
+protected:
+ TextTrackCue(double start, double end);
void cueWillChange();
- void cueDidChange();
-
- enum CueSetting {
- None,
- Vertical,
- Line,
- Position,
- Size,
- Align,
- RegionId
- };
- CueSetting settingName(const String&);
+ virtual void cueDidChange();
+private:
String m_id;
double m_startTime;
double m_endTime;
- String m_content;
- int m_linePosition;
- int m_computedLinePosition;
- int m_textPosition;
- int m_cueSize;
int m_cueIndex;
- WritingDirection m_writingDirection;
-
- CueAlignment m_cueAlignment;
-
- RefPtr<DocumentFragment> m_webVTTNodeTree;
TextTrack* m_track;
bool m_isActive;
bool m_pauseOnExit;
- bool m_snapToLines;
-
- RefPtr<HTMLDivElement> m_cueBackgroundBox;
-
- bool m_displayTreeShouldChange;
- RefPtr<TextTrackCueBox> m_displayTree;
-
- CSSValueID m_displayDirection;
-
- int m_displaySize;
-
- std::pair<float, float> m_displayPosition;
- String m_regionId;
- bool m_notifyRegion;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698