Bug 117169

Summary: HTMLCanvasElement should have helper method to check attributes
Product: WebKit Reporter: Ruth Fong <ruthiecftg>
Component: CanvasAssignee: Nobody <webkit-unassigned>
Status: UNCONFIRMED ---    
Severity: Minor CC: dino, tonikitoo, webkit-bug-importer
Priority: P4 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Ruth Fong 2013-06-03 14:20:23 PDT
getContext and supportsContext, which will be implemented once the patch for bug 70117 is landed, each accept a contextId parameter (i.e. '2d', 'webkit-3d', etc.) and any number of attribute parameters. According to the WebGL specification, 3d attributes are currently the following booleans: 'alpha', 'depth', 'stencil', 'antialias', 'premultipliedAlpha', 'preserveDrawingBuffer' (http://www.khronos.org/registry/webgl/specs/latest/#context-creation-parameters).

A static helper function should be written that accepts the attributes that would be passed into getContext and supportsContext and checks that they are valid, i.e. they are the right type and right names. 

For instance, getContext('2d', {'not_alpha' -> true, 'alpha' -> 4}) has malformed attributes as its second parameter and should return false.
Comment 1 Radar WebKit Bug Importer 2013-06-03 14:20:31 PDT