[Webkit-unassigned] [Bug 70117] Expose HTMLCanvasElement supportsContext

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 31 12:44:42 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=70117





--- Comment #17 from Sam Weinig <sam at webkit.org>  2013-05-31 12:43:13 PST ---
(From update of attachment 203462)
View in context: https://bugs.webkit.org/attachment.cgi?id=203462&action=review

> Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp:123
> +        WebGLContextAttributes* webGLAttrs = static_cast<WebGLContextAttributes*>(attrs.get());
> +        if (exec->argumentCount() > 1 && exec->argument(1).isObject()) {
> +            JSObject* jsAttrs = exec->argument(1).getObject();
> +            Identifier alpha(exec, "alpha");
> +            if (jsAttrs->hasProperty(exec, alpha))
> +                webGLAttrs->setAlpha(jsAttrs->get(exec, alpha).toBoolean(exec));
> +            Identifier depth(exec, "depth");
> +            if (jsAttrs->hasProperty(exec, depth))
> +                webGLAttrs->setDepth(jsAttrs->get(exec, depth).toBoolean(exec));
> +            Identifier stencil(exec, "stencil");
> +            if (jsAttrs->hasProperty(exec, stencil))
> +                webGLAttrs->setStencil(jsAttrs->get(exec, stencil).toBoolean(exec));
> +            Identifier antialias(exec, "antialias");
> +            if (jsAttrs->hasProperty(exec, antialias))
> +                webGLAttrs->setAntialias(jsAttrs->get(exec, antialias).toBoolean(exec));
> +            Identifier premultipliedAlpha(exec, "premultipliedAlpha");
> +            if (jsAttrs->hasProperty(exec, premultipliedAlpha))
> +                webGLAttrs->setPremultipliedAlpha(jsAttrs->get(exec, premultipliedAlpha).toBoolean(exec));
> +            Identifier preserveDrawingBuffer(exec, "preserveDrawingBuffer");
> +            if (jsAttrs->hasProperty(exec, preserveDrawingBuffer))

These toBooleans() can all throw exceptions, so we should probably be checking for exceptions.  We should also make sure we are testing all those cases as well.  Can this use a JSDictionary to simplify things?

>> Source/WebCore/html/HTMLCanvasElement.idl:41
>> +    [Custom] any supportsContext([Default=Undefined] optional DOMString contextId);
> 
> Weird that the IDL doesn't mention the attributes parameter. Not your problem.

You should make it match the spec and have a "any... arguments" second parameter.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list