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 18 matching lines...) Expand all Loading... |
29 | 29 |
30 #ifndef VTTCue_h | 30 #ifndef VTTCue_h |
31 #define VTTCue_h | 31 #define VTTCue_h |
32 | 32 |
33 #include "core/html/track/TextTrackCue.h" | 33 #include "core/html/track/TextTrackCue.h" |
34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 class Document; | 38 class Document; |
| 39 class DoubleOrAutoKeyword; |
39 class ExecutionContext; | 40 class ExecutionContext; |
40 class VTTCue; | 41 class VTTCue; |
41 class VTTScanner; | 42 class VTTScanner; |
42 | 43 |
43 class VTTCueBox final : public HTMLDivElement { | 44 class VTTCueBox final : public HTMLDivElement { |
44 public: | 45 public: |
45 static PassRefPtrWillBeRawPtr<VTTCueBox> create(Document& document, VTTCue*
cue) | 46 static PassRefPtrWillBeRawPtr<VTTCueBox> create(Document& document, VTTCue*
cue) |
46 { | 47 { |
47 return adoptRefWillBeNoop(new VTTCueBox(document, cue)); | 48 return adoptRefWillBeNoop(new VTTCueBox(document, cue)); |
48 } | 49 } |
(...skipping 20 matching lines...) Expand all Loading... |
69 } | 70 } |
70 | 71 |
71 virtual ~VTTCue(); | 72 virtual ~VTTCue(); |
72 | 73 |
73 const String& vertical() const; | 74 const String& vertical() const; |
74 void setVertical(const String&); | 75 void setVertical(const String&); |
75 | 76 |
76 bool snapToLines() const { return m_snapToLines; } | 77 bool snapToLines() const { return m_snapToLines; } |
77 void setSnapToLines(bool); | 78 void setSnapToLines(bool); |
78 | 79 |
79 double line() const { return m_linePosition; } | 80 void line(DoubleOrAutoKeyword&) const; |
80 void setLine(double, ExceptionState&); | 81 void setLine(const DoubleOrAutoKeyword&, ExceptionState&); |
81 | 82 |
82 double position() const { return m_textPosition; } | 83 double position() const { return m_textPosition; } |
83 void setPosition(double, ExceptionState&); | 84 void setPosition(double, ExceptionState&); |
84 | 85 |
85 double size() const { return m_cueSize; } | 86 double size() const { return m_cueSize; } |
86 void setSize(double, ExceptionState&); | 87 void setSize(double, ExceptionState&); |
87 | 88 |
88 const String& align() const; | 89 const String& align() const; |
89 void setAlign(const String&); | 90 void setAlign(const String&); |
90 | 91 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 150 |
150 VTTCueBox& ensureDisplayTree(); | 151 VTTCueBox& ensureDisplayTree(); |
151 PassRefPtrWillBeRawPtr<VTTCueBox> getDisplayTree(const IntSize& videoSize); | 152 PassRefPtrWillBeRawPtr<VTTCueBox> getDisplayTree(const IntSize& videoSize); |
152 | 153 |
153 virtual void cueDidChange() override; | 154 virtual void cueDidChange() override; |
154 | 155 |
155 void createVTTNodeTree(); | 156 void createVTTNodeTree(); |
156 void copyVTTNodeToDOMTree(ContainerNode* vttNode, ContainerNode* root); | 157 void copyVTTNodeToDOMTree(ContainerNode* vttNode, ContainerNode* root); |
157 | 158 |
158 FloatPoint getPositionCoordinates() const; | 159 FloatPoint getPositionCoordinates() const; |
| 160 bool lineIsAuto() const; |
159 | 161 |
160 void calculateDisplayParameters(); | 162 void calculateDisplayParameters(); |
161 | 163 |
162 enum CueSetting { | 164 enum CueSetting { |
163 None, | 165 None, |
164 Vertical, | 166 Vertical, |
165 Line, | 167 Line, |
166 Position, | 168 Position, |
167 Size, | 169 Size, |
168 Align, | 170 Align, |
(...skipping 22 matching lines...) Expand all Loading... |
191 bool m_displayTreeShouldChange : 1; | 193 bool m_displayTreeShouldChange : 1; |
192 bool m_notifyRegion : 1; | 194 bool m_notifyRegion : 1; |
193 }; | 195 }; |
194 | 196 |
195 // VTTCue is currently the only TextTrackCue subclass. | 197 // VTTCue is currently the only TextTrackCue subclass. |
196 DEFINE_TYPE_CASTS(VTTCue, TextTrackCue, cue, true, true); | 198 DEFINE_TYPE_CASTS(VTTCue, TextTrackCue, cue, true, true); |
197 | 199 |
198 } // namespace blink | 200 } // namespace blink |
199 | 201 |
200 #endif // VTTCue_h | 202 #endif // VTTCue_h |
OLD | NEW |