Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLVideoElement.cpp

Issue 2035113002: Implement ImageBitmapOptions resize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: spec is clear, patch is now ready Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698