OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // The spec for HTMLCanvasElement.getContext() defines the context |
| 6 // creation attributes as type "any". In order to eliminate custom |
| 7 // bindings for getContext(), we define a dictionary that contains the |
| 8 // union of all of the context types' attributes. Note that it is not |
| 9 // possible to use a union type for this purpose because two dictionary |
| 10 // types are not distinguishable. |
| 11 // |
| 12 // Fortunately, there aren't any context creation attributes which are |
| 13 // defined with different default values in different context |
| 14 // specifications. (The "alpha" value, in particular, has a default |
| 15 // value of true for both the Canvas2D and WebGL specifications.) |
| 16 // |
| 17 // N.B.: Web IDL doesn't support multiple inheritance of dictionaries. |
| 18 |
| 19 dictionary CanvasContextCreationAttributes { |
| 20 // Canvas 2D attributes |
| 21 boolean alpha = true; // Also used for WebGL. |
| 22 // Note: the bindings generator ignores the RuntimeEnabled |
| 23 // extended attribute for dictionary members. |
| 24 [RuntimeEnabled=ExperimentalCanvasFeatures] DOMString storage; |
| 25 |
| 26 // WebGL attributes |
| 27 boolean depth = true; |
| 28 boolean stencil = false; |
| 29 boolean antialias = true; |
| 30 boolean premultipliedAlpha = true; |
| 31 boolean preserveDrawingBuffer = false; |
| 32 boolean failIfMajorPerformanceCaveat = false; |
| 33 }; |
OLD | NEW |