OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 track()->setLanguage(value); | 111 track()->setLanguage(value); |
112 else if (name == defaultAttr) | 112 else if (name == defaultAttr) |
113 track()->setIsDefault(!value.isNull()); | 113 track()->setIsDefault(!value.isNull()); |
114 } | 114 } |
115 | 115 |
116 HTMLElement::parseAttribute(name, value); | 116 HTMLElement::parseAttribute(name, value); |
117 } | 117 } |
118 | 118 |
119 KURL HTMLTrackElement::src() const | 119 KURL HTMLTrackElement::src() const |
120 { | 120 { |
121 return document()->completeURL(getAttribute(srcAttr)); | 121 return document().completeURL(getAttribute(srcAttr)); |
122 } | 122 } |
123 | 123 |
124 void HTMLTrackElement::setSrc(const String& url) | 124 void HTMLTrackElement::setSrc(const String& url) |
125 { | 125 { |
126 setAttribute(srcAttr, url); | 126 setAttribute(srcAttr, url); |
127 } | 127 } |
128 | 128 |
129 String HTMLTrackElement::kind() | 129 String HTMLTrackElement::kind() |
130 { | 130 { |
131 return track()->kind(); | 131 return track()->kind(); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 return false; | 245 return false; |
246 | 246 |
247 // 4.8.10.12.3 Sourcing out-of-band text tracks | 247 // 4.8.10.12.3 Sourcing out-of-band text tracks |
248 | 248 |
249 // 4. Download: If URL is not the empty string, perform a potentially CORS-e
nabled fetch of URL, with the | 249 // 4. Download: If URL is not the empty string, perform a potentially CORS-e
nabled fetch of URL, with the |
250 // mode being the state of the media element's crossorigin content attribute
, the origin being the | 250 // mode being the state of the media element's crossorigin content attribute
, the origin being the |
251 // origin of the media element's Document, and the default origin behaviour
set to fail. | 251 // origin of the media element's Document, and the default origin behaviour
set to fail. |
252 if (url.isEmpty()) | 252 if (url.isEmpty()) |
253 return false; | 253 return false; |
254 | 254 |
255 if (!document()->contentSecurityPolicy()->allowMediaFromSource(url)) { | 255 if (!document().contentSecurityPolicy()->allowMediaFromSource(url)) { |
256 LOG(Media, "HTMLTrackElement::canLoadUrl(%s) -> rejected by Content Secu
rity Policy", urlForLoggingTrack(url).utf8().data()); | 256 LOG(Media, "HTMLTrackElement::canLoadUrl(%s) -> rejected by Content Secu
rity Policy", urlForLoggingTrack(url).utf8().data()); |
257 return false; | 257 return false; |
258 } | 258 } |
259 | 259 |
260 return dispatchBeforeLoadEvent(url.string()); | 260 return dispatchBeforeLoadEvent(url.string()); |
261 } | 261 } |
262 | 262 |
263 void HTMLTrackElement::didCompleteLoad(LoadableTextTrack*, LoadStatus status) | 263 void HTMLTrackElement::didCompleteLoad(LoadableTextTrack*, LoadStatus status) |
264 { | 264 { |
265 // 4.8.10.12.3 Sourcing out-of-band text tracks (continued) | 265 // 4.8.10.12.3 Sourcing out-of-band text tracks (continued) |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 HTMLMediaElement* HTMLTrackElement::mediaElement() const | 357 HTMLMediaElement* HTMLTrackElement::mediaElement() const |
358 { | 358 { |
359 Element* parent = parentElement(); | 359 Element* parent = parentElement(); |
360 if (parent && parent->isMediaElement()) | 360 if (parent && parent->isMediaElement()) |
361 return toHTMLMediaElement(parentNode()); | 361 return toHTMLMediaElement(parentNode()); |
362 return 0; | 362 return 0; |
363 } | 363 } |
364 | 364 |
365 } | 365 } |
366 | 366 |
OLD | NEW |