| 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 { | 331 { |
| 332 DCHECK(eventTarget.toLocalDOMWindow()); | 332 DCHECK(eventTarget.toLocalDOMWindow()); |
| 333 if (getNetworkState() == HTMLMediaElement::NETWORK_EMPTY) { | 333 if (getNetworkState() == HTMLMediaElement::NETWORK_EMPTY) { |
| 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::HAVE_METADATA) { |
| 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 (!sw || !sh) { | 341 if (!ImageBitmap::isSWSHValid(sw, sh, exceptionState)) |
| 342 exceptionState.throwDOMException(IndexSizeError, String::format("The sou
rce %s provided is 0.", sw ? "height" : "width")); | |
| 343 return ScriptPromise(); | 342 return ScriptPromise(); |
| 344 } | 343 if (!ImageBitmap::isResizeOptionValid(options, exceptionState)) |
| 344 return ScriptPromise(); |
| 345 return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::creat
e(this, IntRect(sx, sy, sw, sh), eventTarget.toLocalDOMWindow()->document(), opt
ions)); | 345 return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::creat
e(this, IntRect(sx, sy, sw, sh), eventTarget.toLocalDOMWindow()->document(), opt
ions)); |
| 346 } | 346 } |
| 347 | 347 |
| 348 } // namespace blink | 348 } // namespace blink |
| OLD | NEW |