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

Side by Side Diff: Source/core/html/track/vtt/VTTCue.h

Issue 857823003: VTTCue: Make position/line/size double attributes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Nits. Created 5 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Opera Software ASA. All rights reserved. 2 * Copyright (c) 2013, Opera Software ASA. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 virtual ~VTTCue(); 71 virtual ~VTTCue();
72 72
73 const String& vertical() const; 73 const String& vertical() const;
74 void setVertical(const String&); 74 void setVertical(const String&);
75 75
76 bool snapToLines() const { return m_snapToLines; } 76 bool snapToLines() const { return m_snapToLines; }
77 void setSnapToLines(bool); 77 void setSnapToLines(bool);
78 78
79 int line() const { return m_linePosition; } 79 double line() const { return m_linePosition; }
80 void setLine(int, ExceptionState&); 80 void setLine(double, ExceptionState&);
81 81
82 int position() const { return m_textPosition; } 82 double position() const { return m_textPosition; }
83 void setPosition(int, ExceptionState&); 83 void setPosition(double, ExceptionState&);
84 84
85 int size() const { return m_cueSize; } 85 double size() const { return m_cueSize; }
86 void setSize(int, ExceptionState&); 86 void setSize(double, ExceptionState&);
87 87
88 const String& align() const; 88 const String& align() const;
89 void setAlign(const String&); 89 void setAlign(const String&);
90 90
91 const String& text() const { return m_text; } 91 const String& text() const { return m_text; }
92 void setText(const String&); 92 void setText(const String&);
93 93
94 void parseSettings(const String&); 94 void parseSettings(const String&);
95 95
96 PassRefPtrWillBeRawPtr<DocumentFragment> getCueAsHTML(); 96 PassRefPtrWillBeRawPtr<DocumentFragment> getCueAsHTML();
97 PassRefPtrWillBeRawPtr<DocumentFragment> createCueRenderingTree(); 97 PassRefPtrWillBeRawPtr<DocumentFragment> createCueRenderingTree();
98 98
99 const String& regionId() const { return m_regionId; } 99 const String& regionId() const { return m_regionId; }
100 void setRegionId(const String&); 100 void setRegionId(const String&);
101 101
102 virtual void updateDisplay(const IntSize& videoSize, HTMLDivElement& contain er) override; 102 virtual void updateDisplay(const IntSize& videoSize, HTMLDivElement& contain er) override;
103 103
104 virtual void updateDisplayTree(double movieTime) override; 104 virtual void updateDisplayTree(double movieTime) override;
105 virtual void removeDisplayTree() override; 105 virtual void removeDisplayTree() override;
106 virtual void notifyRegionWhenRemovingDisplayTree(bool notifyRegion) override ; 106 virtual void notifyRegionWhenRemovingDisplayTree(bool notifyRegion) override ;
107 107
108 void markFutureAndPastNodes(ContainerNode*, double previousTimestamp, double movieTime); 108 void markFutureAndPastNodes(ContainerNode*, double previousTimestamp, double movieTime);
109 109
110 int calculateComputedLinePosition(); 110 float calculateComputedLinePosition();
111 111
112 FloatPoint getCSSPosition() const; 112 FloatPoint getCSSPosition() const;
113 113
114 CSSValueID getCSSAlignment() const; 114 CSSValueID getCSSAlignment() const;
115 int getCSSSize() const; 115 float getCSSSize() const;
116 CSSValueID getCSSWritingDirection() const; 116 CSSValueID getCSSWritingDirection() const;
117 CSSValueID getCSSWritingMode() const; 117 CSSValueID getCSSWritingMode() const;
118 118
119 enum WritingDirection { 119 enum WritingDirection {
120 Horizontal = 0, 120 Horizontal = 0,
121 VerticalGrowingLeft, 121 VerticalGrowingLeft,
122 VerticalGrowingRight, 122 VerticalGrowingRight,
123 NumberOfWritingDirections 123 NumberOfWritingDirections
124 }; 124 };
125 WritingDirection getWritingDirection() const { return m_writingDirection; } 125 WritingDirection getWritingDirection() const { return m_writingDirection; }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 Vertical, 164 Vertical,
165 Line, 165 Line,
166 Position, 166 Position,
167 Size, 167 Size,
168 Align, 168 Align,
169 RegionId 169 RegionId
170 }; 170 };
171 CueSetting settingName(VTTScanner&); 171 CueSetting settingName(VTTScanner&);
172 172
173 String m_text; 173 String m_text;
174 int m_linePosition; 174 float m_linePosition;
175 int m_computedLinePosition; 175 float m_computedLinePosition;
176 int m_textPosition; 176 float m_textPosition;
177 int m_cueSize; 177 float m_cueSize;
178 WritingDirection m_writingDirection; 178 WritingDirection m_writingDirection;
179 CueAlignment m_cueAlignment; 179 CueAlignment m_cueAlignment;
180 String m_regionId; 180 String m_regionId;
181 181
182 RefPtrWillBeMember<DocumentFragment> m_vttNodeTree; 182 RefPtrWillBeMember<DocumentFragment> m_vttNodeTree;
183 RefPtrWillBeMember<HTMLDivElement> m_cueBackgroundBox; 183 RefPtrWillBeMember<HTMLDivElement> m_cueBackgroundBox;
184 RefPtrWillBeMember<VTTCueBox> m_displayTree; 184 RefPtrWillBeMember<VTTCueBox> m_displayTree;
185 185
186 CSSValueID m_displayDirection; 186 CSSValueID m_displayDirection;
187 int m_displaySize; 187 float m_displaySize;
188 FloatPoint m_displayPosition; 188 FloatPoint m_displayPosition;
189 189
190 bool m_snapToLines : 1; 190 bool m_snapToLines : 1;
191 bool m_displayTreeShouldChange : 1; 191 bool m_displayTreeShouldChange : 1;
192 bool m_notifyRegion : 1; 192 bool m_notifyRegion : 1;
193 }; 193 };
194 194
195 // VTTCue is currently the only TextTrackCue subclass. 195 // VTTCue is currently the only TextTrackCue subclass.
196 DEFINE_TYPE_CASTS(VTTCue, TextTrackCue, cue, true, true); 196 DEFINE_TYPE_CASTS(VTTCue, TextTrackCue, cue, true, true);
197 197
198 } // namespace blink 198 } // namespace blink
199 199
200 #endif // VTTCue_h 200 #endif // VTTCue_h
OLDNEW
« no previous file with comments | « LayoutTests/media/track/vtt-cue-float-precision.html ('k') | Source/core/html/track/vtt/VTTCue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698