Skip to content

Commit

Permalink
Remove default value for interface attributes. (#3624)
Browse files Browse the repository at this point in the history
Per the bug report, Web IDL syntax does not allow default values to be
specified for these attributes. Instead, specify the initial values
for the drawingBufferColorSpace and unpackColorSpace attributes as
comments in the spec.

Fixes #3407.
  • Loading branch information
kenrussell authored Feb 22, 2024
1 parent 8f01dfe commit 5c61c39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions specs/latest/1.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1773,8 +1773,11 @@ <h3><a name="WEBGLRENDERINGCONTEXT">The WebGL context</a></h3>
readonly attribute GLsizei drawingBufferWidth;
readonly attribute GLsizei drawingBufferHeight;
readonly attribute GLenum drawingBufferFormat;
attribute PredefinedColorSpace drawingBufferColorSpace = "srgb";
attribute PredefinedColorSpace unpackColorSpace = "srgb";

/* Upon context creation, drawingBufferColorSpace and unpackColorSpace both
default to the value "srgb". */
attribute PredefinedColorSpace drawingBufferColorSpace;
attribute PredefinedColorSpace unpackColorSpace;

[WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes();
[WebGLHandlesContextLoss] boolean isContextLost();
Expand Down
9 changes: 6 additions & 3 deletions specs/latest/1.0/webgl.idl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// WebGL IDL definitions scraped from the Khronos specification:
// https://www.khronos.org/registry/webgl/specs/latest/

// Copyright (c) 2023 The Khronos Group Inc.
// Copyright (c) 2024 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and/or associated documentation files (the
Expand Down Expand Up @@ -540,8 +540,11 @@ interface mixin WebGLRenderingContextBase
readonly attribute GLsizei drawingBufferWidth;
readonly attribute GLsizei drawingBufferHeight;
readonly attribute GLenum drawingBufferFormat;
attribute PredefinedColorSpace drawingBufferColorSpace = "srgb";
attribute PredefinedColorSpace unpackColorSpace = "srgb";

/* Upon context creation, drawingBufferColorSpace and unpackColorSpace both
default to the value "srgb". */
attribute PredefinedColorSpace drawingBufferColorSpace;
attribute PredefinedColorSpace unpackColorSpace;

[WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes();
[WebGLHandlesContextLoss] boolean isContextLost();
Expand Down

0 comments on commit 5c61c39

Please sign in to comment.