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

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

Issue 1240433007: Separate VTTCue from VTTCueBox and LayoutVTTCue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: empty constructor, explicit keyword Created 5 years, 5 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
« no previous file with comments | « no previous file | Source/core/html/track/vtt/VTTCue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 29 matching lines...) Expand all
40 class ExecutionContext; 40 class ExecutionContext;
41 class VTTCue; 41 class VTTCue;
42 class VTTScanner; 42 class VTTScanner;
43 43
44 struct VTTDisplayParameters { 44 struct VTTDisplayParameters {
45 VTTDisplayParameters(); 45 VTTDisplayParameters();
46 46
47 FloatPoint position; 47 FloatPoint position;
48 float size; 48 float size;
49 CSSValueID direction; 49 CSSValueID direction;
50 CSSValueID textAlign;
50 CSSValueID writingMode; 51 CSSValueID writingMode;
52 float snapToLinesPosition;
51 }; 53 };
52 54
53 class VTTCueBox final : public HTMLDivElement { 55 class VTTCueBox final : public HTMLDivElement {
54 public: 56 public:
55 static PassRefPtrWillBeRawPtr<VTTCueBox> create(Document& document, VTTCue* cue) 57 static PassRefPtrWillBeRawPtr<VTTCueBox> create(Document& document)
56 { 58 {
57 return adoptRefWillBeNoop(new VTTCueBox(document, cue)); 59 return adoptRefWillBeNoop(new VTTCueBox(document));
58 } 60 }
59 61
60 VTTCue* getCue() const { return m_cue; }
61 void applyCSSProperties(const VTTDisplayParameters&); 62 void applyCSSProperties(const VTTDisplayParameters&);
62 63
63 DECLARE_VIRTUAL_TRACE();
64
65 private: 64 private:
66 VTTCueBox(Document&, VTTCue*); 65 explicit VTTCueBox(Document&);
67 66
68 LayoutObject* createLayoutObject(const ComputedStyle&) override; 67 LayoutObject* createLayoutObject(const ComputedStyle&) override;
69 68
70 RawPtrWillBeMember<VTTCue> m_cue; 69 // The computed line position for snap-to-lines layout, and NaN for
70 // non-snap-to-lines layout where no adjustment should take place.
71 // This is set in applyCSSProperties and propagated to LayoutVTTCue.
72 float m_snapToLinesPosition;
71 }; 73 };
72 74
73 class VTTCue final : public TextTrackCue { 75 class VTTCue final : public TextTrackCue {
74 DEFINE_WRAPPERTYPEINFO(); 76 DEFINE_WRAPPERTYPEINFO();
75 public: 77 public:
76 static PassRefPtrWillBeRawPtr<VTTCue> create(Document& document, double star tTime, double endTime, const String& text) 78 static PassRefPtrWillBeRawPtr<VTTCue> create(Document& document, double star tTime, double endTime, const String& text)
77 { 79 {
78 return adoptRefWillBeNoop(new VTTCue(document, startTime, endTime, text) ); 80 return adoptRefWillBeNoop(new VTTCue(document, startTime, endTime, text) );
79 } 81 }
80 82
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 bool m_snapToLines : 1; 192 bool m_snapToLines : 1;
191 bool m_displayTreeShouldChange : 1; 193 bool m_displayTreeShouldChange : 1;
192 }; 194 };
193 195
194 // VTTCue is currently the only TextTrackCue subclass. 196 // VTTCue is currently the only TextTrackCue subclass.
195 DEFINE_TYPE_CASTS(VTTCue, TextTrackCue, cue, true, true); 197 DEFINE_TYPE_CASTS(VTTCue, TextTrackCue, cue, true, true);
196 198
197 } // namespace blink 199 } // namespace blink
198 200
199 #endif // VTTCue_h 201 #endif // VTTCue_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/track/vtt/VTTCue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698