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

Unified Diff: Source/core/html/HTMLCanvasElement.idl

Issue 795833004: Use dictionaries for context creation attributes. Eliminate custom bindings. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLCanvasElement.idl
diff --git a/Source/core/html/HTMLCanvasElement.idl b/Source/core/html/HTMLCanvasElement.idl
index 5f97987d6c470a235eaebfe8727debe77b9489e2..c509a959b5a86bec9a91cb3bfef538e8b4939ca5 100644
--- a/Source/core/html/HTMLCanvasElement.idl
+++ b/Source/core/html/HTMLCanvasElement.idl
@@ -24,6 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+typedef (CanvasRenderingContext2D or WebGLRenderingContext) RenderingContext;
+
interface HTMLCanvasElement : HTMLElement {
attribute long width;
@@ -31,6 +33,8 @@ interface HTMLCanvasElement : HTMLElement {
[Custom, RaisesException] DOMString toDataURL([TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? type);
- // The custom binding is needed to handle context creation attributes.
- [Custom] any getContext([Default=Undefined] optional DOMString contextId);
+ // Note: this differs deliberately from the specified Web IDL for this function:
+ // RenderingContext? getContext(DOMString contextId, any... arguments);
+ // in order to eliminate the custom binding. It is functionally equivalent.
+ RenderingContext getContext([Default=Undefined] optional DOMString contextId, optional CanvasContextCreationAttributes attributes);
bashi 2014/12/12 00:35:24 The return value is not nullable. Is this intentio
Ken Russell (switch to Gerrit) 2014/12/12 06:59:31 No, that was an accident, and the code generator w
};

Powered by Google App Engine
This is Rietveld 408576698