| 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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 (!sw || !sh) { |
| 342 exceptionState.throwDOMException(IndexSizeError, String::format("The sou
rce %s provided is 0.", sw ? "height" : "width")); | 342 exceptionState.throwDOMException(IndexSizeError, String::format("The sou
rce %s provided is 0.", sw ? "height" : "width")); |
| 343 return ScriptPromise(); | 343 return ScriptPromise(); |
| 344 } | 344 } |
| 345 if ((options.hasResizeWidth() && options.resizeWidth() <= 0) || (options.has
ResizeHeight() && options.resizeHeight() <= 0)) { |
| 346 exceptionState.throwDOMException(InvalidStateError, "The resizeWidth or/
and resizeHeight is less than or equals to 0."); |
| 347 return ScriptPromise(); |
| 348 } |
| 345 return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::creat
e(this, IntRect(sx, sy, sw, sh), eventTarget.toLocalDOMWindow()->document(), opt
ions)); | 349 return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::creat
e(this, IntRect(sx, sy, sw, sh), eventTarget.toLocalDOMWindow()->document(), opt
ions)); |
| 346 } | 350 } |
| 347 | 351 |
| 348 } // namespace blink | 352 } // namespace blink |
| OLD | NEW |