OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 14 matching lines...) Expand all Loading... |
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #ifndef TextTrackCue_h | 32 #ifndef TextTrackCue_h |
33 #define TextTrackCue_h | 33 #define TextTrackCue_h |
34 | 34 |
35 #include "bindings/v8/ScriptWrappable.h" | |
36 #include "core/events/EventTarget.h" | 35 #include "core/events/EventTarget.h" |
37 #include "core/html/HTMLDivElement.h" | 36 #include "core/html/HTMLDivElement.h" |
38 #include "core/frame/UseCounter.h" | |
39 #include "wtf/RefCounted.h" | 37 #include "wtf/RefCounted.h" |
40 | 38 |
41 namespace WebCore { | 39 namespace WebCore { |
42 | 40 |
43 class Document; | 41 class Document; |
44 class DocumentFragment; | 42 class DocumentFragment; |
45 class ExceptionState; | 43 class ExceptionState; |
46 class ExecutionContext; | 44 class ExecutionContext; |
47 class TextTrack; | 45 class TextTrack; |
48 class TextTrackCue; | 46 class TextTrackCue; |
(...skipping 15 matching lines...) Expand all Loading... |
64 protected: | 62 protected: |
65 TextTrackCueBox(Document&, TextTrackCue*); | 63 TextTrackCueBox(Document&, TextTrackCue*); |
66 | 64 |
67 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; | 65 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; |
68 | 66 |
69 TextTrackCue* m_cue; | 67 TextTrackCue* m_cue; |
70 }; | 68 }; |
71 | 69 |
72 // ---------------------------- | 70 // ---------------------------- |
73 | 71 |
74 class TextTrackCue : public RefCounted<TextTrackCue>, public ScriptWrappable, pu
blic EventTargetWithInlineData { | 72 class TextTrackCue : public RefCounted<TextTrackCue>, public EventTargetWithInli
neData { |
75 REFCOUNTED_EVENT_TARGET(TextTrackCue); | 73 REFCOUNTED_EVENT_TARGET(TextTrackCue); |
76 public: | 74 public: |
77 static PassRefPtr<TextTrackCue> create(Document& document, double start, dou
ble end, const String& content) | |
78 { | |
79 UseCounter::count(document, UseCounter::TextTrackCueConstructor); | |
80 return adoptRef(new TextTrackCue(document, start, end, content)); | |
81 } | |
82 | |
83 static const AtomicString& cueShadowPseudoId() | 75 static const AtomicString& cueShadowPseudoId() |
84 { | 76 { |
85 DEFINE_STATIC_LOCAL(const AtomicString, cue, ("cue", AtomicString::Const
ructFromLiteral)); | 77 DEFINE_STATIC_LOCAL(const AtomicString, cue, ("cue", AtomicString::Const
ructFromLiteral)); |
86 return cue; | 78 return cue; |
87 } | 79 } |
88 | 80 |
89 virtual ~TextTrackCue(); | 81 virtual ~TextTrackCue(); |
90 | 82 |
91 TextTrack* track() const; | 83 TextTrack* track() const; |
92 void setTrack(TextTrack*); | 84 void setTrack(TextTrack*); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 175 |
184 bool operator==(const TextTrackCue&) const; | 176 bool operator==(const TextTrackCue&) const; |
185 bool operator!=(const TextTrackCue& cue) const | 177 bool operator!=(const TextTrackCue& cue) const |
186 { | 178 { |
187 return !(*this == cue); | 179 return !(*this == cue); |
188 } | 180 } |
189 | 181 |
190 DEFINE_ATTRIBUTE_EVENT_LISTENER(enter); | 182 DEFINE_ATTRIBUTE_EVENT_LISTENER(enter); |
191 DEFINE_ATTRIBUTE_EVENT_LISTENER(exit); | 183 DEFINE_ATTRIBUTE_EVENT_LISTENER(exit); |
192 | 184 |
193 private: | 185 protected: |
194 TextTrackCue(Document&, double start, double end, const String& content); | 186 TextTrackCue(Document&, double start, double end, const String& content); |
195 | 187 |
| 188 private: |
196 Document& document() const; | 189 Document& document() const; |
197 | 190 |
198 PassRefPtr<TextTrackCueBox> displayTreeInternal(); | 191 PassRefPtr<TextTrackCueBox> displayTreeInternal(); |
199 | 192 |
200 void createWebVTTNodeTree(); | 193 void createWebVTTNodeTree(); |
201 void copyWebVTTNodeToDOMTree(ContainerNode* WebVTTNode, ContainerNode* root)
; | 194 void copyWebVTTNodeToDOMTree(ContainerNode* WebVTTNode, ContainerNode* root)
; |
202 | 195 |
203 std::pair<double, double> getPositionCoordinates() const; | 196 std::pair<double, double> getPositionCoordinates() const; |
204 void parseSettings(const String&); | 197 void parseSettings(const String&); |
205 | 198 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 int m_displaySize; | 245 int m_displaySize; |
253 | 246 |
254 std::pair<float, float> m_displayPosition; | 247 std::pair<float, float> m_displayPosition; |
255 String m_regionId; | 248 String m_regionId; |
256 bool m_notifyRegion; | 249 bool m_notifyRegion; |
257 }; | 250 }; |
258 | 251 |
259 } // namespace WebCore | 252 } // namespace WebCore |
260 | 253 |
261 #endif | 254 #endif |
OLD | NEW |