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

Unified Diff: core/html/HTMLCanvasElement.idl

Issue 1660113002: Updated to Chrome 45 (2454) moved from SVN to git. Base URL: https://github.com/dart-lang/webcore.git@roll_45
Patch Set: Created 4 years, 11 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
« no previous file with comments | « core/html/HTMLButtonElement.idl ('k') | core/html/HTMLCollection.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/html/HTMLCanvasElement.idl
diff --git a/core/html/HTMLCanvasElement.idl b/core/html/HTMLCanvasElement.idl
index 47c796bd202b8ea22844b3f3e1a4fff50b9a1049..458e8ab62eefa8290ff77ce7d0925f43ac07393e 100644
--- a/core/html/HTMLCanvasElement.idl
+++ b/core/html/HTMLCanvasElement.idl
@@ -24,17 +24,32 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface HTMLCanvasElement : HTMLElement {
+// https://html.spec.whatwg.org/#the-canvas-element
+interface HTMLCanvasElement : HTMLElement {
+ // FIXME: width and height should be unsigned long.
attribute long width;
attribute long height;
- // FIXMEDART: Upstream: Added the optional quality param that V8 accepts.
- [Custom, RaisesException] DOMString toDataURL([TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? type, optional float quality);
+ // 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.
+ //
+ // FIXME: The contextId argument should not be optional.
+ [CallWith=ScriptState] any getContext([Default=Undefined] optional DOMString contextId, [PermissiveDictionaryConversion] optional CanvasContextCreationAttributes attributes);
- // FIXMEDART:
- // - Upstream: Added the optional quality param that V8 accepts.
- // - Return RenderingContext.
- // The custom binding is needed to handle context creation attributes.
- [Custom] any getContext([Default=Undefined] optional DOMString contextId, optional Dictionary attrs);
+ // Note: The arguments argument is variadic in the spec, but not here as
+ // only one extra argument is actually used.
+ // FIXME: type should not be nullable or have a default value.
+ [RaisesException] DOMString toDataURL(optional DOMString? type = null, optional any arguments);
};
« no previous file with comments | « core/html/HTMLButtonElement.idl ('k') | core/html/HTMLCollection.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698