Changeset 147355 in webkit
- Timestamp:
- Apr 1, 2013 1:10:48 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r147351 r147355 1 2013-04-01 Victor Carbune <vcarbune@chromium.org> 2 3 TextTrackCue Extension for WebVTT Regions 4 https://bugs.webkit.org/show_bug.cgi?id=109821 5 6 Reviewed by Eric Carlson. 7 8 * media/track/captions-webvtt/header-regions.vtt: Updated to include cues with 9 settings for which the "region:" setting should be ignored (for backwards compatibility 10 regarding WebVTT rendering rules). 11 * media/track/regions-webvtt/text-track-cue-region-attribute-expected.txt: Added. 12 * media/track/regions-webvtt/text-track-cue-region-attribute.html: Added. 13 1 14 2013-04-01 Nate Chapin <japhet@chromium.org> 2 15 -
trunk/LayoutTests/media/track/captions-webvtt/header-regions.vtt
r147325 r147355 9 9 10 10 1 11 00:00:00.000 --> 00:00:02.500 11 00:00:00.000 --> 00:00:02.500 region:someregionattributeid 12 12 We are in New York City 13 14 2 15 00:00:00.000 --> 00:00:02.500 line:5 region:ignored_attribute_value 16 Line is specified, Region should be ignored. 17 18 3 19 00:00:00.000 --> 00:00:02.500 size:10% region:ignored_attribute_value 20 Size is specified, Region should be ignored. 21 22 4 23 00:00:00.000 --> 00:00:02.500 vertical:lr region:ignored_attribute_value 24 Vertical is specified, Region should be ignored. -
trunk/Source/WebCore/ChangeLog
r147354 r147355 1 2013-04-01 Victor Carbune <vcarbune@chromium.org> 2 3 TextTrackCue Extension for WebVTT Regions 4 https://bugs.webkit.org/show_bug.cgi?id=109821 5 6 Reviewed by Eric Carlson. 7 8 The TextTrackCue gets a new attribute and setting, regionId, which specifies 9 to which region the cue belongs to. The attribute is guarded by WEBVTT_REGIONS 10 and is by default disabled in ports. 11 12 Test: media/track/regions-webvtt/text-track-cue-region-attribute.html 13 14 * html/track/TextTrackCue.cpp: 15 (WebCore::TextTrackCue::TextTrackCue): Added member variable for the regionId attribute. 16 (WebCore): 17 (WebCore::TextTrackCue::setRegionId): Setter for the regionId attribute. 18 (WebCore::TextTrackCue::settingName): Added RegionId setting name. 19 (WebCore::TextTrackCue::setCueSettings): Parsed the "region:" cue setting. 20 * html/track/TextTrackCue.h: 21 (TextTrackCue): 22 (WebCore::TextTrackCue::regionId): Getter for the regionId attribute. 23 * html/track/TextTrackCue.idl: Updated to match the WebVTT Regions Extension. 24 1 25 2013-03-05 Anders Carlsson <andersca@apple.com> 2 26 -
trunk/Source/WebCore/html/track/TextTrackCue.cpp
r146128 r147355 535 535 } 536 536 537 #if ENABLE(WEBVTT_REGIONS) 538 void TextTrackCue::setRegionId(const String& regionId) 539 { 540 if (m_regionId == regionId) 541 return; 542 543 cueWillChange(); 544 m_regionId = regionId; 545 cueDidChange(); 546 } 547 #endif 548 537 549 bool TextTrackCue::isActive() 538 550 { … … 863 875 DEFINE_STATIC_LOCAL(const String, sizeKeyword, (ASCIILiteral("size"))); 864 876 DEFINE_STATIC_LOCAL(const String, alignKeyword, (ASCIILiteral("align"))); 877 #if ENABLE(WEBVTT_REGIONS) 878 DEFINE_STATIC_LOCAL(const String, regionIdKeyword, (ASCIILiteral("region"))); 879 #endif 865 880 866 881 if (name == verticalKeyword) … … 874 889 else if (name == alignKeyword) 875 890 return Align; 891 #if ENABLE(WEBVTT_REGIONS) 892 else if (name == regionIdKeyword) 893 return RegionId; 894 #endif 876 895 877 896 return None; … … 1067 1086 } 1068 1087 break; 1088 #if ENABLE(WEBVTT_REGIONS) 1089 case RegionId: 1090 m_regionId = WebVTTParser::collectWord(input, &position); 1091 break; 1092 #endif 1069 1093 case None: 1070 1094 break; … … 1074 1098 position = endOfSetting; 1075 1099 } 1100 #if ENABLE(WEBVTT_REGIONS) 1101 // If cue's line position is not auto or cue's size is not 100 or cue's 1102 // writing direction is not horizontal, but cue's region identifier is not 1103 // the empty string, let cue's region identifier be the empty string. 1104 if (m_regionId.isEmpty()) 1105 return; 1106 1107 if (m_linePosition != undefinedPosition || m_cueSize != 100 || m_writingDirection != Horizontal) 1108 m_regionId = emptyString(); 1109 #endif 1076 1110 } 1077 1111 -
trunk/Source/WebCore/html/track/TextTrackCue.h
r146140 r147355 136 136 virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE; 137 137 138 #if ENABLE(WEBVTT_REGIONS) 139 const String& regionId() const { return m_regionId; } 140 void setRegionId(const String&); 141 #endif 142 138 143 bool isActive(); 139 144 void setIsActive(bool); … … 205 210 206 211 private: 212 void createWebVTTNodeTree(); 213 void copyWebVTTNodeToDOMTree(ContainerNode* WebVTTNode, ContainerNode* root); 214 207 215 std::pair<double, double> getPositionCoordinates() const; 208 216 void parseSettings(const String&); … … 217 225 virtual void derefEventTarget() { deref(); } 218 226 219 enum CueSetting { None, Vertical, Line, Position, Size, Align }; 227 enum CueSetting { 228 None, 229 Vertical, 230 Line, 231 Position, 232 Size, 233 Align, 234 #if ENABLE(WEBVTT_REGIONS) 235 RegionId 236 #endif 237 }; 220 238 CueSetting settingName(const String&); 221 239 … … 258 276 259 277 std::pair<float, float> m_displayPosition; 260 261 void createWebVTTNodeTree();262 void copyWebVTTNodeToDOMTree(ContainerNode* WebVTTNode, ContainerNode* root); 278 #if ENABLE(WEBVTT_REGIONS) 279 String m_regionId; 280 #endif 263 281 }; 264 282 -
trunk/Source/WebCore/html/track/TextTrackCue.idl
r141034 r147355 58 58 attribute DOMString text; 59 59 DocumentFragment getCueAsHTML(); 60 60 61 61 attribute EventListener onenter; 62 62 attribute EventListener onexit; 63 63 64 64 // EventTarget interface 65 65 void addEventListener(in DOMString type, … … 71 71 boolean dispatchEvent(in Event evt) 72 72 raises(EventException); 73 74 #if defined(ENABLE_WEBVTT_REGIONS) && ENABLE_WEBVTT_REGIONS 75 attribute DOMString regionId; 76 #endif 73 77 }; 74 78
Note: See TracChangeset
for help on using the changeset viewer.