OLD | NEW |
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 int calculateComputedLinePosition(); |
111 | 111 |
112 std::pair<double, double> getCSSPosition() const; | 112 FloatPoint getCSSPosition() const; |
113 | 113 |
114 CSSValueID getCSSAlignment() const; | 114 CSSValueID getCSSAlignment() const; |
115 int getCSSSize() const; | 115 int 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, |
(...skipping 25 matching lines...) Expand all Loading... |
148 Document& document() const; | 148 Document& document() const; |
149 | 149 |
150 VTTCueBox& ensureDisplayTree(); | 150 VTTCueBox& ensureDisplayTree(); |
151 PassRefPtrWillBeRawPtr<VTTCueBox> getDisplayTree(const IntSize& videoSize); | 151 PassRefPtrWillBeRawPtr<VTTCueBox> getDisplayTree(const IntSize& videoSize); |
152 | 152 |
153 virtual void cueDidChange() override; | 153 virtual void cueDidChange() override; |
154 | 154 |
155 void createVTTNodeTree(); | 155 void createVTTNodeTree(); |
156 void copyVTTNodeToDOMTree(ContainerNode* vttNode, ContainerNode* root); | 156 void copyVTTNodeToDOMTree(ContainerNode* vttNode, ContainerNode* root); |
157 | 157 |
158 std::pair<double, double> getPositionCoordinates() const; | 158 FloatPoint getPositionCoordinates() const; |
159 | 159 |
160 void calculateDisplayParameters(); | 160 void calculateDisplayParameters(); |
161 | 161 |
162 enum CueSetting { | 162 enum CueSetting { |
163 None, | 163 None, |
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 int m_linePosition; |
175 int m_computedLinePosition; | 175 int m_computedLinePosition; |
176 int m_textPosition; | 176 int m_textPosition; |
177 int m_cueSize; | 177 int 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 int m_displaySize; |
188 std::pair<float, float> 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 |
OLD | NEW |