Changeset 107632 in webkit
- Timestamp:
- Feb 13, 2012 4:06:25 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r107630 r107632 1 2012-02-13 Arun Patole <bmf834@motorola.com> 2 3 Chrome crashes when attempting to add cue to track element 4 https://bugs.webkit.org/show_bug.cgi?id=77951 5 6 Reviewed by Eric Carlson. 7 8 Updated add-remove-cue.html to handle adding a new cue to the text track created with addTextTrack. 9 * media/track/track-add-remove-cue-expected.txt: 10 * media/track/track-add-remove-cue.html: 11 1 12 2012-02-13 Kenichi Ishibashi <bashi@chromium.org> 2 13 -
trunk/LayoutTests/media/track/track-add-remove-cue-expected.txt
r101185 r107632 31 31 EXPECTED (cues[3].startTime == '61') OK 32 32 33 *** create a new cue and add it to a track created with video.addTextTrack, make sure it is inserted correctly. 34 RUN(newTrack = video.addTextTrack("subtitles", "French subtitles", "fr")) 35 RUN(newTrack.addCue(new TextTrackCue("test", 0.0, 1.0, "Test!"))) 36 RUN(newCue = newTrack.cues[0]) 37 EXPECTED (newCue.track == '[object TextTrack]') OK 38 EXPECTED (newCue.id == 'test') OK 39 EXPECTED (newCue.startTime == '0') OK 40 EXPECTED (newCue.endTime == '1') OK 41 EXPECTED (newCue.pauseOnExit == 'false') OK 42 EXPECTED (newCue.direction == 'horizontal') OK 43 EXPECTED (newCue.snapToLines == 'true') OK 44 EXPECTED (newCue.linePosition == '-1') OK 45 EXPECTED (newCue.textPosition == '50') OK 46 EXPECTED (newCue.size == '100') OK 47 EXPECTED (newCue.alignment == 'middle') OK 48 33 49 *** Remove a cue created with addCue(). 34 50 RUN(testTrack.track.removeCue(textCue)) -
trunk/LayoutTests/media/track/track-add-remove-cue.html
r102212 r107632 44 44 testExpected("cues[3].startTime", 61); 45 45 46 consoleWrite("<br>*** create a new cue and add it to a track created with video.addTextTrack, make sure it is inserted correctly."); 47 findMediaElement(); 48 run('newTrack = video.addTextTrack("subtitles", "French subtitles", "fr")'); 49 newTrack.mode = 2; 50 run('newTrack.addCue(new TextTrackCue("test", 0.0, 1.0, "Test!"))'); 51 run('newCue = newTrack.cues[0]'); 52 testExpected("newCue.track", newTrack); 53 testExpected("newCue.id", "test"); 54 testExpected("newCue.startTime", 0.0); 55 testExpected("newCue.endTime", 1.0); 56 testExpected("newCue.pauseOnExit", false); 57 testExpected("newCue.direction", "horizontal"); 58 testExpected("newCue.snapToLines", true); 59 testExpected("newCue.linePosition", -1); 60 testExpected("newCue.textPosition", 50); 61 testExpected("newCue.size", 100); 62 testExpected("newCue.alignment", "middle"); 63 46 64 consoleWrite("<br>*** Remove a cue created with addCue()."); 47 65 run("testTrack.track.removeCue(textCue)"); -
trunk/Source/WebCore/ChangeLog
r107629 r107632 1 2012-02-13 Arun Patole <bmf834@motorola.com> 2 3 Chrome crashes when attempting to add cue to track element 4 https://bugs.webkit.org/show_bug.cgi?id=77951 5 6 Reviewed by Eric Carlson. 7 8 Allocate text track's text track list of cues before using it. 9 10 * html/TextTrack.cpp: 11 (WebCore::TextTrack::cues): 12 (WebCore::TextTrack::addCue): 13 (WebCore::TextTrack::removeCue): return if text track list of cues is not allocated. 14 (WebCore::TextTrack::ensureTextTrackCueList):Added. 15 * html/TextTrack.h: 16 (TextTrack): 17 1 18 2012-02-13 Andy Estes <aestes@apple.com> 2 19 -
trunk/Source/WebCore/html/TextTrack.cpp
r104327 r107632 156 156 TextTrackCueList* TextTrack::cues() 157 157 { 158 if (!m_cues)159 m_cues = TextTrackCueList::create();160 161 158 // 4.8.10.12.5 If the text track mode ... is not the text track disabled mode, 162 159 // then the cues attribute must return a live TextTrackCueList object ... … … 164 161 // same object must be returned each time. 165 162 // http://www.whatwg.org/specs/web-apps/current-work/#dom-texttrack-cues 166 if (m_ cues && m_mode != TextTrack::DISABLED)167 return m_cues.get();163 if (m_mode != TextTrack::DISABLED) 164 return ensureTextTrackCueList(); 168 165 return 0; 169 166 } … … 209 206 // track's text track list of cues, then throw an InvalidStateError exception. 210 207 // 4. Add cue to the method's TextTrack object's text track's text track list of cues. 211 if (! m_cues->add(cue)) {208 if (!ensureTextTrackCueList()->add(cue)) { 212 209 ec = INVALID_STATE_ERR; 213 210 return; … … 237 234 // object's text track's text track list of cues, then throw a NotFoundError exception. 238 235 // 3. Remove cue from the method's TextTrack object's text track's text track list of cues. 239 if (!m_cues ->remove(cue)) {236 if (!m_cues || !m_cues->remove(cue)) { 240 237 ec = INVALID_STATE_ERR; 241 238 return; … … 272 269 } 273 270 271 TextTrackCueList* TextTrack::ensureTextTrackCueList() 272 { 273 if (!m_cues) 274 m_cues = TextTrackCueList::create(); 275 276 return m_cues.get(); 277 } 278 274 279 } // namespace WebCore 275 280 -
trunk/Source/WebCore/html/TextTrack.h
r104327 r107632 115 115 116 116 private: 117 TextTrackCueList* ensureTextTrackCueList(); 117 118 HTMLMediaElement* m_mediaElement; 118 119 String m_kind;
Note: See TracChangeset
for help on using the changeset viewer.