Changeset 163974 in webkit


Ignore:
Timestamp:
Feb 12, 2014 12:39:24 PM (10 years ago)
Author:
b.long@cablelabs.com
Message:

Implement DataCue for metadata cues
https://bugs.webkit.org/show_bug.cgi?id=128402

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/track/track-datacue.html

  • CMakeLists.txt: Add DataCue.
  • DerivedSources.cpp: Add JSDataCue.
  • DerivedSources.make: Same.
  • GNUmakefile.list.am: Add DataCue and JSDataCue.
  • WebCore.vcxproj/WebCore.vcxproj: Add DataCue.
  • WebCore.vcxproj/WebCore.vcxproj.filters: Same.
  • WebCore.xcodeproj/project.pbxproj: Add DataCue and JSDataCue.
  • bindings/js/JSTextTrackCueCustom.cpp:

(WebCore::toJS): Add DataCue wrapper.

  • html/track/DataCue.cpp: Copied from Source/WebCore/html/track/TextTrack.idl.
  • html/track/DataCue.h: Copied from Source/WebCore/html/track/TextTrack.idl.
  • html/track/DataCue.idl: Copied from Source/WebCore/html/track/TextTrack.idl.
  • html/track/InbandGenericTextTrack.cpp:

(WebCore::InbandGenericTextTrack::addGenericCue): Pass ASSERT_NO_EXCEPTION to addCue().

  • html/track/InbandWebVTTTextTrack.cpp:

(WebCore::InbandWebVTTTextTrack::newCuesParsed): Same.

  • html/track/TextTrack.cpp:

(WebCore::TextTrack::addCue): Throw an exception if DataCue is added to a track that isn't kind="metadata".

  • html/track/TextTrack.h: Add exception code parameter to addCue().
  • html/track/TextTrack.idl: Add [RaisesException] to addCue().
  • html/track/TextTrackCue.h: Add Data CueType.

LayoutTests:

  • js/dom/global-constructors-attributes-expected.txt: Add DataCue.
  • media/track/track-datacue-expected.txt: Added.
  • media/track/track-datacue.html: Added.
  • platform/efl/js/dom/global-constructors-attributes-expected.txt: Add DataCue.
  • platform/gtk-wk2/js/dom/global-constructors-attributes-expected.txt: Same.
  • platform/gtk/js/dom/global-constructors-attributes-expected.txt: Same.
  • platform/mac/js/dom/global-constructors-attributes-expected.txt: Same.
  • platform/mac-mountainlion/js/dom/global-constructors-attributes-expected.txt: Same.
  • platform/win/js/dom/global-constructors-attributes-expected.txt: Same.
Location:
trunk
Files:
2 added
23 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r163968 r163974  
     12014-02-12  Brendan Long  <b.long@cablelabs.com>
     2
     3        Implement DataCue for metadata cues
     4        https://bugs.webkit.org/show_bug.cgi?id=128402
     5
     6        Reviewed by Eric Carlson.
     7
     8        * js/dom/global-constructors-attributes-expected.txt: Add DataCue.
     9        * media/track/track-datacue-expected.txt: Added.
     10        * media/track/track-datacue.html: Added.
     11        * platform/efl/js/dom/global-constructors-attributes-expected.txt: Add DataCue.
     12        * platform/gtk-wk2/js/dom/global-constructors-attributes-expected.txt: Same.
     13        * platform/gtk/js/dom/global-constructors-attributes-expected.txt: Same.
     14        * platform/mac/js/dom/global-constructors-attributes-expected.txt: Same.
     15        * platform/mac-mountainlion/js/dom/global-constructors-attributes-expected.txt: Same.
     16        * platform/win/js/dom/global-constructors-attributes-expected.txt: Same.
     17
    1182014-02-12  Brady Eidson  <beidson@apple.com>
    219
  • trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt

    r163649 r163974  
    259259PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').enumerable is false
    260260PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').configurable is true
     261PASS Object.getOwnPropertyDescriptor(global, 'DataCue').value is DataCue
     262PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('get') is false
     263PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('set') is false
     264PASS Object.getOwnPropertyDescriptor(global, 'DataCue').enumerable is false
     265PASS Object.getOwnPropertyDescriptor(global, 'DataCue').configurable is true
    261266PASS Object.getOwnPropertyDescriptor(global, 'DelayNode').value is DelayNode
    262267PASS Object.getOwnPropertyDescriptor(global, 'DelayNode').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt

    r163649 r163974  
    259259PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').enumerable is false
    260260PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').configurable is true
     261PASS Object.getOwnPropertyDescriptor(global, 'DataCue').value is DataCue
     262PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('get') is false
     263PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('set') is false
     264PASS Object.getOwnPropertyDescriptor(global, 'DataCue').enumerable is false
     265PASS Object.getOwnPropertyDescriptor(global, 'DataCue').configurable is true
    261266PASS Object.getOwnPropertyDescriptor(global, 'DelayNode').value is DelayNode
    262267PASS Object.getOwnPropertyDescriptor(global, 'DelayNode').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/gtk-wk2/js/dom/global-constructors-attributes-expected.txt

    r163649 r163974  
    264264PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').enumerable is false
    265265PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').configurable is true
     266PASS Object.getOwnPropertyDescriptor(global, 'DataCue').value is DataCue
     267PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('get') is false
     268PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('set') is false
     269PASS Object.getOwnPropertyDescriptor(global, 'DataCue').enumerable is false
     270PASS Object.getOwnPropertyDescriptor(global, 'DataCue').configurable is true
    266271PASS Object.getOwnPropertyDescriptor(global, 'DelayNode').value is DelayNode
    267272PASS Object.getOwnPropertyDescriptor(global, 'DelayNode').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt

    r163649 r163974  
    264264PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').enumerable is false
    265265PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').configurable is true
     266PASS Object.getOwnPropertyDescriptor(global, 'DataCue').value is DataCue
     267PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('get') is false
     268PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('set') is false
     269PASS Object.getOwnPropertyDescriptor(global, 'DataCue').enumerable is false
     270PASS Object.getOwnPropertyDescriptor(global, 'DataCue').configurable is true
    266271PASS Object.getOwnPropertyDescriptor(global, 'DelayNode').value is DelayNode
    267272PASS Object.getOwnPropertyDescriptor(global, 'DelayNode').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/mac-mountainlion/js/dom/global-constructors-attributes-expected.txt

    r163649 r163974  
    259259PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').enumerable is false
    260260PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').configurable is true
     261PASS Object.getOwnPropertyDescriptor(global, 'DataCue').value is DataCue
     262PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('get') is false
     263PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('set') is false
     264PASS Object.getOwnPropertyDescriptor(global, 'DataCue').enumerable is false
     265PASS Object.getOwnPropertyDescriptor(global, 'DataCue').configurable is true
    261266PASS Object.getOwnPropertyDescriptor(global, 'DelayNode').value is DelayNode
    262267PASS Object.getOwnPropertyDescriptor(global, 'DelayNode').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt

    r163649 r163974  
    259259PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').enumerable is false
    260260PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').configurable is true
     261PASS Object.getOwnPropertyDescriptor(global, 'DataCue').value is DataCue
     262PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('get') is false
     263PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('set') is false
     264PASS Object.getOwnPropertyDescriptor(global, 'DataCue').enumerable is false
     265PASS Object.getOwnPropertyDescriptor(global, 'DataCue').configurable is true
    261266PASS Object.getOwnPropertyDescriptor(global, 'DelayNode').value is DelayNode
    262267PASS Object.getOwnPropertyDescriptor(global, 'DelayNode').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt

    r163649 r163974  
    199199PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').enumerable is false
    200200PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').configurable is true
     201PASS Object.getOwnPropertyDescriptor(global, 'DataCue').value is DataCue
     202PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('get') is false
     203PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('set') is false
     204PASS Object.getOwnPropertyDescriptor(global, 'DataCue').enumerable is false
     205PASS Object.getOwnPropertyDescriptor(global, 'DataCue').configurable is true
    201206PASS Object.getOwnPropertyDescriptor(global, 'Document').value is Document
    202207PASS Object.getOwnPropertyDescriptor(global, 'Document').hasOwnProperty('get') is false
  • trunk/Source/WebCore/CMakeLists.txt

    r163826 r163974  
    26912691        html/track/AudioTrack.idl
    26922692        html/track/AudioTrackList.idl
     2693        html/track/DataCue.idl
    26932694        html/track/TextTrack.idl
    26942695        html/track/TextTrackCue.idl
     
    27042705        html/track/AudioTrack.cpp
    27052706        html/track/AudioTrackList.cpp
     2707        html/track/DataCue.cpp
    27062708        html/track/InbandGenericTextTrack.cpp
    27072709        html/track/InbandTextTrack.cpp
  • trunk/Source/WebCore/ChangeLog

    r163973 r163974  
     12014-02-12  Brendan Long  <b.long@cablelabs.com>
     2
     3        Implement DataCue for metadata cues
     4        https://bugs.webkit.org/show_bug.cgi?id=128402
     5
     6        Reviewed by Eric Carlson.
     7
     8        Test: media/track/track-datacue.html
     9
     10        * CMakeLists.txt: Add DataCue.
     11        * DerivedSources.cpp: Add JSDataCue.
     12        * DerivedSources.make: Same.
     13        * GNUmakefile.list.am: Add DataCue and JSDataCue.
     14        * WebCore.vcxproj/WebCore.vcxproj: Add DataCue.
     15        * WebCore.vcxproj/WebCore.vcxproj.filters: Same.
     16        * WebCore.xcodeproj/project.pbxproj: Add DataCue and JSDataCue.
     17        * bindings/js/JSTextTrackCueCustom.cpp:
     18        (WebCore::toJS): Add DataCue wrapper.
     19        * html/track/DataCue.cpp: Copied from Source/WebCore/html/track/TextTrack.idl.
     20        * html/track/DataCue.h: Copied from Source/WebCore/html/track/TextTrack.idl.
     21        * html/track/DataCue.idl: Copied from Source/WebCore/html/track/TextTrack.idl.
     22        * html/track/InbandGenericTextTrack.cpp:
     23        (WebCore::InbandGenericTextTrack::addGenericCue): Pass ASSERT_NO_EXCEPTION to addCue().
     24        * html/track/InbandWebVTTTextTrack.cpp:
     25        (WebCore::InbandWebVTTTextTrack::newCuesParsed): Same.
     26        * html/track/TextTrack.cpp:
     27        (WebCore::TextTrack::addCue): Throw an exception if DataCue is added to a track that isn't kind="metadata".
     28        * html/track/TextTrack.h: Add exception code parameter to addCue().
     29        * html/track/TextTrack.idl: Add [RaisesException] to addCue().
     30        * html/track/TextTrackCue.h: Add Data CueType.
     31
    1322014-02-12  Zalan Bujtas  <zalan@apple.com>
    233
  • trunk/Source/WebCore/DerivedSources.cpp

    r163649 r163974  
    464464#include "JSAudioTrack.cpp"
    465465#include "JSAudioTrackList.cpp"
     466#include "JSDataCue.cpp"
    466467#include "JSHTMLTrackElement.cpp"
    467468#include "JSTextTrack.cpp"
  • trunk/Source/WebCore/DerivedSources.make

    r163906 r163974  
    445445    $(WebCore)/html/track/AudioTrack.idl \
    446446    $(WebCore)/html/track/AudioTrackList.idl \
     447    $(WebCore)/html/track/DataCue.idl \
    447448    $(WebCore)/html/track/TextTrack.idl \
    448449    $(WebCore)/html/track/TextTrackCue.idl \
  • trunk/Source/WebCore/GNUmakefile.list.am

    r163853 r163974  
    165165        DerivedSources/WebCore/JSDatabaseSync.cpp \
    166166        DerivedSources/WebCore/JSDatabaseSync.h \
     167        DerivedSources/WebCore/JSDataCue.cpp \
     168        DerivedSources/WebCore/JSDataCue.h \
    167169        DerivedSources/WebCore/JSDataTransferItem.cpp \
    168170        DerivedSources/WebCore/JSDataTransferItem.h \
     
    15391541        $(WebCore)/html/track/AudioTrack.idl \
    15401542        $(WebCore)/html/track/AudioTrackList.idl \
     1543        $(WebCore)/html/track/DataCue.idl \
    15411544        $(WebCore)/html/track/TextTrack.idl \
    15421545        $(WebCore)/html/track/TextTrackCue.idl \
     
    36683671        Source/WebCore/html/track/AudioTrackList.cpp \
    36693672        Source/WebCore/html/track/AudioTrackList.h \
     3673        Source/WebCore/html/track/DataCue.cpp \
     3674        Source/WebCore/html/track/DataCue.h \
    36703675        Source/WebCore/html/track/InbandGenericTextTrack.cpp \
    36713676        Source/WebCore/html/track/InbandGenericTextTrack.h \
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r163853 r163974  
    1566215662    <ClCompile Include="..\html\shadow\SpinButtonElement.cpp" />
    1566315663    <ClCompile Include="..\html\shadow\TextControlInnerElements.cpp" />
     15664    <ClCompile Include="..\html\track\DataCue.cpp" />
    1566415665    <ClCompile Include="..\html\track\InbandGenericTextTrack.cpp" />
    1566515666    <ClCompile Include="..\html\track\InbandTextTrack.cpp" />
     
    2041920420    <ClInclude Include="..\html\shadow\SpinButtonElement.h" />
    2042020421    <ClInclude Include="..\html\shadow\TextControlInnerElements.h" />
     20422    <ClInclude Include="..\html\track\DataCue.h" />
    2042120423    <ClInclude Include="..\html\track\InbandGenericTextTrack.h" />
    2042220424    <ClInclude Include="..\html\track\InbandTextTrack.h" />
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

    r163853 r163974  
    41714171      <Filter>html\shadow</Filter>
    41724172    </ClCompile>
     4173    <ClCompile Include="..\html\track\DataCue.cpp">
     4174      <Filter>html\track</Filter>
     4175    </ClCompile>
    41734176    <ClCompile Include="..\html\track\InbandGenericTextTrack.cpp">
    41744177      <Filter>html\track</Filter>
     
    1119811201    <ClInclude Include="..\html\shadow\TextControlInnerElements.h">
    1119911202      <Filter>html\shadow</Filter>
     11203    </ClInclude>
     11204    <ClInclude Include="..\html\track\DataCue.h">
     11205      <Filter>html\track</Filter>
    1120011206    </ClInclude>
    1120111207    <ClInclude Include="..\html\track\InbandGenericTextTrack.h">
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r163853 r163974  
    53235323                BE20508118A460BC0080647E /* JSVTTCue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE20507F18A460AA0080647E /* JSVTTCue.cpp */; };
    53245324                BE20508218A460C30080647E /* JSVTTCue.h in Headers */ = {isa = PBXBuildFile; fileRef = BE20508018A460AA0080647E /* JSVTTCue.h */; };
     5325                BE23480C18A9870B00E4B6E8 /* DataCue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE23480918A9870300E4B6E8 /* DataCue.cpp */; };
     5326                BE23480D18A9871400E4B6E8 /* DataCue.h in Headers */ = {isa = PBXBuildFile; fileRef = BE23480A18A9870300E4B6E8 /* DataCue.h */; settings = {ATTRIBUTES = (Private, ); }; };
     5327                BE61039D18A9D65200DD50D7 /* JSDataCue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE61039B18A9D61200DD50D7 /* JSDataCue.cpp */; };
     5328                BE61039E18A9D65A00DD50D7 /* JSDataCue.h in Headers */ = {isa = PBXBuildFile; fileRef = BE61039C18A9D61200DD50D7 /* JSDataCue.h */; };
    53255329                BE6DF70B171CA2C500DD52B8 /* JSVideoTrackCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE6DF708171CA2C500DD52B8 /* JSVideoTrackCustom.cpp */; };
    53265330                BE6DF70D171CA2C500DD52B8 /* JSVideoTrackListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE6DF70A171CA2C500DD52B8 /* JSVideoTrackListCustom.cpp */; };
     
    1252712531                BE20507F18A460AA0080647E /* JSVTTCue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVTTCue.cpp; sourceTree = "<group>"; };
    1252812532                BE20508018A460AA0080647E /* JSVTTCue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVTTCue.h; sourceTree = "<group>"; };
     12533                BE23480918A9870300E4B6E8 /* DataCue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DataCue.cpp; sourceTree = "<group>"; };
     12534                BE23480A18A9870300E4B6E8 /* DataCue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataCue.h; sourceTree = "<group>"; };
     12535                BE23480B18A9870300E4B6E8 /* DataCue.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DataCue.idl; sourceTree = "<group>"; };
     12536                BE61039B18A9D61200DD50D7 /* JSDataCue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDataCue.cpp; sourceTree = "<group>"; };
     12537                BE61039C18A9D61200DD50D7 /* JSDataCue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDataCue.h; sourceTree = "<group>"; };
    1252912538                BE6DF708171CA2C500DD52B8 /* JSVideoTrackCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVideoTrackCustom.cpp; sourceTree = "<group>"; };
    1253012539                BE6DF70A171CA2C500DD52B8 /* JSVideoTrackListCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVideoTrackListCustom.cpp; sourceTree = "<group>"; };
     
    1804318052                                49EED13E1051969400099FAB /* JSCanvasRenderingContext2D.cpp */,
    1804418053                                49EED13F1051969400099FAB /* JSCanvasRenderingContext2D.h */,
     18054                                BE61039B18A9D61200DD50D7 /* JSDataCue.cpp */,
     18055                                BE61039C18A9D61200DD50D7 /* JSDataCue.h */,
    1804518056                                2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */,
    1804618057                                2E0888D31148848A00AF4265 /* JSDOMFormData.h */,
     
    1908419095                                BE88E0D01715D2A200658D98 /* AudioTrackList.h */,
    1908519096                                BE88E0D11715D2A200658D98 /* AudioTrackList.idl */,
     19097                                BE23480918A9870300E4B6E8 /* DataCue.cpp */,
     19098                                BE23480A18A9870300E4B6E8 /* DataCue.h */,
     19099                                BE23480B18A9870300E4B6E8 /* DataCue.idl */,
    1908619100                                BE16C58E17CFE17200852C04 /* InbandGenericTextTrack.cpp */,
    1908719101                                BE16C58F17CFE17200852C04 /* InbandGenericTextTrack.h */,
     
    2397923993                                1449E24C107D4A8400B5793F /* JSCallbackData.h in Headers */,
    2398023994                                65DF323A09D1DE65000BE325 /* JSCanvasGradient.h in Headers */,
     23995                                BE23480D18A9871400E4B6E8 /* DataCue.h in Headers */,
    2398123996                                51EAC5681815ED3E004F1BA4 /* IDBTransactionCoordinator.h in Headers */,
    2398223997                                65DF323C09D1DE65000BE325 /* JSCanvasPattern.h in Headers */,
     
    2579725812                                3106037014327D2E00ABF4BA /* WebKitCSSFilterValue.h in Headers */,
    2579825813                                31288E730E3005D6003619AE /* WebKitCSSKeyframeRule.h in Headers */,
     25814                                BE61039E18A9D65A00DD50D7 /* JSDataCue.h in Headers */,
    2579925815                                31288E750E3005D6003619AE /* WebKitCSSKeyframesRule.h in Headers */,
    2580025816                                498391590F1E776900C23782 /* WebKitCSSMatrix.h in Headers */,
     
    2743827454                                BC60D9BF0D2A269A00B9918F /* JSEventException.cpp in Sources */,
    2743927455                                93B70D6909EB0C7C009D8468 /* JSEventListener.cpp in Sources */,
     27456                                BE23480C18A9870B00E4B6E8 /* DataCue.cpp in Sources */,
    2744027457                                E0FEF372B47C53EAC1C1FBEE /* JSEventSource.cpp in Sources */,
    2744127458                                C6A703325C9D0B6CDCBC4D77 /* JSEventTarget.cpp in Sources */,
     
    2843528452                                0F605AEC15F94848004DF0C0 /* ScrollingConstraints.cpp in Sources */,
    2843628453                                1AF62EE714DA22A70041556C /* ScrollingCoordinator.cpp in Sources */,
     28454                                BE61039D18A9D65200DD50D7 /* JSDataCue.cpp in Sources */,
    2843728455                                1AF62EE614DA22A70041556C /* ScrollingCoordinatorMac.mm in Sources */,
    2843828456                                CD5596911475B678001D0BD0 /* AudioFileReaderIOS.cpp in Sources */,
  • trunk/Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp

    r163649 r163974  
    2828#if ENABLE(VIDEO_TRACK)
    2929
     30#include "JSDataCue.h"
    3031#include "JSTextTrackCue.h"
    3132#include "JSTrackCustom.h"
     
    7071    // This switch will make more sense once we support DataCue
    7172    switch (cue->cueType()) {
     73    case TextTrackCue::Data:
     74        return CREATE_DOM_WRAPPER(exec, globalObject, DataCue, cue);
    7275    case TextTrackCue::WebVTT:
    7376    case TextTrackCue::Generic:
     
    8689    ASSERT(jsTextTrackCue->structure()->typeInfo().overridesVisitChildren());
    8790    Base::visitChildren(jsTextTrackCue, visitor);
    88    
     91
    8992    // Mark the cue's track root if it has one.
    9093    TextTrackCue& textTrackCue = jsTextTrackCue->impl();
  • trunk/Source/WebCore/html/track/DataCue.cpp

    r163973 r163974  
    11/*
    2  * Copyright (C) 2011 Google Inc. All rights reserved.
     2 * Copyright (C) 2014 Cable Television Labs Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2121 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
    2525
    26 [
    27     Conditional=VIDEO_TRACK,
    28     EventTarget,
    29     GenerateIsReachable=ImplElementRoot,
    30     JSCustomMarkFunction,
    31     SkipVTableValidation,
    32 ] interface TextTrack {
    33     readonly attribute DOMString id;
    34     [CustomSetter] attribute DOMString kind;
    35     readonly attribute DOMString label;
    36     [CustomSetter] attribute DOMString language;
     26#include "config.h"
    3727
    38     attribute DOMString mode;
     28#if ENABLE(VIDEO_TRACK)
     29#include "DataCue.h"
    3930
    40     readonly attribute TextTrackCueList cues;
    41     readonly attribute TextTrackCueList activeCues;
    42              attribute EventListener oncuechange;
     31#include "Logging.h"
     32#include "TextTrack.h"
     33#include "TextTrackCueList.h"
    4334
    44     void addCue(TextTrackCue cue);
    45     [RaisesException] void removeCue(TextTrackCue cue);
     35namespace WebCore {
    4636
    47 #if defined(ENABLE_WEBVTT_REGIONS) && ENABLE_WEBVTT_REGIONS
    48     readonly attribute TextTrackRegionList regions;
    49     void addRegion(TextTrackRegion region);
    50     [RaisesException] void removeRegion(TextTrackRegion region);
     37DataCue::DataCue(ScriptExecutionContext& context, double start, double end, PassRefPtr<ArrayBuffer> data)
     38    : TextTrackCue(context, start, end)
     39    , m_data(data)
     40{
     41}
     42
     43DataCue::~DataCue()
     44{
     45}
     46
     47String DataCue::text(bool& isNull) const
     48{
     49    isNull = true;
     50    return String();
     51}
     52
     53DataCue* toDataCue(TextTrackCue* cue)
     54{
     55    ASSERT_WITH_SECURITY_IMPLICATION(cue->cueType() == TextTrackCue::Data);
     56    return static_cast<DataCue*>(cue);
     57}
     58
     59const DataCue* toDataCue(const TextTrackCue* cue)
     60{
     61    ASSERT_WITH_SECURITY_IMPLICATION(cue->cueType() == TextTrackCue::Data);
     62    return static_cast<const DataCue*>(cue);
     63}
     64
     65} // namespace WebCore
     66
    5167#endif
    52 
    53     // EventTarget interface
    54     void addEventListener(DOMString type,
    55                           EventListener listener,
    56                           optional boolean useCapture);
    57     void removeEventListener(DOMString type,
    58                              EventListener listener,
    59                              optional boolean useCapture);
    60     [RaisesException] boolean dispatchEvent(Event evt);
    61 };
  • trunk/Source/WebCore/html/track/DataCue.h

    r163973 r163974  
    11/*
    2  * Copyright (C) 2011 Google Inc. All rights reserved.
     2 * Copyright (C) 2014 Cable Television Labs Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2121 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
    2525
    26 [
    27     Conditional=VIDEO_TRACK,
    28     EventTarget,
    29     GenerateIsReachable=ImplElementRoot,
    30     JSCustomMarkFunction,
    31     SkipVTableValidation,
    32 ] interface TextTrack {
    33     readonly attribute DOMString id;
    34     [CustomSetter] attribute DOMString kind;
    35     readonly attribute DOMString label;
    36     [CustomSetter] attribute DOMString language;
     26#ifndef DataCue_h
     27#define DataCue_h
    3728
    38     attribute DOMString mode;
     29#if ENABLE(VIDEO_TRACK)
    3930
    40     readonly attribute TextTrackCueList cues;
    41     readonly attribute TextTrackCueList activeCues;
    42              attribute EventListener oncuechange;
     31#include "TextTrackCue.h"
     32#include <runtime/ArrayBuffer.h>
     33#include <wtf/RefCounted.h>
    4334
    44     void addCue(TextTrackCue cue);
    45     [RaisesException] void removeCue(TextTrackCue cue);
     35namespace WebCore {
    4636
    47 #if defined(ENABLE_WEBVTT_REGIONS) && ENABLE_WEBVTT_REGIONS
    48     readonly attribute TextTrackRegionList regions;
    49     void addRegion(TextTrackRegion region);
    50     [RaisesException] void removeRegion(TextTrackRegion region);
     37class ScriptExecutionContext;
     38
     39class DataCue : public TextTrackCue {
     40public:
     41    static PassRefPtr<DataCue> create(ScriptExecutionContext& context, double start, double end, PassRefPtr<ArrayBuffer> data)
     42    {
     43        return adoptRef(new DataCue(context, start, end, data));
     44    }
     45
     46    virtual ~DataCue();
     47    virtual CueType cueType() const { return Data; }
     48
     49    RefPtr<ArrayBuffer> data() const { return m_data; }
     50    void setData(PassRefPtr<ArrayBuffer> data) { m_data = data; }
     51    String text(bool& isNull) const;
     52
     53protected:
     54    DataCue(ScriptExecutionContext&, double start, double end, PassRefPtr<ArrayBuffer>);
     55
     56private:
     57    RefPtr<ArrayBuffer> m_data;
     58};
     59
     60DataCue* toDataCue(TextTrackCue*);
     61const DataCue* toDataCue(const TextTrackCue*);
     62
     63} // namespace WebCore
     64
    5165#endif
    52 
    53     // EventTarget interface
    54     void addEventListener(DOMString type,
    55                           EventListener listener,
    56                           optional boolean useCapture);
    57     void removeEventListener(DOMString type,
    58                              EventListener listener,
    59                              optional boolean useCapture);
    60     [RaisesException] boolean dispatchEvent(Event evt);
    61 };
     66#endif
  • trunk/Source/WebCore/html/track/DataCue.idl

    r163973 r163974  
    11/*
    2  * Copyright (C) 2011 Google Inc.  All rights reserved.
     2 * Copyright (C) 2014 Cable Television Labs Inc.  All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
    25 
    2625[
    2726    Conditional=VIDEO_TRACK,
    28     EventTarget,
    29     GenerateIsReachable=ImplElementRoot,
    30     JSCustomMarkFunction,
    31     SkipVTableValidation,
    32 ] interface TextTrack {
    33     readonly attribute DOMString id;
    34     [CustomSetter] attribute DOMString kind;
    35     readonly attribute DOMString label;
    36     [CustomSetter] attribute DOMString language;
    37 
    38     attribute DOMString mode;
    39 
    40     readonly attribute TextTrackCueList cues;
    41     readonly attribute TextTrackCueList activeCues;
    42              attribute EventListener oncuechange;
    43 
    44     void addCue(TextTrackCue cue);
    45     [RaisesException] void removeCue(TextTrackCue cue);
    46 
    47 #if defined(ENABLE_WEBVTT_REGIONS) && ENABLE_WEBVTT_REGIONS
    48     readonly attribute TextTrackRegionList regions;
    49     void addRegion(TextTrackRegion region);
    50     [RaisesException] void removeRegion(TextTrackRegion region);
    51 #endif
    52 
    53     // EventTarget interface
    54     void addEventListener(DOMString type,
    55                           EventListener listener,
    56                           optional boolean useCapture);
    57     void removeEventListener(DOMString type,
    58                              EventListener listener,
    59                              optional boolean useCapture);
    60     [RaisesException] boolean dispatchEvent(Event evt);
     27    Constructor(double startTime, double endTime, ArrayBuffer data),
     28    ConstructorCallWith=ScriptExecutionContext,
     29] interface DataCue : TextTrackCue {
     30    attribute ArrayBuffer data;
     31    readonly attribute DOMString? text;
    6132};
  • trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp

    r163649 r163974  
    160160        m_cueMap.add(cueData.get(), cue.get());
    161161
    162     addCue(cue);
     162    addCue(cue, ASSERT_NO_EXCEPTION);
    163163}
    164164
  • trunk/Source/WebCore/html/track/InbandWebVTTTextTrack.cpp

    r163649 r163974  
    7272            return;
    7373        }
    74         addCue(cue.release());
     74        addCue(cue.release(), ASSERT_NO_EXCEPTION);
    7575    }
    7676}
  • trunk/Source/WebCore/html/track/TextTrack.cpp

    r163649 r163974  
    274274}
    275275
    276 void TextTrack::addCue(PassRefPtr<TextTrackCue> prpCue)
     276void TextTrack::addCue(PassRefPtr<TextTrackCue> prpCue, ExceptionCode& ec)
    277277{
    278278    if (!prpCue)
     
    280280
    281281    RefPtr<TextTrackCue> cue = prpCue;
     282
     283    // 4.7.10.12.6 Text tracks exposing in-band metadata
     284    // The UA will use DataCue to expose only text track cue objects that belong to a text track that has a text
     285    // track kind of metadata.
     286    // If a DataCue is added to a TextTrack via the addCue() method but the text track does not have its text
     287    // track kind set to metadata, throw a InvalidNodeTypeError exception and don't add the cue to the TextTrackList
     288    // of the TextTrack.
     289    if (cue->cueType() == TextTrackCue::Data && kind() != metadataKeyword()) {
     290        ec = INVALID_NODE_TYPE_ERR;
     291        return;
     292    }
    282293
    283294    // TODO(93143): Add spec-compliant behavior for negative time values.
  • trunk/Source/WebCore/html/track/TextTrack.h

    r163649 r163974  
    109109    TextTrackClient* client() { return m_client; }
    110110
    111     void addCue(PassRefPtr<TextTrackCue>);
     111    void addCue(PassRefPtr<TextTrackCue>, ExceptionCode&);
    112112    virtual void removeCue(TextTrackCue*, ExceptionCode&);
    113113
  • trunk/Source/WebCore/html/track/TextTrack.idl

    r159061 r163974  
    4242             attribute EventListener oncuechange;
    4343
    44     void addCue(TextTrackCue cue);
     44    [RaisesException] void addCue(TextTrackCue cue);
    4545    [RaisesException] void removeCue(TextTrackCue cue);
    4646
  • trunk/Source/WebCore/html/track/TextTrackCue.h

    r163649 r163974  
    8686
    8787    enum CueType {
     88        Data,
    8889        Generic,
    8990        WebVTT
Note: See TracChangeset for help on using the changeset viewer.