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

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

Issue 1761003003: Use a union typdef for the return type of canvas.getContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: final touches Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLCanvasElement.idl
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl b/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl
index 15e7e501013358ba0c18fdce61628b3026ea8c88..0f07c5a0479d6658190ed88c221cbbfdb1be12a9 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl
@@ -28,26 +28,13 @@
interface HTMLCanvasElement : HTMLElement
{
+ // Note: Due to dependecies on modules, getContext is defined in a partial
+ // interface in HTMLCanvasElementModule.idl
+
// FIXME: width and height should be unsigned long.
attribute long width;
attribute long height;
- // 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.
- //
- // The PermissiveDictionaryConversion extended attribute is needed to allow the
- // autogenerated code to match the behavior of the custom binding. Web IDL
- // requires throwing TypeError if the incoming argument is not an object type
- // (and is not undefined or null). The binding must ignore this.
- //
- // Also note: the only reason this must return type "any" is to allow the
- // InspectorInstrumentation wrappers to be called for canvases. If that could be
- // handled differently the return type could be changed to "RenderingContext?"
- // and the [CallWith=ScriptState] extended attribute removed.
- //
- [CallWith=ScriptState] any getContext(DOMString contextId, [PermissiveDictionaryConversion] optional CanvasContextCreationAttributes attributes);
-
// Note: The arguments argument is variadic in the spec, but not here as
// only one extra argument is actually used.
// FIXME: type should not have a default value.

Powered by Google App Engine
This is Rietveld 408576698