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) 2011, 2012, 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011, 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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 else if (name == sizeKeyword) | 935 else if (name == sizeKeyword) |
936 return Size; | 936 return Size; |
937 else if (name == alignKeyword) | 937 else if (name == alignKeyword) |
938 return Align; | 938 return Align; |
939 else if (RuntimeEnabledFeatures::webVTTRegionsEnabled() && name == regionIdK
eyword) | 939 else if (RuntimeEnabledFeatures::webVTTRegionsEnabled() && name == regionIdK
eyword) |
940 return RegionId; | 940 return RegionId; |
941 | 941 |
942 return None; | 942 return None; |
943 } | 943 } |
944 | 944 |
945 void TextTrackCue::setCueSettings(const String& input) | 945 void TextTrackCue::parseSettings(const String& input) |
946 { | 946 { |
947 m_settings = input; | |
948 unsigned position = 0; | 947 unsigned position = 0; |
949 | 948 |
950 while (position < input.length()) { | 949 while (position < input.length()) { |
951 | 950 |
952 // The WebVTT cue settings part of a WebVTT cue consists of zero or more
of the following components, in any order, | 951 // The WebVTT cue settings part of a WebVTT cue consists of zero or more
of the following components, in any order, |
953 // separated from each other by one or more U+0020 SPACE characters or U
+0009 CHARACTER TABULATION (tab) characters. | 952 // separated from each other by one or more U+0020 SPACE characters or U
+0009 CHARACTER TABULATION (tab) characters. |
954 while (position < input.length() && WebVTTParser::isValidSettingDelimite
r(input[position])) | 953 while (position < input.length() && WebVTTParser::isValidSettingDelimite
r(input[position])) |
955 position++; | 954 position++; |
956 if (position >= input.length()) | 955 if (position >= input.length()) |
957 break; | 956 break; |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 ASSERT(m_cueBackgroundBox); | 1197 ASSERT(m_cueBackgroundBox); |
1199 return m_cueBackgroundBox->executionContext(); | 1198 return m_cueBackgroundBox->executionContext(); |
1200 } | 1199 } |
1201 | 1200 |
1202 Document& TextTrackCue::document() const | 1201 Document& TextTrackCue::document() const |
1203 { | 1202 { |
1204 ASSERT(m_cueBackgroundBox); | 1203 ASSERT(m_cueBackgroundBox); |
1205 return m_cueBackgroundBox->document(); | 1204 return m_cueBackgroundBox->document(); |
1206 } | 1205 } |
1207 | 1206 |
1208 bool TextTrackCue::operator==(const TextTrackCue& cue) const | |
1209 { | |
1210 if (m_endTime != cue.endTime()) | |
1211 return false; | |
1212 if (m_startTime != cue.startTime()) | |
1213 return false; | |
1214 if (m_content != cue.text()) | |
1215 return false; | |
1216 if (m_settings != cue.cueSettings()) | |
1217 return false; | |
1218 if (m_id != cue.id()) | |
1219 return false; | |
1220 if (m_textPosition != cue.position()) | |
1221 return false; | |
1222 if (m_linePosition != cue.line()) | |
1223 return false; | |
1224 if (m_cueSize != cue.size()) | |
1225 return false; | |
1226 if (align() != cue.align()) | |
1227 return false; | |
1228 | |
1229 return true; | |
1230 } | |
1231 | |
1232 } // namespace WebCore | 1207 } // namespace WebCore |
OLD | NEW |