| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 } | 323 } |
| 324 | 324 |
| 325 IntSize HTMLVideoElement::bitmapSourceSize() const | 325 IntSize HTMLVideoElement::bitmapSourceSize() const |
| 326 { | 326 { |
| 327 return IntSize(videoWidth(), videoHeight()); | 327 return IntSize(videoWidth(), videoHeight()); |
| 328 } | 328 } |
| 329 | 329 |
| 330 ScriptPromise HTMLVideoElement::createImageBitmap(ScriptState* scriptState, Even
tTarget& eventTarget, Optional<IntRect> cropRect, const ImageBitmapOptions& opti
ons, ExceptionState& exceptionState) | 330 ScriptPromise HTMLVideoElement::createImageBitmap(ScriptState* scriptState, Even
tTarget& eventTarget, Optional<IntRect> cropRect, const ImageBitmapOptions& opti
ons, ExceptionState& exceptionState) |
| 331 { | 331 { |
| 332 DCHECK(eventTarget.toLocalDOMWindow()); | 332 DCHECK(eventTarget.toLocalDOMWindow()); |
| 333 if (getNetworkState() == HTMLMediaElement::NETWORK_EMPTY) { | 333 if (getNetworkState() == HTMLMediaElement::kNetworkEmpty) { |
| 334 exceptionState.throwDOMException(InvalidStateError, "The provided elemen
t has not retrieved data."); | 334 exceptionState.throwDOMException(InvalidStateError, "The provided elemen
t has not retrieved data."); |
| 335 return ScriptPromise(); | 335 return ScriptPromise(); |
| 336 } | 336 } |
| 337 if (getReadyState() <= HTMLMediaElement::HAVE_METADATA) { | 337 if (getReadyState() <= HTMLMediaElement::kHaveMetadata) { |
| 338 exceptionState.throwDOMException(InvalidStateError, "The provided elemen
t's player has no current data."); | 338 exceptionState.throwDOMException(InvalidStateError, "The provided elemen
t's player has no current data."); |
| 339 return ScriptPromise(); | 339 return ScriptPromise(); |
| 340 } | 340 } |
| 341 if ((cropRect && !ImageBitmap::isSourceSizeValid(cropRect->width(), cropRect
->height(), exceptionState)) | 341 if ((cropRect && !ImageBitmap::isSourceSizeValid(cropRect->width(), cropRect
->height(), exceptionState)) |
| 342 || !ImageBitmap::isSourceSizeValid(bitmapSourceSize().width(), bitmapSou
rceSize().height(), exceptionState)) | 342 || !ImageBitmap::isSourceSizeValid(bitmapSourceSize().width(), bitmapSou
rceSize().height(), exceptionState)) |
| 343 return ScriptPromise(); | 343 return ScriptPromise(); |
| 344 if (!ImageBitmap::isResizeOptionValid(options, exceptionState)) | 344 if (!ImageBitmap::isResizeOptionValid(options, exceptionState)) |
| 345 return ScriptPromise(); | 345 return ScriptPromise(); |
| 346 return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::creat
e(this, cropRect, eventTarget.toLocalDOMWindow()->document(), options)); | 346 return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::creat
e(this, cropRect, eventTarget.toLocalDOMWindow()->document(), options)); |
| 347 } | 347 } |
| 348 | 348 |
| 349 } // namespace blink | 349 } // namespace blink |
| OLD | NEW |