Search completed in 1.18 seconds.
XRWebGLLayer.ignoreDepthValues - Web APIs
The read-only XRWebGLLayer property ignore
DepthValues is a Boolean value which is true if the session has been configured to ignore the values in the
depth buffer while rendering the scene. If the
depth buffer is being used to determine the position of vertices, this property is false. The value of ignore
DepthValues can only be set when the XRWebGLLayer is instantiated, by setting the corresponding value in the XRWebGLLayerInit object specified as the constructor's layerInit parameter. As a parameter you're likely to set yourself, it is unlikely you'll need to read it later, but it's available if the need arises. ...
...Otherwise, if this is true, the
depth buffer's values are being used to assist in placing objects in the scene. ...
...Otherwise, if this is true, the
depth buffer's values are being used to assist in placing objects in the scene. ...
...And 5 more matches
XRWebGLLayerInit.ignoreDepthValues - Web APIs
The XRWebGLLayerInit dictionary's Boolean ignore
DepthValues property can be provided in the options passed into the XRWebGLLayer() constructor to indicate that the
depth buffer, if it exists, should be ignored while composing the scene. The
depth buffer is typically used to assist in ordering vertices and, by extension, polygons while compositing, to ensure that the scene is correctly composited, with objects the correct distance away and with clipping and other distance-related computations performed as accurately as possible. Without the
depth buffer, these computations must rely entirely on the coordinates of each pixel. ...
...ically used to assist in ordering vertices and, by extension, polygons while compositing, to ensure that the scene is correctly composited, with objects the correct distance away and with clipping and other distance-related computations performed as accurately as possible. Without the
depth buffer, these computations must rely entirely on the coordinates of each pixel. This property differs from
depth in that
depth requests a WebGL layer that does not have a
depth buffer at all, while ignore
DepthValues merely asks that the
depth layer be ignored. Syntax let layerInit = { ignore
DepthValues: boolValue }; let glLayer = new XRWebGLLayer(xrSession, gl, layerInit); let glLayer = new XRWebGLLayer(xrSession, gl, { ignore
DepthValues: boolValue }); Value A Boolean value which can be set to true ...
...WebGL layer that does not have a
depth buffer at all, while ignore
DepthValues merely asks that the
depth layer be ignored. Syntax let layerInit = { ignore
DepthValues: boolValue }; let glLayer = new XRWebGLLayer(xrSession, gl, layerInit); let glLayer = new XRWebGLLayer(xrSession, gl, { ignore
DepthValues: boolValue }); Value A Boolean value which can be set to true to disable the use of the
depth buffer by the WebGL rendering layer created by the XRWebGLLayer() constructor. The default value, false, means the
depth buffer will be used, if available. Usage notes If ignore
DepthValues is true, the WebXR compositor will ignore the contents of the
depth buffer, if it exists, while compositing and rendering the scene. If false, the
depth buffer's contents are used, if one is present. Using a...
...And 5 more matches
WebGLRenderingContext.depthMask() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'gl
DepthMask' in that specification. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'gl
DepthMask' in that specification. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'gl
DepthMask' in that specification. ...
...And 3 more matches
WebGLRenderingContext.depthFunc() - Web APIs
The WebGLRenderingContext.
depthFunc() method of the WebGL API specifies a function that compares incoming pixel
depth to the current
depth buffer value. Syntax void gl.
depthFunc(func); Parameters func A GLenum specifying the
depth comparison function, which sets the conditions under which the pixel will be drawn. The default value is gl.LESS. ...
...GL API specifies a function that compares incoming pixel
depth to the current
depth buffer value. Syntax void gl.
depthFunc(func); Parameters func A GLenum specifying the
depth comparison function, which sets the conditions under which the pixel will be drawn. The default value is gl.LESS. ...
...ent
depth buffer value. Syntax void gl.
depthFunc(func); Parameters func A GLenum specifying the
depth comparison function, which sets the conditions under which the pixel will be drawn. The default value is gl.LESS. ...
...And 2 more matches
WEBGL_depth_texture - Web APIs
Extended methods This extension extends WebGLRenderingContext.texImage2D(): The format and internalformat parameters now accept gl.
DEPTH_COMPONENT and gl.
DEPTH_STENCIL. ...
...od. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is only available to WebGL1 contexts. In WebGL2, the functionality of this extension is available on the WebGL2 context by default. The constant in WebGL2 is gl.UNSIGNED_INT_24_8. Constants This extension adds a new constant: ext.UNSIGNED_INT_24_8_WEBGL Unsigned integer type for 24-bit
depth texture data. Extended methods This extension extends WebGLRenderingContext.texImage2D(): The format and internalformat parameters now accept gl.
DEPTH_COMPONENT and gl.
DEPTH_STENCIL. The type parameter now accepts gl.UNSIGNED_SHORT, gl.UNSIGNED_INT, and ext.UNSIGNED_INT_24_8_WEBGL. The pixels parameter now accepts an ArrayBufferView of type Uint16Array and Uint32Array. This extension ex...
... The format and internalformat parameters now accept gl.
DEPTH_COMPONENT and gl.
DEPTH_STENCIL. The type parameter now accepts gl.UNSIGNED_SHORT, gl.UNSIGNED_INT, and ext.UNSIGNED_INT_24_8_WEBGL. The pixels parameter now accepts an ArrayBufferView of type Uint16Array and Uint32Array. This extension extends WebGLRenderingContext.framebufferTexture2D(): The attachment parameter now accepts gl.
DEPTH_STENCIL_ATTACHMENT. Incorrectly stated as the target parameter in the specification, see https://www.khronos.org/bugzilla/show_bug.cgi?id=674. ...
...e pixels parameter now accepts an ArrayBufferView of type Uint16Array and Uint32Array. This extension extends WebGLRenderingContext.framebufferTexture2D(): The attachment parameter now accepts gl.
DEPTH_STENCIL_ATTACHMENT. Incorrectly stated as the target parameter in the specification, see https://www.khronos.org/bugzilla/show_bug.cgi?id=674. Examples var ext = gl.getExtension('WEBGL_
depth_texture'); gl.texImage2D(gl.TEXTURE_2D, 0, gl.
DEPTH_COMPONENT, 512, 512, 0, gl.
DEPTH_COMPONENT, gl.UNSIGNED_SHORT, null); Specifications Specification Status Comment WEBGL_
depth_textureThe definition of 'WEBGL_
depth_texture' in that specification. Recommendation Initial definition. ...
XRWebGLLayerInit.depth - Web APIs
When using the XRWebGLLayer() constructor to create a new WebGL rendering layer for WebXR, providing as the layerInit parameter an object whose
depth property is false will request that the new layer be created without a
depth buffer. Syntax let layerInit = {
depth: false }; let glLayer = new XRWebGLLayer(xrSession, gl, layerInit); let glLayer = new XRWebGLLayer(xrSession, gl, {
depth: false }); Value A Boolean which can be set to false to specify that the new WebGL layer should not have a
depth buffer. This means that the only source for
depth information is the vertex coordinates, and reduces the accuracy and quality of rendering, but may potentially affect the performance of rendering as well. The default value is true. Usage notes This property differs from ignore
DepthValues i...
...set to false to specify that the new WebGL layer should not have a
depth buffer. This means that the only source for
depth information is the vertex coordinates, and reduces the accuracy and quality of rendering, but may potentially affect the performance of rendering as well. The default value is true. ...
...L layer should not have a
depth buffer. This means that the only source for
depth information is the vertex coordinates, and reduces the accuracy and quality of rendering, but may potentially affect the performance of rendering as well. The default value is true. Usage notes This property differs from ignore
DepthValues in that a layer created with ignore
DepthValues set to true may still have a
depth buffer, but will not make use of it. You can determine whether or not the
depth buffer is being used by a given WebGL rendering layer during your XR session by checking the value returned by XRWebGLLayer.ignore
DepthValues. If this is true, then the
depth buffer is either not present or is being ignored. ...
... a layer created with ignore
DepthValues set to true may still have a
depth buffer, but will not make use of it. You can determine whether or not the
depth buffer is being used by a given WebGL rendering layer during your XR session by checking the value returned by XRWebGLLayer.ignore
DepthValues. If this is true, then the
depth buffer is either not present or is being ignored. if (glLayer.ignore
DepthValues) { /* not using the
depth buffer */ } Example In this example, a new XRWebGLLayer is created for a WebXR session, xrSession, without a
depth buffer. xrSession.updateRenderState({ baseLayer: new XRWebGLLayer(xrSession, gl, {
depth: false }); }); Specifications Specification Status Comment WebXR Device APIThe definition of 'XRWebGLLayerInit.
depth' in th...
WebGLRenderingContext.depthRange() - Web APIs
The WebGLRenderingContext.
depthRange() method of the WebGL API specifies the
depth range mapping from normalized device coordinates to window or viewport coordinates. Syntax void gl.
depthRange(zNear, zFar); Parameters zNear A GLclampf specifying the mapping of the near clipping plane to window or viewport coordinates. Clamped to the range 0 to 1 and must be less than or equal to zFar. The default value is 0. zFar A GLclampf specifying the mapping of the far clipping plane to window or viewport coordinates. Clamped to the range 0 to 1. The default value is 1. Return value None. ...
...Parameters zNear A GLclampf specifying the mapping of the near clipping plane to window or viewport coordinates. Clamped to the range 0 to 1 and must be less than or equal to zFar. The default value is 0. zFar A GLclampf specifying the mapping of the far clipping plane to window or viewport coordinates. Clamped to the range 0 to 1. The default value is 1. Return value None. Examples gl.
depthRange(0.2, 0.6); To check the current
depth range, query the
DEPTH_RANGE constant which returns a Float32Array gl.getParameter(gl.
DEPTH_RANGE); // Float32Array[0.2, 0.6] Specifications Specification Status Comment WebGL 1.0The definition of '
depthRange' in that specification. Recommendation Initial definition. Unlike OpenGL, WebGL requires zNear and zFar values ...
... Standard Man page of the OpenGL API. ...
EXT_frag_depth - Web APIs
The EXT_frag_
depth extension is part of the WebGL API and enables to set a
depth value of a fragment from within the fragment shader. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is only available to WebGL1 contexts. In WebGL2, the functionality of this extension is available on the WebGL2 context by default. It requires GLSL #version 300 es. ...
...s are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is only available to WebGL1 contexts. In WebGL2, the functionality of this extension is available on the WebGL2 context by default. It requires GLSL #version 300 es. Examples Enable the extension: gl.getExtension('EXT_frag_
depth'); Now the output variable gl_Frag
DepthEXT is available to set a
depth value of a fragment from within the fragment shader: <script type="x-shader/x-fragment"> void main() { gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0); gl_Frag
DepthEXT = 0.5; } </script> Specifications Specification Status Comment EXT_frag_
depthThe definition of 'EXT_frag_
depth' in that specification. ...
WebGLRenderingContext.clearDepth() - Web APIs
The WebGLRenderingContext.clear
Depth() method of the WebGL API specifies the clear value for the
depth buffer. This specifies what
depth value to use when calling the clear() method. The value is clamped between 0 and 1. Syntax void gl.clear
Depth(
depth); Parameters
depth A GLclampf specifying the
depth value used when the
depth buffer is cleared. Default value: 1. Return value None. Examples gl.clear
Depth(0.5); To get the current
depth clear value, query the
DEPTH_CLEAR_VALUE constant. gl.getParameter(gl.
DEPTH_CLEAR_VALUE); // 0.5 Specifications Specification Status Comment WebGL 1.0The definition of 'clear
Depth' in that specification. Recommendation Initial definition. ...
... Return value None. Examples gl.clear
Depth(0.5); To get the current
depth clear value, query the
DEPTH_CLEAR_VALUE constant. gl.getParameter(gl.
DEPTH_CLEAR_VALUE); // 0.5 Specifications Specification Status Comment WebGL 1.0The definition of 'clear
Depth' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glClear
Depthf' in that specification. Standard Man page of the OpenGL API. ...
In depth: Microtasks and the JavaScript runtime environment - Web APIs
should be run and other information critical to that context's operation. By using the contexts and the context stack in this manner, many of the fundamentals of how a program operates can be managed, including local and global variables, function calls and returns, and so forth. A special note about recursive functions--that is, functions which call themselves, possibly over multiple levels of
depth or recursion: each recursive call to the function creates a new execution context. This allows the JavaScript runtime to track the levels of recursion and the return of results through that recursion, but it also means that each time a function recurses, more memory is needed to create the new context. Run, JavaScript, run To run JavaScript code, the runtime engine maintains a set of agents in ...
Screen.colorDepth - Web APIs
The Screen.color
Depth read-only property returns the color
depth of the screen. Per the CSSOM, some implementations return 24 for compatibility reasons. See the browser compatibility section for those that don't. Syntax bit
Depth = window.screen.color
Depth; Example // Check the color
depth of the screen if ( window.screen.color
Depth < 8) { // Use low-color version of page } else { // Use regular, colorful page } Specification Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'Screen.color
Depth' in that specification. Working Draft ...
Screen.pixelDepth - Web APIs
Returns the bit
depth of the screen. Per the CSSOM, some implementations return 24 for compatibility reasons. See the browser compatibility section for those that don't. Syntax let
depth = window.screen.pixel
Depth Example // if there is not adequate bit
depth // choose a simpler color if ( window.screen.pixel
Depth > 8 ) { document.style.color = "#FAEBD7"; } else { document.style.color = "#FFFFFF"; } Specifications Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'Screen.pixel
Depth' in that specification. Working Draft Initial definition. ...
XRRenderState.depthFar - Web APIs
The
depthFar read-only property of the XRRenderState interface returns the distance in meters of the far clip plane from the viewer. Syntax var aDouble = XRRenderState.
depthFar; Value A Number. Specifications Specification Status Comment UnknownThe definition of 'XRRenderState.
depthFar' in that specification. Unknown Initial definition. ...
XRRenderState.depthNear - Web APIs
The
depthNear read-only property of the XRRenderState interface returns the distance in meters of the near clip plane from the viewer. Syntax var aDouble = XRRenderState.
depthNear; Value A Number. Specifications Specification Status Comment UnknownThe definition of 'XRRenderState.
depthNear' in that specification. Unknown Initial definition. ...
WebGL constants - Web APIs
resources on how to get started with WebGL. Table of contents Standard WebGL 1 constants Standard WebGL 2 constants WebGL extension constants Standard WebGL 1 constants These constants are defined on the WebGLRenderingContext interface. Clearing buffers Constants passed to WebGLRenderingContext.clear() to clear buffer masks. Constant name Value Description
DEPTH_BUFFER_BIT 0x00000100 Passed to clear to clear the current
depth buffer. STENCIL_BUFFER_BIT 0x00000400 Passed to clear to clear the current stencil buffer. COLOR_BUFFER_BIT 0x00004000 Passed to clear to clear the current color buffer. Rendering primitives Constants passed to WebGLRenderingContext.drawElements() or WebGLRenderingContext.drawArrays() to s...
...rameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1. CULL_FACE_MODE 0x0B45 Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK FRONT_FACE 0x0B46 Passed to getParameter to determine the current value of frontFace. Should return CW or CCW. ...
..., and hight at 1. CULL_FACE_MODE 0x0B45 Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK FRONT_FACE 0x0B46 Passed to getParameter to determine the current value of frontFace. Should return CW or CCW.
DEPTH_RANGE 0x0B70 Passed to getParameter to return a length-2 array of floats giving the current
depth range.
DEPTH_WRITEMASK 0x0B72 Passed to getParameter to determine if the
depth write mask is enabled.
DEPTH_CLEAR_VALUE 0x0B73 Passed to getParameter to determine the current
depth clear value.
DEPTH_FUNC 0x0B74 Passed to getParameter to get the current
depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL. S...
...And 20 more matches
Index - Web APIs
ty, Reference, x The DOMPoint interface's x property holds the horizontal coordinate, x, for a point in space. 733 DOMPoint.y API, Coordinate, DOM, DOMPoint, Geometry, Geometry Interfaces, Point, Property, Reference, y The DOMPoint interface's y property holds the vertical coordinate, y, for a point in space. 734 DOMPoint.z API, Coordinate, DOM, DOMPoint,
Depth, Geometry, Geometry Interfaces, Point, Position, Property, Reference, z The DOMPoint interface's z property specifies the
depth coordinate of a point in space. 735 DOMPointInit API, Coordinates, DOM, DOMPointInit, Dictionary, Geometry, Geometry Interfaces, Interface, Point, Reference The DOMPointInit dictionary is used to provide the values of the coordinates and perspe...
...s read-only version of the DOMPoint object. 746 DOMPointReadOnly.y API, Coordinates, DOM, DOMPointReadOnly, Geometry, Geometry Interfaces, Point, Property, Read-only, Reference, Vertical, y The DOMPointReadOnly interface's y property holds the vertical coordinate, y, for a read-only point in space. 747 DOMPointReadOnly.z API, Coordinates, DOM, DOMPointReadOnly,
Depth, Geometry, Geometry Interfaces, Point, Property, Read-only, Reference, z The DOMPointReadOnly interface's z property holds the
depth coordinate, z, for a read-only point in space. 748 DOMQuad API, DOM, DOM Reference, DOMQuad, Experimental, Geometry A DOMQuad is a collection of four DOMPoints defining the corners of an arbitrary quadrilateral. Returning DOMQuads lets get...
... DocumentFragment() API, Constructor, DOM, DocumentFragment, Experimental The DocumentFragment() constructor returns a new, empty DocumentFragment object . ...
...And 16 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
ditional makefiles. Secondly, it instructs the build system to create a new extension, rather than copying the components directly into Firefox's binary directory. The main advantage of using an extension is that it is easy to package everything up and install it on another machine. ...
...an copying the components directly into Firefox's binary directory. The main advantage of using an extension is that it is easy to package everything up and install it on another machine. So here's your basic, plain-vanilla top-level makefile (Makefile.in in the main extension directory):
DEPTH = ../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ include $(
DEPTH)/config/autoconf.mk MODULE = myextension DIRS = public src XPI_NAME = myextension INSTALL_EXTENSION_ID = myextension@mycompany.com XPI_PKGNAME = myextension DIST_FILES = install.rdf include $(topsrcdir)/config/rules.mk A detailed description of the make process, describing the key features of this makefile, can be found here. MODULE and XPI_NAME are both set to th...
...odule if you use these public headers in other modules. Personally I would discourage this practice (among other things, static linking means the same code gets loaded more than once into memory, and the code won't be available from JavaScript or other non-C++ languages) and encourage the use of XPCOM wherever possible. ...
...And 10 more matches
WebGL model view projection - Web APIs
coordinates. A commonly used projection matrix, the perspective projection matrix, is used to mimic the effects of a typical camera serving as the stand-in for the viewer in the 3D virtual world. The view matrix is responsible for moving the objects in the scene to simulate the position of the camera being changed, altering what the viewer is currently able to see. The sections below offer an in-
depth look into the ideas behind and implementation of the model, view, and projection matrices. These matrices are core to moving data around on the screen, and are concepts that transcend individual frameworks and engines. Clip space In a WebGL program, data is typically uploaded to the GPU with its own coordinate system and then the vertex shader transforms those points into a special coordinate s...
...del data is used that is in some arbitrary coordinate system, and is then transformed using a matrix, converting the model coordinates into the clip space coordinate system. For this example, it's easiest to illustrate how clip space works by simply using model coordinate values ranging from (-1,-1,-1) to (1,1,1). The code below will create 2 triangles that will draw a square on the screen. The Z
depth in the squares determines what gets drawn on top when the squares share the same space. The smaller Z values are rendered on top of the larger Z values. WebGLBox example This example will create a custom WebGLBox object that will draw a 2D box on the screen. Note: The code for each WebGLBox example is available in this github repo and is organized by section. In addition there is a JSFiddle l...
... WebGLBox.prototype.draw = function(settings) { // Create some attribute data; these are the triangles that will end being // drawn to the screen. There are two that form a square. var data = new Float32Array([ ...
...And 10 more matches
Array.prototype.flat() - JavaScript
Defaults to 1. Return value A new array with the sub-array elements concatenated into it. ...
...Defaults to 1. Return value A new array with the sub-array elements concatenated into it. ...
...Defaults to 1. Return value A new array with the sub-array elements concatenated into it. ...
...And 8 more matches
Web video codec guide - Web media technologies
e trouble with specific kinds of shapes and patterns, or aren't good at replicating sharp edges, or tend to lose detail in dark areas, or any number of possibilities. It all depends on the underlying algorithms and mathematics. ...
...ith specific kinds of shapes and patterns, or aren't good at replicating sharp edges, or tend to lose detail in dark areas, or any number of possibilities. It all depends on the underlying algorithms and mathematics. The potential effect of source video format and contents on the encoded video quality and size Feature Effect on quality Effect on size Color
depth (bit
depth) The higher the color bit
depth, the higher the quality of color fidelity is achieved in the video. Additionally, in saturated portions of the image (that is, where colors are pure and intense, such as a bright, pure red [rgba(255, 0, 0, 1)]), color
depths below 10 bits per component (10-bit color) allow banding, where gradients cannot be represented without visible stepping of the colors. ...
...The determining factor is what internal storage format is used for the compressed data. ...
...And 8 more matches
WebGL2RenderingContext.texImage3D() - Web APIs
The WebGLRenderingContext.texImage3D() method of the WebGL API specifies a three-dimensional texture image. ...
... The WebGLRenderingContext.texImage3D() method of the WebGL API specifies a three-dimensional texture image. ...
...ngContext.texImage3D() method of the WebGL API specifies a three-dimensional texture image. ...
...And 5 more matches
XML data - Archive of obsolete content
formation about XML in Mozilla, see the XML page in this wiki. Action: An XML demonstration Make a new XML file, doc9.xml. Copy and paste the content from here, making sure that you scroll to get all of it: <?xml version="1.0"?> <!-- XML demonstration --> <?xml-stylesheet type="text/css" href="style9.css"?> <!DOCTYPE planet> <planet> <ocean> <name>Arctic</name> <area>13,000</area> <
depth>1,200</
depth> </ocean> <ocean> <name>Atlantic</name> <area>87,000</area> <
depth>3,900</
depth> </ocean> <ocean> <name>Pacific</name> <area>180,000</area> <
depth>4,000</
depth> </ocean> <ocean> <name>Indian</name> <area>75,000</area> <
depth>3,900</
depth> </ocean> <ocean> <name>Southern</name> <area>20,000</area> <
depth>4,500</
depth> </ocean> </planet> Make a new CSS file, style9.css. Copy and...
.... . Notes about this demonstration: The superscript 2 (in "mil...
.... . Notes about this demonstration: The superscript 2 (in "million km2") a Unicode character,...
...And 4 more matches
Image file type and format guide - Web media technologies
ormation; including which versions introduced support and specific special features that may have been introduced later. Image file type details The following sections provide a brief overview of each of the image file types supported by web browsers. In the tables below, the term bits per component refers to the number of bits used to represent each color component. For example, an RGB color
depth of 8 indicates that each of the red, green, and blue components are represented by an 8-bit value. Bit
depth, on the other hand, is the total number of bits used to represent each pixel in memory. APNG (Animated Portable Network Graphics) APNG is a file format first introduced by Mozilla which extends the PNG standard to add support for animated images. Conceptually similar to the animated GIF ...
... APNG is ideal for basic animations that do not need to synchronize to other activities or to a sound track, such as progress indicators, activity throbbers, and other animated sequences. ...
... True color 8 and 16 Each pixel is represented by three D-bit values indicating the level of the red, green, and blue color components. Indexed color 1, 2, 4, and 8 Each pixel is a D-bit value indicating an index into a color palette which is contained within a PLTE chunk in the APNG file; the colors in the palette all use an 8-bit
depth. Greyscale with alpha 8 and 16 Each pixel is represented by two D-bit values: the intensity of the greyscale pixel and an alpha sample, indicating how opaque the pixel is. True color with alpha 8 and 16 Each pixel is comprised of four D-pixel color components: red, green, blue, and the alpha sample indicating how opaque the pix...
...And 4 more matches
How Mozilla's build system works
most makefiles to be simpler. Complete documentation for make is beyond the scope of this document but is available here. One concept you will need be familiar with is variables in make. Variables are defined by the syntax VARIABLE = VALUE, and the value of a variable is referenced by writing $(VARIABLE). All variables are strings. All Makefile.in files in Mozilla have the same basic format:
DEPTH = ../../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ include $(
DEPTH)/config/autoconf.mk # ... Main body of makefile goes here ... include $(topsrcdir)/config/rules.mk # ... Additional rules go here ... The
DEPTH variable should be set to the relative path from your Makefile.in to the top-level Mozilla directory. topsrcdir is subs...
...ibrary. Static libraries may also be linked into an executable. Non-component shared libraries A non-component shared library is useful when there is common code that several components need to share and sharing it through XPCOM is not appropriate or not possible. As an example, below is a portion of the makefile for libmsgbaseutil, which is linked against by all of the main news components:
DEPTH = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ include $(
DEPTH)/config/autoconf.mk MODULE = msgbaseutil LIBRARY_NAME = msgbaseutil EXPORT_LIBRARY = 1 SHORT_LIBNAME = msgbsutl Notice that the only change from the component example above is that IS_COMPONENT is not set. When this is not set, a shared library will b...
...ary will be created and installed to dist/bin. Static libraries As mentioned above, static libraries are most commonly used as intermediate steps to building a larger library (usually a component). This lets you spread out the source files in multiple subdirectories. Static libraries may also be linked into an executable. As an example, below is a portion of the makefile from layout/base/src:
DEPTH = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ include $(
DEPTH)/config/autoconf.mk MODULE = layout LIBRARY_NAME = gkbase_s # REQUIRES and CPPSRCS omitted here for brevity # # we don't want the shared lib, but we want to force the creation of a static lib. FORCE_STATIC_LIB = 1 include $(topsrcdir)/config/rules.mk...
...And 3 more matches
WebGL2RenderingContext.texSubImage3D() - Web APIs
The WebGL2RenderingContext.texSubImage3D() method of the WebGL API specifies a sub-rectangle of the current texture. ...
... The WebGL2RenderingContext.texSubImage3D() method of the WebGL API specifies a sub-rectangle of the current texture. ...
... a sub-rectangle of the current texture. ...
...And 3 more matches
WebGLRenderingContext.renderbufferStorage() - Web APIs
t. Possible values: gl.RENDERBUFFER: Buffer data storage for single images in a renderable internal format. internalFormat A Glenum specifying the internal format of the renderbuffer. Possible values: gl.RGBA4: 4 red bits, 4 green bits, 4 blue bits 4 alpha bits. gl.RGB565: 5 red bits, 6 green bits, 5 blue bits. gl.RGB5_A1: 5 red bits, 5 green bits, 5 blue bits, 1 alpha bit. ...
... gl.RENDERBUFFER: Buffer data storage for single images in a renderable internal format. internalFormat A Glenum specifying the internal format of the renderbuffer. Possible values: gl.RGBA4: 4 red bits, 4 green bits, 4 blue bits 4 alpha bits. gl.RGB565: 5 red bits, 6 green bits, 5 blue bits. gl.RGB5_A1: 5 red bits, 5 green bits, 5 blue bits, 1 alpha bit. gl.
DEPTH_COMPONENT16: 16
depth bits. gl.STENCIL_INDEX8: 8 stencil bits. gl.
DEPTH_STENCIL When using a WebGL 2 context, the following values are available additionally: gl.R8 gl.R8UI gl.R8I gl.R16UI gl.R16I gl.R32UI gl.R32I gl.RG8 gl.RG8UI gl.RG8I gl.RG16UI gl.RG16I gl.RG32UI gl.RG32I gl.RGB8 gl.RGBA8 gl.SRGB8_ALPHA8 (also available as an extension fo...
... ext.RGB32F_EXT: RGB 32-bit floating-point type. When using the EXT_sRGB extension: ext.SRGB8_ALPHA8_EXT: 8-bit sRGB and alpha. When using a WebGL 2 context and the ...
...And 3 more matches
The "codecs" parameter in common media types - Web media technologies
ng; if the value is less than that length, it must be padded with leading zeros. AV1 codec parameter string components Component Details P The one-digit profile number: AV1 profile numbers Profile number Description 0 "Main" profile; supports YUV 4:2:0 or monochrome bitstreams with bit
depth of 8 or 10 bits per component. 1 "High" profile adds support for 4:4:4 chroma subsampling. 2 "Professional" profile adds support for 4:2:2 chroma subsampling and 12 bit per component color. LL The two-digit level number, which is converted to the X.Y format level format, where X = 2 + (LL >> 2) and Y = LL & ...
...evel format, where X = 2 + (LL >> 2) and Y = LL & 3. See Appendix A, section 3 in the AV1 Specification for details. T The one-character tier indicator. For the Main tier (seq_tier equals 0), this character is the letter M. For the High tier (seq_tier is 1), this character is the letter H. The High tier is only available for level 4.0 and up. DD The two-digit component bit
depth. This value must be one of 8, 10, or 12; which values are valid varies depending on the profile and other properties. M The one-digit monochrome flag; if this is 0, the video includes the U and V planes in addition to the Y plane. Otherwise, the video data is entirely in the Y plane and is therefore monochromatic. See YUV in Digital video concepts for details on how the YUV color syst...
... Stereo High Profile provides stereoscopic video using two renderings of the scene (left eye and right eye). Otherwise, provides the same features as the High profile. 80 00 Multiview High Profile Supports two or more views using both temporal and MVC inter-view prediction. Does not support field pictures or macroblock-adaptive frame-field coding. 76 00 Multiview
Depth High Profile Based on the High Profile, to which the main substream must adhere. The remaining substreams must match the Stereo High Profile. 8A 00 MPEG-4 audio When the value of an entry in the codecs list begins with mp4a, the syntax of the value should be: mp4a.oo[.A] Here, oo is the two-digit hexadecimal Object Type Indication which specifies the codec class being used for...
...And 3 more matches
MathML Demo: <mspace> - space
Interactive Sizing HTML Content <p> Use the control buttons below to adjust the parameters of the <code>mspace</code> element and see the effects. ...
...eters of the <code>mspace</code> element and see the effects. ...
... see the effects. ...
...And 2 more matches
Bytecode Descriptions
No-op instruction marking the target of a jump instruction. This instruction and a few others (see js::BytecodeIsJumpTarget) are jump target instructions. The Baseline Interpreter uses these instructions to sync the frame's interpreterICEntry after a jump. Ion uses them to find block boundaries when translating bytecode to MIR. Format: JOF_ICINDEX LoopHead Operands: (uint32_t icIndex, uint8_t
depthHint) Marks the target of the backwards jump for some loop. This is a jump target instruction (see JSOp::JumpTarget). Additionally, it checks for interrupts and handles JIT tiering. The
depthHint operand is a loop
depth hint for Ion. It starts at 1 and deeply nested loops all have the same value. For the convenience of the JITs, scripts must not start with this instruction. See bug 1602390. Jum...
...dOffset must be positive and must target a JSOp::JumpTarget instruction followed by JSOp::Finally. The instruction immediately following JSOp::Gosub in the script must be a JSOp::JumpTarget instruction, and resumeIndex must be the index into script->resumeOffsets() that points to that instruction. Note: This op doesn't actually push or pop any values. ...
...ues. Its use count of 2 is a lie to make the stack
depth math work for this very odd control flow instruction. JSOp::Gosub is considered to have two "successors": the target of offset, which is the actual next instruction to run; and the instruction immediately following JSOp::Gosub, even though it won't run until later. We define the successor graph this way in order to support knowing the stack
depth at that instruction without first reading the whole finally block. The stack
depth at that instruction is, as it happens, the current stack
depth minus 2. So this instruction gets nuses == 2. Unfortunately there is a price to be paid in horribleness. When JSOp::Gosub runs, it leaves two values on the stack that the stack
depth math doesn't know about. It jumps to the finally block, where JSOp::Fi...
...And 2 more matches
nsIThreadObserver
may be implemented to let an observer implement a layered event queue. The implementation of this interface must be thread safe. xpcom/threads/nsIThreadInternal.idlScriptable Please add a summary to this article. Last changed in Gecko 1.9 (Firefox 3) Inherits from: nsISupports Method overview void afterProcessNextEvent(in nsIThreadInternal thread, in unsigned long recursion
Depth); void onDispatchedEvent(in nsIThreadInternal thread); void onProcessNextEvent(in nsIThreadInternal thread, in boolean mayWait, in unsigned long recursion
Depth); Methods afterProcessNextEvent() Called by the nsIThread method nsIThread.ProcessNextEvent() after an event is processed. This method is only called on the target thread. Note: It is valid to change the thread'...
... onDispatchedEvent() Called after an event has been dispatched to the thread. This method may be called from any thread. ...
... Called by the nsIThread method nsIThread.ProcessNextEvent() after an event is processed. This method is only called on the target thread. Note: It is valid to change the thread's observer during a call to this method. void afterProcessNextEvent( in nsIThreadInternal thread, in unsigned long recursion
Depth ); Parameters thread The nsIThread on which the event was processed. recursion
Depth The number of calls to nsIThread.ProcessNextEvent() on the call stack in addition to the current call. onDispatchedEvent() Called after an event has been dispatched to the thread. This method may be called from any thread. Note: It is valid to change the thread's observer during a call to this method. void onDispatchedEvent( in nsIThreadInternal thread ); Parameters thread The nsITh...
...And 2 more matches
nsIXPConnect
racer); Native code only! void clearAllWrappedNativeSecurityPolicies(); nsIXPConnectJSObjectHolder createSandbox(in JSContextPtr cx, in nsIPrincipal principal); Native code only! ...
... void flagSystemFile...
... in string aFunctionName, in PRInt32 aLineNumber, in nsIStackFrame aCaller ); Parameters aLanguage Missing Description aFilename Missing Description aFunctionName Missing Description aLineNumber Missing Description aCaller Missing Description Return value Missing Description Exceptions thrown Missing Exception Missing Description debugDump() void debugDump( in short
depth ); Parameters
depth Missing Description Exceptions thrown Missing Exception Missing Description debugDumpEvalInJSStackFrame() void debugDumpEvalInJSStackFrame( in PRUint32 aFrameNumber, in string aSourceText ); Parameters aFrameNumber Missing Description aSourceText Missing Description Exceptions thrown Missing Exception Missing Description debugDumpJSStack() v...
...And 2 more matches
OVR_multiview2.framebufferTextureMultiviewOVR() - Web APIs
The OVR_multiview2.framebufferTextureMultiviewOVR() method of the WebGL API attaches a multiview texture to a WebGLFramebuffer. Syntax void ext.framebufferTextureMultiviewOVR(target, attachment, texture, level, baseViewIndex, numViews); Parameters target A GLenum specifying the binding point (target). Possible values: gl.FRAMEBUFFER: Collection buffer data storage of color, alpha,
depth and stencil buffers used to render an image. gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the texture. Possible values: gl.COLOR_ATTACHMENT0: Attaches the texture to the framebuffer's ...
...sed to render an image. gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the texture. Possible values: gl.COLOR_ATTACHMENT0: Attaches the texture to the framebuffer's color buffer. gl.
DEPTH_ATTACHMENT: Attaches the texture to the framebuffer's
depth buffer. gl.STENCIL_ATTACHMENT: Attaches the texture to the framebuffer's stencil buffer. gl.
DEPTH_STENCIL_ATTACHMENT:
depth and stencil buffer. gl.COLOR_ATTACHMENT1 gl.COLOR_ATTACHMENT2 gl.COLOR_ATTACHMENT3 gl.COLOR_ATTACHMENT4 gl.COLOR_ATTACHMENT5 gl.COLOR_ATTACHMENT6 gl.COLOR_ATTACHMENT7 gl.COLOR_ATTACHMENT8 ...
... texture A WebGLTexture object whose image to attach. level A GLint specifying the mipmap level of the texture image to be attached. Must be 0. baseViewIndex A GLint specifying the base view index of the framebuffer object attachment. numViews A GLsizei specifying the number of views ...
...And 2 more matches
OVR_multiview2 - Web APIs
Shader code #version...
... Shader code #version 300 es #extension GL_OVR_multiview2 : require precision mediump float; la...
... Shader code #version 300 es #extension GL_OVR_multiview2 : require precision mediump float; layout (num_views = 2) in; in vec4 inPos; uniform mat4 u_viewMa...
...And 2 more matches
WebGLRenderingContext.framebufferTexture2D() - Web APIs
The WebGLRenderingContext.framebufferTexture2D() method of the WebGL API attaches a texture to a WebGLFramebuffer. Syntax void gl.framebufferTexture2D(target, attachment, textarget, texture, level); Parameters target A GLenum specifying the binding point (target). Possible values: gl.FRAMEBUFFER: Collection buffer data storage of color, alpha,
depth and stencil buffers used to render an image. When using a WebGL 2 context, the following values are available additionally: gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the texture. Possible v...
...gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the texture. Possible values: gl.COLOR_ATTACHMENT0: Attaches the texture to the framebuffer's color buffer. gl.
DEPTH_ATTACHMENT: Attaches the texture to the framebuffer's
depth buffer. gl.STENCIL_ATTACHMENT: Attaches the texture to the framebuffer's stencil buffer. When using a WebGL 2 context, the following values are available additionally: gl.
DEPTH_STENCIL_ATTACHMENT:
depth and stencil buffer. gl.COLOR_ATTACHMENT1 gl.COLOR_ATTACHMENT2 gl.COLOR_ATTACHMENT3 gl.COLOR_ATTACHMENT4 ...
... textarget A GLenum specifying the texture target. Possible values: gl.TEXTURE_2D: A 2D image. gl.TEXTURE_CUBE_MAP_POSITIVE_X: Image for the positive X face of the cube. gl.TEXTURE_CUBE_MAP_NEGATIVE_X: Image for the negative X face of the cube. gl.TEXTURE_CUBE_MAP_POSITIVE_Y: Image...
...And 2 more matches
WebGLRenderingContext.getParameter() - Web APIs
ext.COMPRESSED_RGBA_ASTC_12x10_KHR ext.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR ext.COMPRESSED_RGBA_ASTC_12x12_KHR ext.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR gl.CULL_FACE GLboolean gl.CULL_FACE_MODE GLenum gl.FRONT, gl.BACK or gl.FRONT_AND_BACK. See also cullFace gl.CURRENT_PROGRAM WebGLProgram or null See useProgram. ...
... ext.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR ext.COMPRESSED_RGBA_ASTC_12x12_KHR ext.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR gl.CULL_FACE GLboolean gl.CULL_FACE_MODE GLenum gl.FRONT, gl.BACK or gl.FRONT_AND_BACK. See also cullFace gl.CURRENT_PROGRAM WebGLProgram or null See useProgram. ...
...R ext.COMPRESSED_RGBA_ASTC_12x12_KHR ext.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR gl.CULL_FACE GLboolean gl.CULL_FACE_MODE GLenum gl.FRONT, gl.BACK or gl.FRONT_AND_BACK. See also cullFace gl.CURRENT_PROGRAM WebGLProgram or null See useProgram. gl.
DEPTH_BITS GLint gl.
DEPTH_CLEAR_VALUE GLfloat gl.
DEPTH_FUNC GLenum gl.
DEPTH_RANGE Float32Array (with 2 elements) gl.
DEPTH_TEST GLboolean gl.
DEPTH_WRITEMASK GLboolean gl.DITHER GLboolean gl.ELEMENT_ARRAY_BUFFER_BINDING WebGLBuffer gl.FRAMEBUFFER_BINDING WebGLFramebuffer or null null corresponds to a binding to the default framebuffer. See also bindFra...
...And 2 more matches
WebGLRenderingContext.polygonOffset() - Web APIs
The default value is 0. Return value None. Examples The polygon offset fill is disabled by default. ...
...The default value is 0. Return value None. Examples The polygon offset fill is disabled by default. ...
...The default value is 0. Return value None. Examples The polygon offset fill is disabled by default. ...
...And 2 more matches
Fundamentals of WebXR - Web APIs
ge of your field of view to the far right edge, and is specified in either degrees or radians. A human eye is typically able to take in a FOV of around 135?. Assuming a person has two healthy eyes, their total field of view is about 200? to 220? wide. Why is the FOV wider with two eyes, but not double the single-eye FOV? It's because the two eyes FOVs overlap a lot. That overlap is what gives us
depth perception; within the overlap area -- which is around 115? across -- we have
depth perception. Outside that overlap area, our vision is monocular and lacks good
depth perception. The drawing shown here demonstrates the concept of FOV. The blue wedge represents the field of view of the leflt eye; the red wedge is the FOV of the right eye. The overlapping area, which is sort of a shade of purple...
...If you look carefully, you'll see that each eye sees the die slightly differently, and the combined view blends the two into a 3D shape. Generally, only the horizontal FOV is specifically defined and managed by applications. For more details about this, see The optics of 3D in Rendering and the WebXR frame animation callback. ...
...es of AR device: Devices which use cameras to capture the world in front of the user, render the WebXR content atop that image, then display the image on a screen. These devices include phones, which show the resulting scene on the device's screen in a 2D presentation, as well as goggles that use a pair of cameras, one for each eye, to capture the scene in stereo in order to retain the world's
depth, with the WebXR scene then rendered for each eye with that eye's captured background in place. Devices which use transparent glasses to allow the user to see the world, while overlaying the rendered image atop the scene. The user is, thus, directly viewing the real world instead of a series of digital photos of it. Both types of device should be capable of also presenting VR sessions. WebXR do...
...And 2 more matches
Rendering and the WebXR frame animation callback - Web APIs
slightly different angle. Since they're a known, fixed distance apart, our brains can do basic geometry and trigonometry and figure out the 3D nature of reality from that information. We also make use of perspective, size differences, and even simply our understanding of how things usually look to figure out the details of that third dimension. These factors, among others, are the source of our
depth perception. To create the illusion of three dimensions when rendering graphics, we need to simulate as many of these factors as we can. The more of these we simulate--and the more accurately we do so--the better able we are to trick the human brain into perceiving our images in 3D. The advantage to XR is that not only can we use the classic monocular techniques to simulate 3D graphics (perspecti...
...of center) This way, we place the positions of the viewer's eyes at an average human pupillary distance of 64mm. That distance (or whatever pupillary distance the XR system is configured to use) is enouigh to allow our minds to see just enough difference due to retinal disparity (the difference in what each retina sees) and the parallax effect to allow our brains to calculate the distance to and
depth of objects, thus enabling us to percieve three dimensions despite our retinas only being 2D surfaces. This is illustrated in the diagram below, in which we see how each eye perceives a die located directly in front of the viewer. While this diagram exaggerates the effect in some respects for illustrative purposes, the concept is the same. Each eye sees an area whose boundaries make up an arc in ...
...obe. Tha brain takes those signals from the left and right eyes and constructs a single, unified, 3D image of the world in the viewer's brain, and that image is what is seen. And because of those differences between what is seen by the left eye versus the right eye, the brain is able to infer a great deal of information about how deep the object is, its size, and more. By combining that inferred
depth information with other cues such as perspective, shadows, memories of what these relationships mean, and so forth, we can figure out a great deal about the world around us. Frames, poses, views, and framebuffers Once you have an XRFrame representing the state of the scene at a moment in time, you need to determine the positions of objects within the scene relative to the viewer so that you can ...
...And 2 more matches
nsIScreen
Read only. rotation unsigned long The screen's current rotation; you may set this to any of the values listed in Screen rotation constants. This will only have an effect o...
...Read only. rotation unsigned long The screen's current rotation; you may set this to any of the values listed in Screen rotation constants. This will only have an effect on platforms that support screen rota...
...Read only. ...
...Read only. ...
WebGL2RenderingContext.clearBuffer[fiuv]() - Web APIs
The WebGL2RenderingContext.clearBuffer[fiuv]() methods of the WebGL 2 API clear buffers from the currently bound framebuffer. Syntax void gl.clearBufferfv(buffer, drawbuffer, values, optional srcOffset); void gl.clearBufferiv(buffer, drawbuffer, values, optional srcOffset); void gl.clearBufferuiv(buffer, drawbuffer, values, optional srcOffset); void gl.clearBufferfi(buffer, drawbuffer,
depth, stencil); Parameters buffer A GLenum specifying the buffer to clear. Possible values are: gl.COLOR: Color buffer. gl.
DEPTH:
Depth buffer. gl.STENCIL: Stencil buffer. gl.
DEPTH_STENCIL: clears
depth and stencil buffers (used with clearBufferfi). drawBuffer A GLint specifying the draw buffer to clear. values An Array of GLint, GLuint or GLfloat values or an Int32Array, Uint...
... stencil A GLint specifying the value to clear the stencil render buffer to. Return value None. ...
... stencil A GLint specifying the value to clear the stencil render buffer to. Return value None. ...
...ar a
depth render buffer to. stencil A GLint specifying the value to clear the stencil render buffer to. Return value None. Examples gl.clearBufferiv(gl.COLOR, 0, new Int32Array([r, g, b, a])); gl.clearBufferuiv(gl.COLOR, 0, new Uint32Array([r, g, b, a])); gl.clearBufferfv(gl.COLOR, 0, new Float32Array([r, g, b, a])); gl.clearBufferfv(gl.COLOR, 0, [0.0, 0.0, 0.0, 0.0]); gl.clearBufferfi(gl.
DEPTH_STENCIL, 0, 1.0, 0); Specifications Specification Status Comment WebGL 2.0The definition of 'clearBuffer[fiuv]()' in that specification. Editor's Draft Initial definition for WebGL. OpenGL ES 3.0The definition of 'glClearBuffer' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
The WebGLRenderingContext.getFramebufferAttachmentParameter() method of the WebGL API returns information about a framebuffer's attachment. Syntax any gl.getFramebufferAttachmentParameter(target, attachment, pname); Parameters target A GLenum specifying the binding point (target). Possible values: gl.FRAMEBUFFER: Collection buffer data storage of color, alpha,
depth and stencil buffers used to render an image. When using a WebGL 2 context, the following values are available additionally: gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the texture. Possible v...
...tionally: gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the texture. Possible values: gl.COLOR_ATTACHMENT0: Texture attachment for the framebuffer's color buffer. gl.
DEPTH_ATTACHMENT: Texture attachment for the framebuffer's
depth buffer. gl.STENCIL_ATTACHMENT: Texture attachment for the framebuffer's stencil buffer. gl.
DEPTH_STENCIL_ATTACHMENT: Texture attachment for both, the
depth and stencil buffer. When using a WebGL 2 context, the following values are available additionally: gl.COLOR_ATTACHMENT1 gl.COLOR_ATTACHMENT2 gl.COLOR_ATTACHMENT...
...EXT_sRGB extension: ext.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: The framebuffer color encoding. When using a WebGL 2 context, the following values are available additionally: gl.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE gl.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE gl.FRAMEBUFFER_ATTACHMENT_
DEPTH_SIZE gl.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE gl.FRAMEBUFFER_ATTACHMENT_RED_SIZE gl.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER When using the OVR_multiview2 extension: ext.FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR: the number of views of the framebuffer object attachment. ext.FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR: ...
...MEBUFFER_ATTACHMENT_COLOR_ENCODING A GLenum indicating the encoding of components of the specified attachment. Either gl.LINEAR or gl.SRGB. gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE A GLenum indicating the format of the components of the specified attachment. Either gl.FLOAT, gl.INT, gl.UNSIGNED_INT, gl.SIGNED_NORMALIZED, or gl.UNSIGNED_NORMALIZED. gl.FRAMEBUFFER_ATTACHMENT_
DEPTH_SIZE A GLint indicating the number of bits in the
depth component of the attachment. gl.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE A GLint indicating the number of bits in the green component of the attachment. gl.FRAMEBUFFER_ATTACHMENT_RED_SIZE A GLint indicating the number of bits in the red component of the attachment. gl.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE A GLin...
WebGLRenderingContext.texImage2D() - Web APIs
e red, green and blue components and reads the alpha component. gl.RGB: Discards the alpha components and reads the red, green and blue components. gl.RGBA: Red, green, blue and alpha components are read from the color buffer. gl.LUMINANCE: Each color component is a luminance component, alpha is 1.0. gl.LUMINANCE_ALPHA: Each component is a luminance/alpha component. ...
... reads the alpha component. gl.RGB: Discards the alpha components and reads the red, green and blue components. gl.RGBA: Red, green, blue and alpha components are read from the color buffer. gl.LUMINANCE: Each color component is a luminance component, alpha is 1.0. gl.LUMINANCE_ALPHA: Each component is a luminance/alpha component. ...
...ent. gl.RGB: Discards the alpha components and reads the red, green and blue components. gl.RGBA: Red, green, blue and alpha components are read from the color buffer. gl.LUMINANCE: Each color component is a luminance component, alpha is 1.0. gl.LUMINANCE_ALPHA: Each component is a luminance/alpha component. ...
...ed in this table. type A GLenum specifying the data type of the texel data. Possible values: gl.UNSIGNED_BYTE: 8 bits per channel for gl.RGBA gl.UNSIGNED_SHORT_5_6_5: 5 red bits, 6 green bits, 5 blue bits. gl.UNSIGNED_SHORT_4_4_4_4: 4 red bits, 4 green bits, 4 blue bits, 4 alpha bits. gl.UNSIGNED_SHORT_5_5_5_1: 5 red bits, 5 green bits, 5 blue bits, 1 alpha bit. ...
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
ltiplied by the rotation transform to complete the rotations. Representing 3D with WebXR WebXR takes 3D graphics a step further, allowing them to be presented using special visual hardware such as goggles or a headset to create 3D graphics that appear to actually exist in three dimensions, potentially within the context of the real world (in the case of augmented reality). In order to perceive
depth, it's necessary to have two perspectives on the scene. By comparing the two views, it's possible to recognize the
depth of objects and, by extension, the distance between the viewer and objects which are seen. This is why we have two eyes, spaced slightly apart. You can remind yourself of this fact by closing one eye at a time, switching back and forth between the two eyes. Notice how your left e...
... right eye sees the right side of your nose but not the left. That's just one of many differences that exist between what each of your eyes see. Our brain receives two sets of data about light levels and wavelengths throughout our field of view--one from each eye. The brain uses this data to construct the scene in our minds, using the slight differences between the two perspectives to figure out
depth and distance. Rendering the scene An XR--shorthand that encompasses both virtual reality (VR) and augmented reality (AR)--headset presents 3D imagery to us by drawing two views of the scene, slightly offset from one another just like the views obtained by our two eyes. These views are then separately fed to each eye, in order to allow them to collect the data our brain needs in order to constru...
...ositionOffsets(xrReferenceSpace); let pose = frame.getViewerPose(adjustedRefSpace); animationFrameRequestID = frame.session.requestAnimationFrame(myAnimationFrameCallback); if (pose) { let glLayer = frame.session.renderState.baseLayer; gl.bindFramebuffer(gl.FRAMEBUFFER, glLayer.framebuffer); CheckGLError("Binding the framebuffer"); gl.clearColor(0, 0, 0, 1.0); gl.clear
Depth(1.0); gl.clear(gl.COLOR_BUFFER_BIT | gl.
DEPTH_BUFFER_BIT); CheckGLError("Clearing the framebuffer"); const deltaTime = (time - lastFrameTime) * 0.001; lastFrameTime = time; for (let view of pose.views) { let viewport = glLayer.getViewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); CheckGLError(`Setting viewport for eye: ${v...
...e for rendering from the session's renderState object's baseLayer property. We bind this to WebGL's gl.FRAMEBUFFER target using the WebGLRenderingContext method gl.bindFrameBuffer(). Then we clear the framebuffer to ensure we're starting with a known state, since our renderer will not be touching every pixel. We set the clear color to opaque black using gl.clearColor() and the value to clear the
depth buffer to to 1.0 by calling the WebGLRenderingContext method gl.clear
Depth(). Then we call the WebGLRenderingContext method gl.clear(), which clears the framebuffer (since we include gl.COLOR_BUFFER_BIT in the mask parameter) and the
depth buffer (because we include gl.
DEPTH_BUFFER_BIT). Then we determine how much time has elapsed since the previous frame was rendered by comparing the frame's de...
XRWebGLLayerInit - Web APIs
annel if the alpha Boolean property is true. Otherwise, the color buffer will not have an alpha channel. The default value is true. antialias Optional A Boolean value which is true if anti-aliasing is to be used when rendering in the context; otherwise false. The browser selects the anti-aliasing method to use; there is no support for requesting a specific mode yet. The default value is true.
depth Optional A Boolean value which, if true, requests that the new layer have a
depth buffer; otherwise, no
depth layer is allocated. The default is true. framebufferScaleFactor Optional A floating-point value which is used to scale the image during compositing, with a value of 1.0 represents the default pixel size for the frame buffer. The static XRWebGLLayer function XRWebGLLayer.getNativeFrameb...
... floating-point value which is used to scale the image during compositing, with a value of 1.0 represents the default pixel size for the frame buffer. The static XRWebGLLayer function XRWebGLLayer.getNativeFramebufferScaleFactor() returns the scale that would result in a 1:1 pixel ratio, thereby ensuring that the rendering is occurring at the device's native resolution. The default is 1.0. ignore
DepthValues Optional A Boolean value which indicates whether or not to ignore the contents of the
depth buffer while compositing the scene. The default is false. stencil Optional A Boolean value which, if true, requests that the new layer include a stencil buffer. Otherwise, no stencil buffer is allocated. The default is false. Examples Given an XRSession, xrSession, and a WebGL rendering context...
...ents of the
depth buffer while compositing the scene. The default is false. stencil Optional A Boolean value which, if true, requests that the new layer include a stencil buffer. Otherwise, no stencil buffer is allocated. The default is false. ...
...ng the scene. The default is false. stencil Optional A Boolean value which, if true, requests that the new layer include a stencil buffer. Otherwise, no stencil buffer is allocated. The default is false. Examples Given an XRSession, xrSession, and a WebGL rendering context, gl, this snippet sets the rendering layer for the session, specifying the ignore
DepthValues option, indicating that the
depth buffer should not be used (or should not exist at all), and that the only source for distance information of any given point is its position relative to the viewer. const layerOptions = { ignore
DepthValues: true }; xrSession.updateRenderState({ baseLayer: new XRWebGLLayer(xrSession, gl, layerOptions); }); Specifications Specification Status Comment WebXR Device AP...
Hacking Tips
tecode of a function (from gdb) In jsopcode.cpp, a function named js::DisassembleAtPC can print the bytecode of a script. Some variants of this function such as js::DumpScript etc are convenient for debugging. Printing the JS stack (from gdb) In jsobj.cpp, a function named js::DumpBacktrace prints a backtrace a la gdb for the JS stack. The backtrace contains in the following order, the stack
depth, the interpreter frame pointer (see js/src/vm/Stack.h, StackFrame class) or (nil) if compiled with IonMonkey, the file and line number of the call location and under parentheses, the JSScript pointer and the jsbytecode pointer (pc) executed. $ gdb --args js [...] (gdb) b js::ReportOverRecursed (gdb) r js> function f(i) { if (i % 2) f(i + 1); else f(i + 3); } js> f(0) Breakpoint 1, js::Repor...
...intf, with a location, and followed by printf-like arguments. (gdb) dprintf js::jit::IonBuilder::IonBuilder, "Compiling %s:%d:%d-%d\n", info->script_->scriptSource()->filename_.mTuple.mFirstA, info->script_->lineno_, info->script_->sourceStart_, info->script_->sourceEnd_ Dprintf 1 at 0x7fb4f6a104eb: file /home/nicolas/mozilla/contrib-push/js/src/jit/IonBuilder.cpp, line 159. (gdb) cond 1 inlining
Depth == 0 (gdb) dprintf js::jit::BailoutIonToBaseline, "Bailout from %s:%d:%d-%d\n", iter.script()->scriptSource()->filename_.mTuple.mFirstA, iter.script()->lineno_, iter.script()->sourceStart_, iter.script()->sourceEnd_ Dprintf 2 at 0x7fb4f6fe43dc: js::jit::BailoutIonToBaseline. (2 locations) (gdb) dprintf Ion.cpp:3196, "Invalidate %s:%d:%d-%d\n", co->script_->scriptSource()->filename_.mTuple.mFirstA...
...When gdb comes up, enter set annot 1 to get it to emit file location information so that emacs will pop up the corresponding source. Note tha...
How to build an XPCOM component in JavaScript
ing a new feature to applications in the mozilla-central repository, you can create a Makefile listing the IDL files and the build system will automatically generate the typelib. A sample Makefile.in # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. ...
... feature to applications in the mozilla-central repository, you can create a Makefile listing the IDL files and the build system will automatically generate the typelib. A sample Makefile.in # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. ...
...akefile listing the IDL files and the build system will automatically generate the typelib. A sample Makefile.in # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. ...
imgIContainer
void appendFrame(in PRInt32 aX, in PRInt32 aY, in PRInt32 aWidth, in PRInt32 aHeight, in gfxImageFormat aFormat, [array, size_is(imageLength)] out PRUint8 imageData, out unsigned long imageLength); Native code only! Obsolete since Gecko 2.0 void appendPalettedFrame(in PRInt32 aX, in PRInt32 aY, in PRInt32 aWidth, in PRInt32 aHeight, in gfxImageFormat aFormat, in PRUint8 aPalette
Depth, [array, size_is(imageLength)] out PRUint8 imageData, out unsigned long imageLength, [array, size_is(paletteLength)] out PRUint32 paletteData, out unsigned long paletteLength); Native code only! Obsolete since Gecko 2.0 void clear(); Obsolete since Gecko 1.9.2 gfxImageSurface copyCurrentFrame(); Native code only! Obsolete since Gecko 2.0 gfxImageSurface copyFrame(in P...
...pendPalettedFrame Obsolete since Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. ...
...Exceptions...
WebGL2RenderingContext.invalidateFramebuffer() - Web APIs
The WebGL2RenderingContext.invalidateFramebuffer() method of the WebGL 2 API invalidates the contents of attachments in a framebuffer. Syntax void gl.invalidateFramebuffer(target, attachments); Parameters target A GLenum specifying the binding point (target). Possible values: gl.FRAMEBUFFER: Collection buffer data storage of color, alpha,
depth and stencil buffers used to render an image. gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachments An Array of GLenum specifying the attachment points to invalidate. Possible values: gl.COLOR_ATTACHMENT{0-15}: Invalidates one of the framebuffer's color buffers. gl.
DEPTH_ATTACHMENT: Invalidates the framebuffer's
depth buffer. gl.STENCIL_ATTACHMEN...
... Return value None. ...
... Return value None. ...
WebGLRenderingContext.clear() - Web APIs
The scissor box, dithering, and buffer writemasks can affect the clear() method. Syntax void gl.clear(mask); Parameters mask A GLbitfield bitwise OR mask that indicates the buffers to be cleared. Possible values are: gl.COLOR_BUFFER_BIT gl.
DEPTH_BUFFER_BIT gl.STENCIL_BUFFER_BIT Return value None. Exceptions If mask is not one of the listed possible values, a gl.INVALID_ENUM error is thrown. Examples The clear() method accepts multiple values. ...
...x void gl.clear(mask); Parameters mask A GLbitfield bitwise OR mask that indicates the buffers to be cleared. Possible values are: gl.COLOR_BUFFER_BIT gl.
DEPTH_BUFFER_BIT gl.STENCIL_BUFFER_BIT Return value None. Exceptions If mask is not one of the listed possible values, a gl.INVALID_ENUM error is thrown. Examples The clear() method accepts multiple values. gl.clear(gl.
DEPTH_BUFFER_BIT); gl.clear(gl.
DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT); To get the current clear values, query the COLOR_CLEAR_VALUE,
DEPTH_CLEAR_VALUE, and STENCIL_CLEAR_VALUE constants. ...
... mask is not one of the listed possible values, a gl.INVALID_ENUM error is thrown. Examples The clear() method accepts multiple values. gl.clear(gl.
DEPTH_BUFFER_BIT); gl.clear(gl.
DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT); To get the current clear values, query the COLOR_CLEAR_VALUE,
DEPTH_CLEAR_VALUE, and STENCIL_CLEAR_VALUE constants. gl.getParameter(gl.COLOR_CLEAR_VALUE); gl.getParameter(gl.
DEPTH_CLEAR_VALUE); gl.getParameter(gl.STENCIL_CLEAR_VALUE); Specifications Specification Status Comment WebGL 1.0The definition of 'clear' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glClear' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.compressedTexImage[23]D() - Web APIs
Possible values for compressedTexImage2D: gl.TEXTURE_2D: A two-...
...Possible values for compressedTexImage2D: gl.TEXTURE_2D: A two-dimensional texture. gl.TEXTURE_CUBE_MAP_POSITIVE_X: Positive X face for a cube-mapped texture. gl.TEXTURE_CUBE_MAP_NEGATIV...
...XT ext.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT When using the EXT_texture_compression_rgtc extension: ext.COMPRESSED_RED_RGTC1_EXT ext.COMPRESSED_SIGNED_RED_RGTC1_EXT ext.COMPRESSED_RED_GREEN_RGTC2_EXT ext.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT width A GLsizei specifying the width of the texture. height A GLsizei specifying the height of the texture.
depth A GLsizei specifying the
depth of the texture/the number of textures in a TEXTURE_2D_ARRAY. border A GLint specifying the width of the border. Must be 0. imageSize A GLsizei specifying the number of bytes to read from the buffer bound to gl.PIXEL_UNPACK_BUFFER. offset A GLintptr specifying the offset in bytes from which to read from the buffer bound to gl.PIXEL_UNPACK_BUFFER. pixels An A...
WebGLRenderingContext - Web APIs
ha blend equation separately. WebGLRenderingContext.blendFunc() Defines which function is used for blending pixel arithmetic. WebGLRenderingContext.blendFuncSeparate() Defines which function is used for blending pixel arithmetic for RGB and alpha components separately. WebGLRenderingContext.clearColor() Specifies the color values used when clearing color buffers. WebGLRenderingContext.clear
Depth() Specifies the
depth value used when clearing the
depth buffer. WebGLRenderingContext.clearStencil() Specifies the stencil value used when clearing the stencil buffer. WebGLRenderingContext.colorMask() Sets which color components to enable or to disable when drawing or rendering to a WebGLFramebuffer. WebGLRenderingContext.cullFace() Specifies whether or not front- and/or back-facing poly...
...aring the
depth buffer. WebGLRenderingContext.clearStencil() Specifies the stencil value used when clearing the stencil buffer. WebGLRenderingContext.colorMask() Sets which color components to enable or to disable when drawing or rendering to a WebGLFramebuffer. WebGLRenderingContext.cullFace() Specifies whether or not front- and/or back-facing polygons can be culled. WebGLRenderingContext.
depthFunc() Specifies a function that compares incoming pixel
depth to the current
depth buffer value. WebGLRenderingContext.
depthMask() Sets whether writing into the
depth buffer is enabled or disabled. WebGLRenderingContext.
depthRange() Specifies the
depth range mapping from normalized device coordinates to window or viewport coordinates. WebGLRenderingContext.disable() Disables specific WebGL...
... of these hints depend on the implementation. WebGLRenderingContext.isEnabled() Tests whether a specific WebGL capability is enabled or not for this context. WebGLRenderingContext.lineWidth() Sets the line width of rasterized lines. WebGLRenderingContext.pixelStorei() Specifies the pixel storage modes WebGLRenderingContext.polygonOffset() Specifies the scale factors and units to calculate
depth values. WebGLRenderingContext.sampleCoverage() Specifies multi-sample coverage parameters for anti-aliasing effects. WebGLRenderingContext.stencilFunc() Sets the both front and back function and reference value for stencil testing. WebGLRenderingContext.stencilFuncSeparate() Sets the front and/or back function and reference value for stencil testing. WebGLRenderingContext.stencilMask() Co...
WebGL best practices - Web APIs
texture formats with a single compressed texture file, through a JavaScript library that efficiently converts formats at load time. It also adds additional compression that makes Basis Universal compressed texture files much smaller than regular compressed textures over-the-wire, more comparable to JPEG. https://github.com/BinomialLLC/basis_universal/blob/master/webgl/README.md Memory usage of
depth and stencil formats
Depth and stencil attachments and formats are actually inseparable on many devices. You may ask for
DEPTH_COMPONENT24 or STENCIL_INDEX8, but you're often getting D24X8 and X24S8 32bpp formats behind the scenes. Assume that the memory usage of
depth and stencil formats is rounded up to the nearest four bytes. texImage/texSubImage uploads (particularly with videos) can cause p...
... texImage/texSubImage uploads (particularly with videos) can cause pipeline flushes Most texture uploads from DOM elements will incur a processing pass that will temporarily switch GL Progams internally, causing a pipeline flush. (Pipelines are formalized explicitly in Vulkan[1] et al, but are implicit behind-the-scenes in OpenGL and WebGL. Pipelines are more or less the tuple of shader program,
depth/stencil/multisample/blend/rasterization state) In WebGL: ... useProgram(prog1) <pipeline flush> bindFramebuffer(target) drawArrays() bindTexture(webgl_texture) texImage2D(HTMLVideoElement) drawArrays() ... Behind the scenes in the browser: ... useProgram(prog1) <pipeline flush> bindFramebuffer(target) drawArrays() bindTexture(webgl_texture)...
... a single level. So, prefer texStorage+texSubImage for textures in WebGL 2 invalidateFramebuffer Storing data that you won't use again can have high cost, particularly on tiled-rendering GPUs common on mobile. When you're done with the contents of a framebuffer attachment, use invalidateFramebuffer to discard the data, instead of leaving the driver to waste time storing the data for later use.
DEPTH/STENCIL and/or multisampled attachments in particular are great candidates for invalidateFramebuffer. Non-blocking async data download/readback The approach in WebGL 2 is analogous to the approach in OpenGL: https://jdashg.github.io/misc/async-gpu-downloads.html function clientWaitAsync(gl, sync, flags, interval_ms) { return new Promise((resolve, reject) => { function test() { cons...
WebGL: 2D and 3D graphics for the web - Web APIs
WebGLContextEvent WebGLFramebuffer WebGLProgram WebGLQuery WebGLRenderbuffer WebGLSampler WebGLShader WebGLShaderPrecisionFormat WebGLSync WebGLTexture WebGLTransformFeedback WebGLUniformLocation WebGLVertexArrayObject Extensions ANGLE_instanced_arrays EXT_blend_minmax EXT_color_buffer_float EXT_color_buffer_half_float EXT_disjoint_timer_query EXT_float_blend EXT_frag_
depth EXT_sRGB EXT_shader_texture_lod EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_element_index_uint OES_fbo_render_mipmap OES_standard_derivatives OES_texture_float OES_texture_float_linear OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object OVR_multiview2 WEBGL_color_buffer_float WEB...
...It is based on OpenGL ES 3.0 and new features include: 3D textures, Sampler objects, Uniform Buffer obj...
...ebGL 2 WebGL 2 is a major update to WebGL which is provided through the WebGL2RenderingContext interface. It is based on OpenGL ES 3.0 and new features include: 3D textures, Sampler objects, Uniform Buffer objects, Sync objects, Query objects, Transform Feedback objects, Promoted extensions that are now core to WebGL 2: Vertex Array objects, instancing, multiple render targets, fragment
depth. See also the blog post "WebGL 2 lands in Firefox" and webglsamples.org/WebGL2Samples for a few demos. Guides and tutorials Below, you'll find an assortment of guides to help you learn WebGL concepts and tutorials that offer step-by-step lessons and examples. Guides Data in WebGL A guide to variables, buffers, and other types of data used when writing WebGL code. WebGL best practices T...
Movement, orientation, and motion: A WebXR example - Web APIs
pose = null; animationFrameRequestID = session.requestAnimationFrame(drawFrame); adjustedRefSpace = applyViewerControls(xrReferenceSpace); pose = frame.getViewerPose(adjustedRefSpace); if (pose) { let glLayer = session.renderState.baseLayer; gl.bindFramebuffer(gl.FRAMEBUFFER, glLayer.framebuffer); LogGLError("bindFrameBuffer"); gl.clearColor(0, 0, 0, 1.0); gl.clear
Depth(1.0); // Clear everything gl.clear(gl.COLOR_BUFFER_BIT | gl.
DEPTH_BUFFER_BIT); LogGLError("glClear"); const deltaTime = (time - lastFrameTime) * 0.001; // Convert to seconds lastFrameTime = time; for (let view of pose.views) { let viewport = glLayer.getViewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); Log...
...; const modelViewMatrix = mat4.create(); function renderScene(gl, view, programInfo, buffers, texture, deltaTime) { const xRotationForTime = (xRotationDegreesPerSecond * RADIANS_PER_DEGREE) * deltaTime; const yRotationForTime = (yRotationDegreesPerSecond * RADIANS_PER_DEGREE) * deltaTime; const zRotationForTime = (zRotationDegreesPerSecond * RADIANS_PER_DEGREE) * deltaTime; gl.enable(gl.
DEPTH_TEST); // Enable
depth testing gl.
depthFunc(gl.LEQUAL); // Near things obscure far things if (enableRotation) { mat4.rotate(cubeMatrix, // destination matrix cubeMatrix, // matrix to rotate zRotationForTime, // amount to rotate in radians [0, 0, 1]); // axis to rotate around (Z) mat4.rotate(cubeMatrix, ...
...t the rotation of our animating cube the right amount to ensure that its movement speed stays consistent regardless of variations in the frame rate that may occur due to system load. These values are calculated as the number of radians of rotation to apply given the elapsed time and stored into the constants xRotationForTime, yRotationForTime, and zRotationForTime. After enabling and configuring
depth testing, we check the value of the enableRotation constant to see if rotation of the cube is enabled; if it is, we use glMatrix to rotate the cubeMatrix (representing the cube's current orientation relative to the world space) around the three axes. With the cube's global orientation established, we then multiply that by the inverse of the view's transform matrix to get the final model view matri...
XRWebGLLayer.framebuffer - Web APIs
other than while executing the requestAnimationFrame() callback. Attempting to clear, draw to, or read from the framebuffer results in a WebGL INVALID_FRAMEBUFFER_OPERATION error (0x0506). Calling checkFramebufferStatus() on the WebGL context from outside the animation frame callback causes the WebGL FRAMEBUFFER_UNSUPPORTED error (0x8CDD) to be reported. Opaque framebuffers initialized with the
depth property set to false will not have a
depth buffer and will rely on the coordinates alone to determine distance. Opaque framebuffers initialized without specifying a stencil will not have a stencil buffer. Opaque framebuffers will not have an alpha channel available unless the alpha property is true when creating the layer. The XR compositor assumes that opaque framebuffers use colors with pre...
...ebuffers initialized without specifying a stencil will not have a stencil buffer. Opaque framebuffers will not have an alpha channel available unless the alpha property is true when creating the layer. The XR compositor assumes that opaque framebuffers use colors with premultiplied allpha, regardless of whether or not the WebGL context's premultipliedAlpha context attribute is set. Note: The
depth and stencil properties are not required to be supported in order for a browser to be construed as having full WebGL support. The default configuration of a new framebuffer Upon creating a new XRWebGLLayer, its new framebuffer is initialized just like the default framebuffer for any WebGL interface: The color buffer is configured with its clear value set to the color (0, 0, 0, 0) (meaning tr...
... are not required to be supported in order for a browser to be construed as having full WebGL support. The default configuration of a new framebuffer Upon creating a new XRWebGLLayer, its new framebuffer is initialized just like the default framebuffer for any WebGL interface: The color buffer is configured with its clear value set to the color (0, 0, 0, 0) (meaning transparent black). The
depth buffer's clear value is the number 1.0. The stencil buffer is filled with 0. Examples This example gets the XRWebGLLayer for a session and then passes its framebuffer into the WebGL context's bindFramebuffer() function. let glLayer = xrSession.renderState.baselayer; gl.bindFramebuffer(gl.FRAMEBUFFER, glLayer.framebuffer); Specifications Specification Status Comment ...
Index - Archive of obsolete content
anges like this, they increase the skin version number. This is the number that is defined in contents.rdf. Test your skin with every major release of Mozilla. If a message appears in the preferences window telling you that it's an old skin, you're going to have to look over the code to see what changed. ...
...yntax more familiar to JavaScript programming. 2183 Accessing XML children Normal JavaScript Objects use the . operator or [] notation to set properties. 2184 Descendants and Filters In many cases, the node that you're interested in is not the direct child of the top XML element. Instead, it may be nested several levels down. You can access nodes at any
depth using the .. operator, or by using the descendants property. For instance 2185 Introduction E4X, JavaScript, XML With E4X enabled, basic XML elements are valid syntax for variables. For instance 2186 Namespaces Oftentimes, XML documents will contain elements from a variety of namespaces. You can declare the default namespace for your E4X objects by placi...
Mozilla Crypto FAQ - Archive of obsolete content
on on new US encryption export regulations, see the U.S. Department of Commerce press release announcing the new regulations as well as the updated regulations (PDF) themselves. Export of source code for open source software is addressed in Part 740 (PDF), section 740.13(e), "Unrestricted encryption source code"; export of binaries is addressed in 740.17. (You may also be interested in a more in-
depth analysis of the new regulations, with an emphasis on how they affect open source software.) For more information on the SSL, S/MIME, PKI, and other crypto source code being developed as part of the Mozilla project, see the PKI project page and of course the source code itself. Also see the original Sun-Netscape Alliance press release on the release of PKI source code and the corresponding mozill...
...ontroversy and the Digital Telephony Act. Cryptography & Liberty 2000: An International Survey of Encryption Policy, by the Electronic Privacy Information Center. The latest in a series of annual surveys of government policies relating to encryption, covering over a hundred countries. The Limits of Trust: Cryptography, Governments, and Electronic Commerce, by Stewart Baker and Paul Hurst. An in-
depth (but badly outdated) discussion of the legal framework for regulation of cryptography in various countries around the world, including the U.S. See the EPIC bookstore for more recommendations of books discussing privacy in general and public policies related to privacy issues. Original Document Information Author(s): Frank Hecker Last Updated Date: September 10, 2000 (Version 2.11) Copyr...
Using LDAP XPCOM with XULRunner - Archive of obsolete content
ed in Using Dependent Libraries In Extension Components: the component library is just a loader of the real library and all its dependencies, so as all the needed libraries are loaded. ...
...t a loader of the real library and all its dependencies, so as all the needed libraries are loaded. Create a subdirectory extensions/ldapstub in the mozilla source code directory, containing two files, Makefile.in and LDAPStubLoader.cpp: Makefile.in: # Copyright (c) 2005 Benjamin Smedberg <benjamin@smedbergs.us>
DEPTH = ../.. ...
NPSetWindowCallbackStruct - Archive of obsolete content
<< Gecko Plugin API Reference << Plug-in Side Plug-in API Summary Note: This structure is only used on Unix platforms. Contains information about the plug-in's Unix window environment. ...
...structure has the following fields: type Always contains NP_SetWindow. display Standard X Toolkit attribute. Pointer to the Display structure that represents the browser-server connection. visual Standard X Toolkit attribute. X Visual for the plug-in window or drawable. colormap Standard X Toolkit attribute. Colormap for the plug-in window or drawable.
depth Standard X Toolkit attribute.
Depth of the plug-in window or drawable. Description Callback structures are used to pass platform-specific information. The NPSetWindowCallbackStruct object, allocated by the browser, contains information required for the ws_info field of an NPWindow. The NPP_SetWindow() function passes a pointer to this structure to the plug-in. The structure is valid for the ...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
rmediate, MDN, URL, Web A Slug is the unique identifying part of a web address, typically at the end of the URL. In the context of MDN, it is the portion of the URL following "<locale>/docs/". 426 Smoke Test Composing, Glossary, Intro, QA, Testing A smoke test consists of functional or unit tests of critical software functionality. Smoke testing comes before further, in-
depth testing. 427 Snap positions Glossary, snap positions A scroll container may set snap positions -- points that the scrollport will stop moving at after a scrolling operation is completed. This allows a scrolling experience that gives the effect of paging through content rather than needing to drag content into view. 428 Specification Glossary, OpenPractices, Sta...
...thin a texture map, which is an image that gets used (in whole or in part) as the image presented on a polygon's surface within a 3D rendered image. It is not to be confused with pixel which is the unit of screen space. This is one of the main differences between Texel's and pixels, pixels are image data. Texel components are made up of subjective data, therefore they can be an image as well as a
depth map. 456 Thread Glossary, Thread, asynchronous Thread in computer science is the execution of running multiple tasks or programs at the same time. Each unit capable of executing code is called a thread. 457 Three js Browser, CodingScripting, JavaScript, Programming Language, three.js three.js is a JavaScript-based WebGL engine that can run GPU-powered gam...
Mozilla accessibility architecture
ow/nsIWidget) for the pres shell to create a doc accessible for it. One benefit of this approach is that accessibility.dll/libaccessibility.so does not need get loaded until the accessibility service gets used, and for most users it is never loaded. All other accessibles for the individual objects are created on demand as well. The assistive technology can choose to get the entire tree by using a
depth- or breadth- first search, it can choose to get accessibles only based on events like focus, or it can get the accessible at a given point on the screen. No matter how the assistive technology client requests the data, the accessible for a given node is only created once. We use the accessibility cache to retrieve accessibles that have already been created for a given dom node. This tree traversa...
...cument, and asks nsIAccessibilityService::GetAccessible() for an accessible for each node. If it's in the cache, that is returned. XUL elements are checked for support of the nsIAccessibleProvider interface, which can return an accessible. HTML elements ask the node's primary frame for an accessible via nsIFrame::GetAccessible(). If nsnull is returned than the tree walker checks the next node, in
depth first order. Calling Sequence: How an Accessible Node is Returned by nsIAccessible's Traversal Methods ATK/MSAA toolkit traversal method -> nsAccessible traversal method -> nsAccessibleTreeWalker method which traverses DOM & anonymous content -> nsIAccessibilityService::GetAccessible() with the content node -> nsDocAccessible::GetCachedAccessNode() and returns if successful, or -> nsIAc...
Introduction to the JavaScript shell
ect specified by scope. countHeap([start[, kind]]) Added in SpiderMonkey 1.8 Count the number of live GC things in the heap, or things reachable from start when it is given and is not null. kind is either 'all' (default) to count all things or one of 'object', 'double', 'string', 'function', 'qname', 'namespace', 'xml' to count only things of that kind. dumpHeap([fileName[, start[, toFind[, max
Depth[, toIgnore]]]]]) Added in SpiderMonkey 1.8 Dump the graph of all existing objects (or a specific interesting subgraph) to a file. For more information, see the C/C++ version of this function, JS_DumpHeap. evalcx(string[, object]) Evaluates the JavaScript code in string. If object is specified, the code is executed in that object, treating it as a sandbox. If string is empty and object is not ...
...This is a thin wrapper for JS_DumpHeap. gczeal(zeal) Enable extra-frequent GC, to help find GC hazards. zeal is an integer. The meaning is the same as for the parameter to JS_SetGCZeal. notes([function]) Shows the source notes for the specified function. Source notes contain information that map the bytecode to the source code, which is used when decompi...
JS_DumpHeap
obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. This article covers features introduced in SpiderMonkey 1.8 DEBUG only. Dump the object graph of heap-allocated things. Syntax bool JS_DumpHeap(JSRuntime *rt, FILE *fp, void* startThing, JSGCTraceKind kind, void *thingToFind, size_t max
Depth, void *thingToIgnore); Name Type Description cx JSContext * Pointer to a JS context. Every JSContext is permanently associated with a JSRuntime; each JSRuntime contains a GC heap. fp FILE * File for the dump output. startThing void * NULL or a pointer to a GC thing (use JS::Value::toGCThing() to obtain a pointer to pass here). When nul...
...me roots. When non-null, dump only things reachable from the object indicated. startKind JSGCTraceKind Trace kind of startThing, if startThing is not null. Must be JSTRACE_OBJECT when startThing is null. thingToFind void * NULL or a pointer to a GC thing. If this is non-null, JS_DumpHeap only dumps paths in the object graph leading to the specified thing. max
Depth size_t The upper bound on the number of edges to descend from the graph roots. thingToIgnore void * NULL or a pointer to a GC thing that will be ignored during graph traversal. enum JSGCTraceKind { // These trace kinds have a publicly exposed, although opaque, C++ type. // Note: The order here is determined by our Value packing. Other users // should ...
JS_SuspendRequest
it. Removed from SpiderMonkey at or prior to version 45. Since then, a JSRuntime is tied to the thread that created it; it may not be accessed by any other thread. Suspends the calling thread's current request, if any, to allow the thread to block or perform time-consuming calculations. Syntax jsrefcount JS_SuspendRequest(JSContext *cx); void JS_ResumeRequest(JSContext *cx, jsrefcount save
Depth); Name Type Description cx JSContext * The context whose current request is to be suspended or resumed. save
Depth jsrefcount (only in JS_ResumeRequest) The valued returned by the matching JS_SuspendRequest call. Description In JS_THREADSAFE builds, when a multi-threaded application is in a request but needs to block or perform lengthy computa...
...S_THREADSAFE. JS_SuspendRequest suspends any currently active requests associated with the context cx. This allows the runtime to perform garbage collection if needed and allows other threads to access objects that the calling thread had locked. The return value is the number of nested requests that were suspended. It may be 0. JS_ResumeRequest resumes the previously suspended requests. The save
Depth argument must be the value returned by the matching JS_SuspendRequest call. If save
Depth is nonzero and garbage collection is underway, JS_ResumeRequest blocks until the garbage collector is done. JSAPI 1.7 and earlier JS_SuspendRequest and JS_ResumeRequest are available only in JS_THREADSAFE builds. In SpiderMonkey 1.8 and later, these functions will be present, but will do nothing, in non-JS_T...
Shell global objects
an object describing some of the configuration options SpiderMonkey was built with. hasChild(parent, child) Return true if child is a child of parent, as determined by a call to TraceChildren setSavedStacksRNGState(seed) Set this compartment's SavedStacks' RNG state. getSavedFrameCount() Return the number of SavedFrame instances stored in this compartment's SavedStacks cache. saveStack([max
Depth [, compartment]]) Capture a stack. If max
Depth is given, capture at most max
Depth number of frames. If compartment is given, allocate the js::SavedFrame instances with the given object's compartment. saveStack(object [, shouldIgnoreSelfHosted = true]]) Capture a stack back to the first frame whose principals are subsumed by the object's compartment's principals. If shouldIgnoreSelfHosted is gi...
...mplicitly by the system, making them suitable for use in allocation tooling tests. Takes an optional options object which may contain the following properties: * nursery: bool, whether to allocate the object in the nursery setGCCallback({action:"...", options...}) Set the GC callback. action may be: minorGC run a nursery collection majorGC run a major collection, nesting up to a given
depth getLcovInfo(global) Generate LCOV tracefile for the given compartment. If no global are provided then the current global is used as the default one. getModuleEnvironmentNames(module) Get the list of a module environment's bound names for a specified module. getModuleEnvironmentValue(module, name) Get the value of a bound name in a module environment. enableForEach() Enables the deprec...
nsIFrameLoader
This can be used to decide what operations may or may not be allowed on the loader's docshell. Read only. docShell nsIDocShell Get the docshell from the frame loader. Read only. messageManager nsIChromeFrameMessageManager The message manager handling messages for this...
...loat aX, in float aY, in long aButton, in long aClickCount, in long aModifiers, [optional] in boolean aIgnoreRootScrollFrame); void updatePositionAndSize(in nsIFrame aIFrame); Native code only! Attributes Attribute Type Description delayRemoteDialogs boolean
depthTooGreat boolean Find out whether the loader's frame is at too great a
depth in the frame tree. This can be used to decide what operations may or may not be allowed on the loader's docshell. Read only. docShell nsIDocShell Get the docshell from the frame loader. Read only. messageManager nsIChromeFrameMessageManager The message manager handling messages for this frame. Read only. Methods activateFrameEvent() Activates event forwardi...
Frame rate - Firefox Developer Tools
ad user experience. A frame rate of 60fps is the target for smooth performance, giving you a time budget of 16.7ms for all the updates needed in response to some event. The frame rate graph in the Performance tool shows you the frame rate over the course of a recording. It gives you a quick indication of where your site might be having problems, enabling you to use the other tools for a more in-
depth analysis. Frame rate and responsiveness Frame rate is the rate at which a video device can produce images (or frames). It's most familiar from film and gaming, but is now widely used as a performance measure for websites and web apps. In web performance, a frame encapsulates the work the browser needs to do in order to update and repaint the screen. Frame rate is most obviously applicable to ...
...rse of the recording. The x-axis is time over the profile period, and there are three annotations: the maximum frame rate, the average frame rate, and the lowest frame rate. Using the frame rate graph The great value of the frame rate graph is that, like the Web Console, it gives you a quick indication of where your site might be having problems, enabling you to use the other tools for more in-
depth analysis. For example, here's a screenshot of a performance profile: You can see that the average frame rate is reasonably healthy, but there are three spots where frame rate collapses for tens of milliseconds. This would certainly cause a noticeable stutter for any animations that were playing in the page. The frame rate graph is correlated with the waterfall summary directly above it, and t...
HTMLCanvasElement.getContext() - Web APIs
WebGL. These implementations have either not reached test suite conformance, or the graphics drivers on the platform are not yet stable. The Khronos Group certifies WebGL implementations under certain conformance rules. contextAttributes You can use several context attributes when creating your rendering context, for example: const gl = canvas.getContext('webgl', { antialias: false,
depth: false }); 2d context attributes: alpha: Boolean that indicates if the canvas contains an alpha channel. If set to false, the browser now knows that the backdrop is always opaque, which can speed up drawing of transparent content and images. desynchronized: Boolean that hints the user agent to reduce the latency by desynchronizing the canvas paint cycle from the event loop (Gecko onl...
...storage: String that indicates which storage is used ("persistent" by default). WebGL context attributes: alpha: Boolean that indicates if the canvas contains an alpha buffer. desynchronized: Boolean that hints the user agent to reduce the latency by desynchronizing the canvas paint cycle from the event loop antialias: Boolean that indicates whether or not to perform anti-aliasing.
depth: Boolean that indicates that the drawing buffer has a
depth buffer of at least 16 bits. failIfMajorPerformanceCaveat: Boolean that indicates if a context will be created if the system performance is low or if no hardware GPU is available. powerPreference: A hint to the user agent indicating what configuration of GPU is suitable for the WebGL context. Possible values are: "default": Le...
OffscreenCanvas.getContext() - Web APIs
tions have not reached test suite conformance, or the graphic drivers situation on the platform is not yet stable. The Khronos Group certifies WebGL implementations under certain conformance rules. contextAttributes You can use several context attributes when creating your rendering context, for example: offscreen.getContext("webgl", { antialias: false,
depth: false }); 2d context attributes: alpha: Boolean that indicates if the canvas contains an alpha channel. If set to false, the browser now knows that the backdrop is always opaque, which can speed up drawing of transparent content and images then. (Gecko only) willReadFrequently: Boolean that indicates whether or not a lot of read-back operations are planned. This will force the use of a...
...ory when calling getImageData() frequently. This option is only available, if the flag gfx.canvas.willReadFrequently.enable is set to true (which, by default, is only the case for B2G/Firefox OS). (Blink only) storage: String that indicates which storage is used ("persistent" by default). WebGL context attributes: alpha: Boolean that indicates if the canvas contains an alpha buffer.
depth: Boolean that indicates that the drawing buffer has a
depth buffer of at least 16 bits. stencil: Boolean that indicates that the drawing buffer has a stencil buffer of at least 8 bits. antialias: Boolean that indicates whether or not to perform anti-aliasing. premultipliedAlpha: Boolean that indicates that the page compositor will assume the drawing buffer contains colors with pre-multiplie...
Screen - Web APIs
. Screen.availLeft Returns the first available pixel available from the left side of the screen. Screen.availHeight Specifies the height of the screen, in pixels, minus permanent or semipermanent user interface features displayed by the operating system, such as the Taskbar on Windows. Screen.availWidth Returns the amount of horizontal space in pixels available to the window. Screen.color
Depth Returns the color
depth of the screen. Screen.height Returns the height of the screen in pixels. Screen.left Returns the distance in pixels from the left side of the main screen to the left side of the current screen. Screen.orientation Returns the ScreenOrientation instance associated with this screen. Screen.pixel
Depth Gets the bit
depth of the screen. Screen.top Returns the dist...
... EventTarget.dispatchEvent() Dispatches an event to this EventTarget. Additional methods in Mozilla chrome codebase Mozilla includes a couple of extensions for use by JS-implemented event targets to implement onevent properties. See also WebIDL bindings. void setEventHandler(DOMString type, EventHandler handler) EventHandler getEventHandler(DOMString type) Example if (screen.pixel
Depth < 8) { // use low-color version of page } else { // use regular, colorful page } Specification Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'Screen' in that specification. Working Draft Initial definition. ...
Screen Capture API - Web APIs
ure in the form of a MediaStream. To start capturing video from the screen, you call getDisplayMedia() on the instance of Media navigator.mediaDevices: captureStream = await navigator.mediaDevices.getDisplayMedia(displayMediaOptions); The Promise returned by getDisplayMedia() resolves to a MediaStream which streams the captured media. See the article Using the Screen Capture API for a more in-
depth look at how to use the API to capture screen contents as a stream. Additions to existing interfaces The Screen Capture API doesn't have any interfaces of its own; instead, it adds one method to the existing MediaDevices interface. MediaDevices interface MediaDevices.getDisplayMedia() The getDisplayMedia() method is added to the MediaDevices interface. Similar to getUserMedia(), this method...
... Specifications Specification Status Comment Screen Capture Working Draft Initial definition ...
VRStageParameters - Web APIs
periences. This interface is accessible through the VRDisplay.stageParameters property. Properties VRStageParameters.sittingToStandingTransform Read only Contains a matrix that transforms the sitting-space view matrices of VRFrameData to standing-space. VRStageParameters.sizeX Read only Returns the width of the play-area bounds in meters. VRStageParameters.sizeY Read only Returns the
depth of the play-area bounds in meters. Examples var info = document.querySelector('p'); var vrDisplay; navigator.getVRDisplays().then(function(displays) { vrDisplay = displays[0]; var stageParams = vrDisplay.stageParameters; // stageParams is a VRStageParameters object if(stageParams === null) { info.textContent = 'Your VR Hardware does not support room-scale experiences.' } else {...
... Draft Initial definition ...
WebGL2RenderingContext.compressedTexSubImage3D() - Web APIs
The WebGL2RenderingContext.compressedTexSubImage3D() method of the WebGL API specifies a three-dimensional sub-rectangle for a texture image in a compressed format. Syntax // read from the buffer bound to gl.PIXEL_UNPACK_BUFFER void gl.compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height,
depth, format, imageSize, offset); void gl.compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height,
depth, format, ArrayBufferView srcData, optional srcOffset, optional srcLengthOverride); Parameters target A GLenum specifying the binding point (target) of the active texture. Possible values: gl.TEXTURE_3D: A three-dimensional texture. gl.TEXTURE_2D_ARRAY: A two-dimensional array texture. level A GLint specifying the level of de...
...el and level n is the nth mipmap reduction level. xoffset A GLint specifying the x offset within the compressed texture image. yoffset A GLint specifying the y offset within the compressed texture image. zoffset A GLint specifying the z offset within the compressed texture image. width A GLsizei specifying the width of the texture. height A GLsizei specifying the height of the texture.
depth A GLsizei specifying the
depth of the texture. format A GLenum specifying the compressed image format. Possible values: gl.COMPRESSED_R11_EAC gl.COMPRESSED_SIGNED_R11_EAC gl.COMPRESSED_RG11_EAC gl.COMPRESSED_SIGNED_RG11_EAC gl.COMPRESSED_RGB8_ETC2 gl.COMPRESSED_RGBA8_ETC2_EAC gl.COMPRESSED_SRGB8_ETC2 gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC gl.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1...
WebGL2RenderingContext.framebufferTextureLayer() - Web APIs
his method is similar to WebGLRenderingContext.framebufferTexture2D(), but only a given single layer of the texture level is attached to the attachment point. Syntax void gl.framebufferTextureLayer(target, attachment, texture, level, layer); Parameters target A GLenum specifying the binding point (target). Possible values: gl.FRAMEBUFFER: Collection buffer data storage of color, alpha,
depth and stencil buffers used to render an image. gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the texture. Possible values: gl.COLOR_ATTACHMENT{0-15}: Attaches the texture to one of the framebuffer's color buffers. gl.
DEPTH_ATTACHMENT: Attaches the texture to the...
...ffers used to render an image. gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the texture. Possible values: gl.COLOR_ATTACHMENT{0-15}: Attaches the texture to one of the framebuffer's color buffers. gl.
DEPTH_ATTACHMENT: Attaches the texture to the framebuffer's
depth buffer. gl.STENCIL_ATTACHMENT: Attaches the texture to the framebuffer's stencil buffer. gl.
DEPTH_STENCIL_ATTACHMENT:
depth and stencil buffer. texture A WebGLTexture object whose image to attach. level A GLint specifying the mipmap level of the texture image to attach. layer A GLint specifying the layer of the texture image to attach. Return value None. Examples gl.framebuffer...
WebGL2RenderingContext.invalidateSubFramebuffer() - Web APIs
The WebGL2RenderingContext.invalidateSubFramebuffer() method of the WebGL 2 API invalidates portions of the contents of attachments in a framebuffer. Syntax void gl.invalidateSubFramebuffer(target, attachments, x, y, width, height); Parameters target A GLenum specifying the binding point (target). Possible values: gl.FRAMEBUFFER: Collection buffer data storage of color, alpha,
depth and stencil buffers used to render an image. gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachments An Array of GLenum specifying the attachment points to invalidate. Possible values: gl.COLOR_ATTACHMENT{0-15}: Invalidates one of the framebuffer's color buffers. gl.
DEPTH_ATTACHMENT: Invalidates the framebuffer's...
...and stencil buffers used to render an image. gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachments An Array of GLenum specifying the attachment points to invalidate. Possible values: gl.COLOR_ATTACHMENT{0-15}: Invalidates one of the framebuffer's color buffers. gl.
DEPTH_ATTACHMENT: Invalidates the framebuffer's
depth buffer. gl.STENCIL_ATTACHMENT: Invalidates the framebuffer's stencil buffer. gl.
DEPTH_STENCIL_ATTACHMENT: Invalidates both the framebuffer's
depth and stencil buffer. x A GLint specifying the left origin of the pixel rectangle to invalidate. y A GLint specifying the bottom origin of the pixel rectangle to invalidate. width A GLsizei specifying the width of the pixel rectangle to inv...
WebGL2RenderingContext.texStorage3D() - Web APIs
Possible values: gl.TEXTURE_3D: A three-dimensional texture. gl.TEXTURE_2D_ARRAY: A two-dimensional array texture. level A GLint specifying the number of texture levels. ...
...ED_R11_EAC gl.COMPRESSED_RG11_EAC gl.COMPRESSED_SIGNED_RG11_EAC gl.COMPRESSED_RGB8_ETC2 gl.COMPRESSED_RGBA8_ETC2_EAC gl.COMPRESSED_SRGB8_ETC2 gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC gl.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 gl.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 width A GLsizei specifying the width of the texture. height A GLsizei specifying the height of the texture.
depth A GLsizei specifying the
depth of the texture. Return value None. Examples gl.texStorage3D(gl.TEXTURE_3D, 1, gl.RGB8, 256, 256, 256); Specifications Specification Status Comment WebGL 2.0The definition of 'texStorage3D' in that specification. Editor's Draft Initial definition for WebGL. OpenGL ES 3.0The definition of 'glTexStorage3D' in that specifi...
WebGLRenderingContext.checkFramebufferStatus() - Web APIs
The WebGLRenderingContext.checkFramebufferStatus() method of the WebGL API returns the completeness status of the WebGLFramebuffer object. Syntax GLenum gl.checkFramebufferStatus(target); Parameters target A GLenum specifying the binding point (target). Possible values: gl.FRAMEBUFFER: Collection buffer data storage of color, alpha,
depth and stencil buffers used to render an image. When using a WebGL 2 context, the following values are available additionally: gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. Return value A GLenum indicating the completeness status of the framebuffer or 0 if an error occurs. Possi...
...y. gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT: The attachment types are mismatched or not all framebuffer attachment points are framebuffer attachment complete. gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: There is no attachment. gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS: Height and width of the attachment are not the same. gl.FRAMEBUFFER_UNSUPPORTED: The format of the attachment is not supported or if
depth and stencil attachments are not the same renderbuffer. When using a WebGL 2 context, the following values can be returned additionally: gl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: The values of gl.RENDERBUFFER_SAMPLES are different among attached renderbuffers, or are non-zero if the attached images are a mix of renderbuffers and textures. When using the OVR_multiview2 extension, the foll...
WebGLRenderingContext.framebufferRenderbuffer() - Web APIs
ingContext.framebufferRenderbuffer() method of the WebGL API attaches a WebGLRenderbuffer object to a WebGLFramebuffer object. Syntax void gl.framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer); Parameters target A GLenum specifying the binding point (target) for the framebuffer. Possible values: gl.FRAMEBUFFER: Collection buffer data storage of color, alpha,
depth and stencil buffers used to render an image. When using a WebGL 2 context, the following values are available additionally: gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for...
...following values are available additionally: gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the render buffer. Possible values: gl.COLOR_ATTACHMENT0: color buffer. gl.
DEPTH_ATTACHMENT:
depth buffer. gl.
DEPTH_STENCIL_ATTACHMENT:
depth and stencil buffer. gl.STENCIL_ATTACHMENT: stencil buffer. When using a WebGL 2 context, the following values are available additionally: gl.COLOR_ATTACHMENT1 gl.COLOR_ATTACHMENT2 gl.COLOR_ATTACHMENT3 gl.COLOR_ATTACHMENT4 gl.COLOR_ATTACHMENT5 gl.COLOR_ATTACHMENT6 gl.COLOR_ATTACHMENT7 gl.C...
WebGLRenderingContext.getExtension() - Web APIs
document.getElementById('canvas'); gl = canvas.getContext('webgl'); gl.getExtension('WEBGL_lose_context').loseContext(); WebGL extensions Extensions for the WebGL API are registered in the WebGL Extension Registry. ...
... Recommendation Initial definition. ...
WebGLRenderingContext.getRenderbufferParameter() - Web APIs
currently bound renderbuffer. gl.RENDERBUFFER_INTERNAL_FORMAT: Returns a GLenum indicating the internal format of the currently bound renderbuffer. The default is gl.RGBA4. Possible return values: gl.RGBA4: 4 red bits, 4 green bits, 4 blue bits 4 alpha bits. gl.RGB565: 5 red bits, 6 green bits, 5 blue bits. gl.RGB5_A1: 5 red bits, 5 green bits, 5 blue bits, 1 alpha bit. gl.
DEPTH_COMPONENT16: 16
depth bits. gl.STENCIL_INDEX8: 8 stencil bits. gl.RENDERBUFFER_GREEN_SIZE: Returns a GLint that is the resolution size (in bits) for the green color. gl.RENDERBUFFER_BLUE_SIZE: Returns a GLint that is the resolution size (in bits) for the blue color. gl.RENDERBUFFER_RED_SIZE: Returns a GLint that is the resolution size (in bits) for the red color. gl.RENDERBUFFE...
...s a GLint that is the resolution size (in bits) for the green color. gl.RENDERBUFFER_BLUE_SIZE: Returns a GLint that is the resolution size (in bits) for the blue color. gl.RENDERBUFFER_RED_SIZE: Returns a GLint that is the resolution size (in bits) for the red color. gl.RENDERBUFFER_ALPHA_SIZE: Returns a GLint that is the resolution size (in bits) for the alpha component. gl.RENDERBUFFER_
DEPTH_SIZE: Returns a GLint that is the resolution size (in bits) for the
depth component. gl.RENDERBUFFER_STENCIL_SIZE: Returns a GLint that is the resolution size (in bits) for the stencil component. When using a WebGL 2 context, the following value is available additionally: gl.RENDERBUFFER_SAMPLES: Returns a GLint indicating the number of samples of the image of the currently bound rend...
WebGLRenderingContext.getSupportedExtensions() - Web APIs
, 'EXT_blend_minmax', ... ] See also the WebGLRenderingContext.getExtension() method to get a specific extension object. WebGL extensions Extensions for the WebGL API are registered in the WebGL Extension Registry. ...
... Recommendation Initial definition. ...
WebGLRenderingContext.stencilOp() - Web APIs
lOp() method of the WebGL API sets both the front and back-facing stencil test actions. Syntax void gl.stencilOp(fail, zfail, zpass); Parameters All three parameters accept all constants listed below. fail A GLenum specifying the function to use when the stencil test fails. The default value is gl.KEEP. zfail A GLenum specifying the function to use when the stencil test passes, but the
depth test fails. The default value is gl.KEEP. zpass A GLenum specifying the function to use when both the stencil test and the
depth test pass, or when the stencil test passes and there is no
depth buffer or
depth testing is disabled. The default value is gl.KEEP. Return value None. Constants gl.KEEP Keeps the current value. gl.ZERO Sets the stencil buffer value to 0. gl.REPLACE Sets th...
...when decrementing a stencil buffer value of 0. gl.INVERT Inverts the current stencil buffer value bitwise. Examples The stencil testing is disabled by default. To enable or disable stencil testing, use the enable() and disable() methods with the argument gl.STENCIL_TEST. gl.enable(gl.STENCIL_TEST); gl.stencilOp(gl.INCR, gl.DECR, gl.INVERT); To get the current information about stencil and
depth pass or fail, query the following constants with getParameter(). gl.getParameter(gl.STENCIL_FAIL); gl.getParameter(gl.STENCIL_PASS_
DEPTH_PASS); gl.getParameter(gl.STENCIL_PASS_
DEPTH_FAIL); gl.getParameter(gl.STENCIL_BACK_FAIL); gl.getParameter(gl.STENCIL_BACK_PASS_
DEPTH_PASS); gl.getParameter(gl.STENCIL_BACK_PASS_
DEPTH_FAIL); gl.getParameter(gl.STENCIL_BITS); Specifications Specifica...
WebGLRenderingContext.stencilOpSeparate() - Web APIs
pass parameters accept all constants listed below. face A GLenum specifying whether the front and/or back stencil state is updated. The possible values are: gl.FRONT gl.BACK gl.FRONT_AND_BACK fail A GLenum specifying the function to use when the stencil test fails. The default value is gl.KEEP. zfail A GLenum specifying the function to use when the stencil test passes, but the
depth test fails. The default value is gl.KEEP. zpass A GLenum specifying the function to use when both the stencil test and the
depth test pass, or when the stencil test passes and there is no
depth buffer or
depth testing is disabled. The default value is gl.KEEP. Return value None. Constants gl.KEEP Keeps the current value. gl.ZERO Sets the stencil buffer value to 0. gl.REPLACE Sets th...
...a stencil buffer value of 0. gl.INVERT Inverts the current stencil buffer value bitwise. Examples The stencil testing is disabled by default. To enable or disable stencil testing, use the enable() and disable() methods with the argument gl.STENCIL_TEST. gl.enable(gl.STENCIL_TEST); gl.stencilOpSeparate(gl.FRONT, gl.INCR, gl.DECR, gl.INVERT); To get the current information about stencil and
depth pass or fail, query the following constants with getParameter(). gl.getParameter(gl.STENCIL_FAIL); gl.getParameter(gl.STENCIL_PASS_
DEPTH_PASS); gl.getParameter(gl.STENCIL_PASS_
DEPTH_FAIL); gl.getParameter(gl.STENCIL_BACK_FAIL); gl.getParameter(gl.STENCIL_BACK_PASS_
DEPTH_PASS); gl.getParameter(gl.STENCIL_BACK_PASS_
DEPTH_FAIL); gl.getParameter(gl.STENCIL_BITS); Specifications Specifica...
Matrix math for the web - Web APIs
veMe = document.getElementById('move-me'); // Returns a result like: "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 50, 100, 0, 1);" let matrix3dRule = matrixArrayToCssMatrix(translationMatrix); // Set the transform moveMe.style.transform = matrix3dRule; View on JSFiddle Scale matrix A scale matrix makes something larger or smaller in one or more of the three dimensions: width, height, and
depth. ...
...; // Set the transform moveMe.style.transform = matrix3dRule; View on JSFiddle Scale matrix A scale matrix makes something larger or smaller in one or more of the three dimensions: width, height, and
depth. In typical (cartesian) coordinates. this causes stretching or contracting of the object in the corresponding directions. The amount of change to apply to each of the width, height, and
depth is placed diagonally starting at the top-left corner and making their way down toward the bottom-right. let w = 1.5; // width (x) let h = 0.7; // height (y) let d = 1; //
depth (z) let scaleMatrix = [ w, 0, 0, 0, 0, h, 0, 0, 0, 0, d, 0, 0, 0, 0, 1 ]; View on JSFiddle Rotation matrix A rotation matrix is used to rotate a point or object. ...
Using WebGL extensions - Web APIs
ensions are available. var available_extensions = gl.getSupportedExtensions(); The WebGLRenderingContext.getSupportedExtensions() method returns an array of strings, one for each supported extension. ...
...For example: var float_texture_ext = gl.getExtension('OES_texture_float'); The return value is null if the extension is not supported, or an extension object otherwise. Extension objects If an extension defines specific symb...
WebXR performance guide - Web APIs
ndering, avoiding unnecessary drawing, etc. Can probably also include stuff from https://github.com/immersive-web/webxr/blob/master/explainer.md#changing-the-field-of-view-for-inline-sessions Managing rendering quality ... This section will come in part from https://github.com/immersive-web/webxr/blob/master/explainer.md#controlling-rendering-quality Managing frame rate ... ...
...r/explainer.md#changing-the-field-of-view-for-inline-sessions Managing rendering quality ... This section will come in part from https://github.com/immersive-web/webxr/blob/master/explainer.md#controlling-rendering-quality Managing frame rate ... Managing use of
depth ... This section will combine information from https://github.com/immersive-web/webxr/blob/master/explainer.md#controlling-
depth-precision and https://github.com/immersive-web/webxr/blob/master/explainer.md#preventing-the-compositor-from-using-the-
depth-buffer Optimizing memory use When using libraries that perform things such as matrix mathematics, you typically have a number of working variables through which various vectors, matrices, and quaternions pass over time. It makes sense, then, to have a limited set of these...
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
elays longer than specified There are a number of reasons why a timeout may take longer to fire than anticipated. This section describes the most common reasons. Timeouts throttled to >= 4ms In modern browsers, setTimeout()/setInterval() calls are throttled to a minimum of once every 4 ms when successive calls are triggered due to callback nesting (where the nesting level is at least a certain
depth), or after certain number of successive intervals. Take this example: function cb() { f(); setTimeout(cb, 0); } setTimeout(cb, 0); setInterval(f, 0); In Chrome and Firefox, the 5th successive callback call is clamped; Safari clamps on the 6th call; in Edge its the 3rd one. Gecko started to treat setInterval() like this in version 56 (it already did this with setTimeout(); see below). Historica...
...Safari clamps on the 6th call; in Edge its the 3rd one. Gecko started to treat setInterval() like this in version 56 (it already did this with setTimeout(); see below). Historically some browsers implemented this throttling behaviour a bit differently (e.g. Firefox) -- on setInterval() calls made from anywhere, or when a nested setTimeout() is called where the nesting level is at least a certain
depth. To implement a 0 ms timeout in a modern browser, you can use window.postMessage() as described here. Note: The minimum delay, DOM_MIN_TIMEOUT_VALUE, is 4 ms (stored in a preference in Firefox: dom.min_timeout_value), with a DOM_CLAMP_TIMEOUT_NESTING_LEVEL of 5. Note: 4 ms is specified by the HTML5 spec and is consistent across browsers released in 2010 and onward. Prior to (Firefox 5.0 / T...
XRRenderStateInit - Web APIs
alling an XRSession's updateRenderState() method to apply changes to the render state prior to rendering the next frame. All distances are specified as floating-point values in meters; you can specify a value of 50 centimeters using a value of 0.5, for example. Properties baseLayer Optional An XRWebGLLayer object from which the WebXR compositor will obtain imagery. This is null by default. ...
... baseLayer Optional An XRWebGLLayer object from which the WebXR compositor will obtain imagery. This is null by default.
depthFar Optional A floating-point value specifying the distance in meters from the viewer to the far clip plane, which is a plane parallel to the display surface beyond which no further rendering will occur. All rendering will take place between the distances specified by
depthNear and
depthFar. This is 1000 meters (1 kilometer) by default.
depthNear Optional A floating-point value indicating the distance in meters from the viewer to a plane parallel to the display surface to be the near clip plane. No part of the scene on the viewer's side of this plane will be rendered. This is 0.1 meters (10 centimeters) by default. inlineVerticalFieldOfView Optional A floating-p...
XRSession.updateRenderState() - Web APIs
RenderState(newState) Parameters newState An object conforming to the XRRenderStateInit dictionary specifying the properties of the session's renderState to update before rendering the next frame. The specified object may have any combination of the following fields. baseLayer Optional An XRWebGLLayer object from which the WebXR compositor will obtain imagery. This is null by default. ...
... baseLayer Optional An XRWebGLLayer object from which the WebXR compositor will obtain imagery. This is null by default.
depthFar Optional A floating-point value specifying the distance in meters from the viewer to the far clip plane, which is a plane parallel to the display surface beyond which no further rendering will occur. All rendering will take place between the distances specified by
depthNear and
depthFar. This is 1000 meters (1 kilometer) by default.
depthNear Optional A floating-point value indicating the distance in meters from the viewer to a plane parallel to the display surface to be the near clip plane. No part of the scene on the viewer's side of this plane will be rendered. This is 0.1 meters (10 centimeters) by default. inlineVerticalFieldOfView Optional A floating-p...
XRView.eye - Web APIs
ose's renderer, iterates over the pose's views and renders them. However, we have flags which, if true, indicate that a particular eye has been injured during gameplay. When rendering that eye, if the flag is true, that view is skipped instead of being rendered. ...
...s and renders them. However, we have flags which, if true, indicate that a particular eye has been injured during gameplay. When rendering that eye, if the flag is true, that view is skipped instead of being rendered. ...
XRViewerPose.views - Web APIs
f a valid pose is returned, the frame is rendered by clearing the backbuffer and then rendering each of the views in the pose; these are most likely the views for the left and right eyes. ...
...ered by clearing the backbuffer and then rendering each of the views in the pose; these are most likely the views for the left and right eyes. ...
XRViewerPose - Web APIs
f a valid pose is returned, the frame is rendered by clearing the backbuffer and then rendering each of the views in the pose; these are most likely the views for the left and right eyes. ...
...ered by clearing the backbuffer and then rendering each of the views in the pose; these are most likely the views for the left and right eyes. ...
XRWebGLLayer() - Web APIs
annel if the alpha Boolean property is true. Otherwise, the color buffer will not have an alpha channel. The default value is true. antialias Optional A Boolean value which is true if anti-aliasing is to be used when rendering in the context; otherwise false. The browser selects the anti-aliasing method to use; there is no support for requesting a specific mode yet. The default value is true.
depth Optional A Boolean value which, if true, requests that the new layer have a
depth buffer; otherwise, no
depth layer is allocated. The default is true. framebufferScaleFactor Optional A floating-point value which is used to scale the image during compositing, with a value of 1.0 represents the default pixel size for the frame buffer. The static XRWebGLLayer function XRWebGLLayer.getNativeFrameb...
... floating-point value which is used to scale the image during compositing, with a value of 1.0 represents the default pixel size for the frame buffer. The static XRWebGLLayer function XRWebGLLayer.getNativeFramebufferScaleFactor() returns the scale that would result in a 1:1 pixel ratio, thereby ensuring that the rendering is occurring at the device's native resolution. The default is 1.0. ignore
DepthValues Optional A Boolean value which indicates whether or not to ignore the contents of the
depth buffer while compositing the scene. The default is false. stencil Optional A Boolean value which, if true, requests that the new layer include a stencil buffer. Otherwise, no stencil buffer is allocated. The default is false. Return value A newly-created XRWebGLLayer which links the specified ...
Web APIs
MotionEventRotationRate DeviceOrientationEvent DeviceProximityEvent DirectoryEntrySync DirectoryReaderSync DisplayMediaStreamConstraints Document DocumentFragment DocumentOrShadowRoot DocumentTimeline DocumentTouch DocumentType DoubleRange DragEvent DynamicsCompressorNode E EXT_blend_minmax EXT_color_buffer_float EXT_color_buffer_half_float EXT_disjoint_timer_query EXT_float_blend EXT_frag_
depth EXT_sRGB EXT_shader_texture_lod EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic EcKeyGenParams EcKeyImportParams EcdhKeyDeriveParams EcdsaParams EffectTiming Element ElementCSSInlineStyle ElementTraversal ErrorEvent Event EventListener EventSource EventTarget ExtendableEvent ExtendableMessageEvent F FeaturePolicy FederatedCredential FetchEvent Fil...
...gion ValidityState VideoConfiguration VideoPlaybackQuality VideoTrack VideoTrackList VisualViewport W WEBGL_color_buffer_float WEBGL_compressed_texture_astc WEBGL_compressed_texture_atc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_pvrtc WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_
depth_texture WEBGL_draw_buffers WEBGL_lose_context WakeLock WakeLockSentinel WaveShaperNode WebGL2RenderingContext WebGLActiveInfo WebGLBuffer WebGLContextEvent WebGLFramebuffer WebGLProgram WebGLQuery WebGLRenderbuffer WebGLRenderingContext WebGLSampler WebGLShader WebGLShaderPrecisionFormat WebGLSync WebGLTexture WebGLTransformFeedback WebGLUniformLocation WebGLVertexArrayObject WebKitCSSMat...
Architecture - Accessibility
xes. otherwise, use IAHyperLink::getStartIndex() to find the index in parent. ...
...n a hard line break: If the current accessible's IA2 role is SECTION, HEADING or PARAGRAPH then we are on a hard line break, so stop get the offset in the parent text for this object (see B above), and then repeat step (C)2 above done (D) To get the next word or line: Look one character ahead. If the next character does not exist, proceed to the next accessible in
depth first search order and recurse on the first character until a non-embed is found. If the current character falls within a text substring, locate the line ending of that substring or the next embed, whichever comes first: Get the current line start and end offsets. Compute the item offset relative to the start of this line Search forward from the starting offset for an emb...
Link types - HTML: Hypertext Markup Language
thors must not use it anymore. <link> <a>, <area>, <form> import HTML Imports <link> <a>, <area>, <form> index Obsolete since HTML5 Indicates that the page is part of a hierarchical structure and that the hyperlink leads to the top level resource of that structure. If one or several up link types are also present, the number of these up indicates the
depth of the current page in the hierarchy. <a>, <area>, <link> <form> last Indicates that the hyperlink leads to the last resource of the sequence the current page is in. Note: Other link types related to linking resources in the same sequence are first, prev, next. Although recognized, the synonym end is incorrect and must be avoided. <a>, <area>, <link> <f...
...s document. Note: This link type should not be set on links to a member of a tag cloud as these do not apply to a single document but to a set of pages. <a>, <area> <link>, <form> up Indicates that the page is part of a hierarchical structure and that the hyperlink leads to the higher level resource of that structure. The number of up link types indicates the
depth difference between the current page and the linked resource. <a>, <area>, <link> <form> Specifications Specification Status Comment PreloadThe definition of 'preload' in that specification. Candidate Recommendation Added preload. Resource HintsThe definition of 'preconnect' in that specification. Working Draft Added dns-prefetch, prec...
Array.prototype.flatMap() - JavaScript
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...aking three arguments: currentValue The current element being processed in the array. indexOptional The index of the current element being processed in the array. arrayOptional The array map was called upon. thisArgOptional Value to use as this when executing callback. Return value A new array with each element being the result of the callback function and flattened to a
depth of 1. Description See Array.prototype.map() for a detailed description of the callback function. The flatMap method is identical to a map followed by a call to flat of
depth 1. Alternative reduce() and concat() var arr = [1, 2, 3, 4]; arr.flatMap(x => [x, x * 2]); // is equivalent to arr.reduce((acc, x) => acc.concat([x, x * 2]), []); // [1, 2, 2, 4, 3, 6, 4, 8] Note, however, that this i...
<mpadded> - MathML
Possible values: Any length or an increment/decrement (a length prefixed with "+" or "-") . height Sets or increments the height. Possible values: Any length or an increment/decrement (a length prefixed with "+" or "-") . href Used to set a hyperlink to a specified URI. lspace Sets or increments the horizontal position. ...
...athcolor The text color. You can use #rgb, #rrggbb and HTML color names. voffset Sets or increments the vertical position. Possible values: Any length or an increment/decrement (a length prefixed with "+" or "-") . width Sets or increments the width. Possible values: Any length or an increment/decrement (a length prefixed with "+" or "-") . Pseudo-units It is possible to use the keywords "
depth", "height", and "width" as a pseudo-unit for the attributes
depth, height, lspace, voffset, and width. They represent each length of the same-named dimension. Prior to Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4) the MathML2 pseudo-unit lspace was allowed, which is no longer present in the MathML3 Recommendation and has been removed now. Examples <math> <mpadded height="+150px"...
<mspace> - MathML
height The desired height (above the baseline) of the space (see length for values and units). linebreak Indicates a line-break at the space. Possible values: auto (default value), newline, nobreak, goodbreak, badbreak. Starting with MathML 3, it is preferred to use <mo> to control linebreaking. mathbackground The background color. ...
...ne, nobreak, goodbreak, badbreak. Starting with MathML 3, it is preferred to use <mo> to control linebreaking. mathbackground The background color. You can use #rgb, #rrggbb and HTML color names. width The desired width of the space (see length for values and units). Note that some common attributes like mathcolor, mathvariant or dir have no effect on <mspace>. Examples <math> <mspace
depth="40px" height="20px" /> <mspace width="100px" /> </math> Specifications Specification Status Comment MathML 3.0The definition of 'mspace' in that specification. Recommendation Current specification MathML 2.0The definition of 'mspace' in that specification. Recommendation Initial specification ...
Guides - Archive of obsolete content
Contributor's guide Getting Started Learn how to contribute to the SDK: getting the code, opening/taking a bug, filing a patch, getting reviews, and getting help. Modules Learn about the module system used by the SDK (which is based on the CommonJS specification), how sandboxes and compartments can be used to improve security, and about the built-in SDK module loader, known as Cuddlefish. Classes and Inheritance Learn how classes and inheritance can be implemented in JavaScript, using constructors and prototypes, and about the helper functions provided by the SDK to simplify this. ...
util/array - Archive of obsolete content
s a duplicate-free version of the given array. let { unique } = require('sdk/util/array'); let a = [1, 1, 1, 1, 3, 4, 7, 7, 10, 10, 10, 10]; let b = unique(a); console.log(a); // [1, 1, 1, 1, 3, 4, 7, 7, 10, 10, 10, 10]; console.log(b); // [1, 3, 4, 7, 10]; Parameters array : array Source array. Returns array : The new, duplicate-free array. flatten(array) Flattens a nested array of any
depth. let { flatten } = require('sdk/util/array'); let a = ['cut', ['ice', ['fire']], 'elec']; let b = flatten(a); console.log(a); // ['cut', ['ice', ['fire']], 'elec'] console.log(b); // ['cut', 'ice', 'fire', 'elec']; Parameters array : array The array to flatten. Returns array : The new, flattened array. fromIterator(iterator) Iterates over an iterator and returns the results as an array.
Adding sidebars - Archive of obsolete content
> <treecell label="John"/> <treecell label="Good evening, how are you doing?" /> </treerow> </treeitem> </treechildren> </tree> The text in the rows of the tree is hardcoded because we wouldn't generally use text from locale files. We would use data from a datasource such as a database or a remote API. This tree is not much of a tree because it only has one level of
depth. A more elaborate tree would look like this: <tree flex="1"> <treecols> <treecol label="&xulschoolhello.nameColumn.label;" flex="1" /> <treecol label="&xulschoolhello.greetingColumn.label;" flex="3" /> </treecols> <treechildren> <treeitem> <treerow> <treecell label="Peter" /> <treecell label="Hey, what's up?" /> </treerow> </treeitem> <!-- ...
The Essentials of an Extension - Archive of obsolete content
e value of the attribute is JavaScript code that invokes a function. This function is defined in the JS file that was included with the script tag. The JS function will be called once the user clicks on the menu item in the Hello World menu. All event handlers define a special object named event, which is usually good to pass as an argument to the function. Event handlers are explained in greater
depth further ahead. Now let's look at the JavaScript file and see what's going on when the event is fired. /** * XULSchoolChrome namespace. */ if ("undefined" == typeof(XULSchoolChrome)) { var XULSchoolChrome = {}; }; The XULSchoolChrome namespace is defined. All objects and variables we define in this JavaScript are global, meaning that scripts in Firefox and other extensions can see them ...
Using Dependent Libraries In Extension Components - Archive of obsolete content
xtension-directory/install.rdf extension-directory/libraries/dependent1.dll extension-directory/libraries/dependent2.dll extension-directory/libraries/component.dll extension-directory/components/interface1.xpt extension-directory/components/interface2.xpt extension-directory/components/bsmedberg_stub.dll extensions/stub/Makefile.in # Copyright (c) 2005 Benjamin Smedberg <benjamin@smedbergs.us>
DEPTH = ../.. srcdir = @srcdir@ topsrcdir = @top_srcdir@ VPATH = @srcdir@ include $(
DEPTH)/config/autoconf.mk MODULE = bsmedberg LIBRARY_NAME = bsmedberg_stub IS_COMPONENT = 1 FORCE_SHARED_LIB = 1 REQUIRES = \ xpcom \ string \ $(NULL) CPPSRCS = bdsStubLoader.cpp EXTRA_DSO_LDOPTS += \ $(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \ $(XPCOM_FROZEN_LDOPTS) \ $(NSPR_LIBS) \ $(NULL) ...
Index of archived content - Archive of obsolete content
y and packaging it up for distribution Making it into a static overlay Prerequisites Specifying the appearance Tinderbox Creating a Release Tag Creating a Skin for Firefox/Getting Started Creating a Skin for Mozilla FAQ Getting Started In-
Depth Links contents.rdf toolbarBindings.xml Creating a Skin for SeaMonkey 2.x Getting Started chrome.manifest install.rdf Creating a hybrid CD Creating regular expressions for a microsummary generator DTrace ...
Creating a Skin for Mozilla - Archive of obsolete content
ht clicks on an image, but you can change the look of the right click menu (Make it blue with pink polka dots, for example). If you want to change the functionality of Mozilla, you'll have to look into modifying the chrome. That is beyond the scope of this document. ...
Litmus tests - Archive of obsolete content
ere are types of litmus tests. Smoke tests were the first developed. These were developed before litmus, but then pulled in. A "smoke test" is a quick check, done to verify the basic functionality of a certain feature, or a sanity check of the build process. BFTs, or Basic Functionality Tests This set of tests would take longer to run, but will cover an entire release. It may not cover it at much
depth, but it does try to cover the major features. FFTs, or Full Functionality Tests This is supposed to be more comprehensive and will take longer to run. ...
Venkman Introduction - Archive of obsolete content
's keyboard shortcuts are the same as leading visual debugging environments, and gdb users should be familiar with Venkman's /break, /step, /next, /finish, /frame, and /where commands. On Windows, the JavaScript debugger compares favorably with Visual Interdev and other large web development tools. On other platforms, including Mac OS and Unix, it is alone in offering this degree of flexibility,
depth, and power in a visual debugging environment. Starting the Debugger The JavaScript Debugger is automatically pre-installed in Mozilla 1.x but must be installed separately in Firefox and other Gecko-based products, such as Thunderbird and Netscape 7.x. Fortunately, the XPInstall technology makes it possible to install new application modules in Firefox by just clicking a hyperlink. If you don't...
Anonymous Content - Archive of obsolete content
ced under. [Actually, only tag names may be specified; see the includes attribute description in <children> element reference, bug 174614 and bug 51527.] If no attribute is specified, an insertion point is considered generic and will match on all content. The insertion point used for a given piece of content is the first encountered with a selector whose node set matches the element when doing a
depth-first walk of the content template. Note that children elements are never cloned when content is generated from a template. Handling DOM changes Insertion points continuing to be used as elements are inserted or removed from the DOM. Whenever an element is inserted or appended, all insertion points are checked following all the same rules that applied when first placing explicit children durin...
Creating XPI Installer Modules - Archive of obsolete content
ribes the new packaging scheme of Mozilla and offers a tutorial for creating a new package that can then be redistributed, installed, and made available to users. The XPI Packaging Scheme A complete description of the new packaging scheme is beyond the scope of this article. The reader is referred to JAR Packaging, which describes the design, goals, and options available for JAR packaging in some
depth. What follows is a very brief overview of the design and a description of what Mozilla expects in installable packages. Resources are collected in JAR archives whose contents are specified in contents.rdf files at their own top level. The contents.rdf file explains the structure and contents of the archive to Mozilla's chrome registry; as long as the explanation is accurate, the contents can be a...
Accessibility/XUL Accessibility Reference - Archive of obsolete content
right of the column headers) or the column headers themselves (for sorting by column). These functions must be replicated elsewhere (like in the main menu, e.g. the Manage Bookmarks window in Firefox 2 or the Places window in Firefox 3). JAWS 7.10 can not read the column headers. The main tree is accessible like a regular tree control. ...
XUL Coding Style Guidelines - Archive of obsolete content
ogramming examples or a kind of source documentation. To prevent them from being localized, you may insert a line of comment following the XML declaration as follows. <?xml version="1.0" encoding='UTF-8'?> <!-- DO NOT localize this file: [reason...] it isn't part of the build; --> When translators see this line, they won't bother to look at the rest of the file. References XUL is discussed in
depth in XUL Language Spec and XUL Window Language. XUL Localizability issues XHTML 1.1 Recommendation Namespaces in XML Extensible Markup Language (XML) 1.0 Euro Sign The Unicode Standard(R), Version 2.1 "XML Applications" by Frank Boumphrey. Published by Wrox Press Inc. ISBN 1-861001-52-5. Author: Tao Cheng newsgroup discussion mailing list Original Document Information Author(s): Tao Cheng La...
Security Controls - Archive of obsolete content
ample, if passwords must be long and complex, users may write them down. Balancing security, functionality, and usability is often a challenge. The goal should be to strike a proper balance: provide a reasonably secure solution while offering the functionality and usability that users require. Another fundamental principle with security controls is using multiple layers of security--defense in
depth. For example, sensitive data on a server may be protected from external attack by several controls, including a network-based firewall, a host-based firewall, and OS patching. The motivation for having multiple layers is that if one layer fails or otherwise cannot counteract a certain threat, other layers might prevent the threat from successfully breaching the system. A combination of network...
E4X for templating - Archive of obsolete content
<markup/> </>)}</>.toXMLString(); Iterating Functions such as the following foreach (which can work with arrays, objects, or E4X objects) are quite convenient in iterating over complex structures such as E4X would not normally allow. ...
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
amline costs. Common Development Process As an organization matures, managers and engineers develop a fundamental understanding of the importance of requiring adherence to these processes. When projects are proposed, they are evaluated to ensure compatibility with the overall business strategy. Product marketing must then analyze the marketability of the application/product, and then conduct in-
depth technical evaluations and market research studies. If the project is accepted, the compiled information, analysis and research is merged into a Request for Proposal (RFP). This process is not unique: most organizations have basic project management processes for product or service. Even within organizations, their processes are fine-tuned to work within the existing culture. When this happens, a...
Building up a basic demo with PlayCanvas editor - Game development
ly what we want to do. An Entity is any object used in the scene -- it cna be an object like a box, cylinder or cone, but it can also be a camera, light or sound source. After clicking the button you'll see a dropdown list containing a lot of various entities to choose from. Go ahead and click Box -- it will be added to the scene. The box is created with the default values -- width, height and
depth are set to 1, and it is placed in the middle of the scene. You can drag it around or apply new values in the right panel. To add some colors to the scene we need a new material that will be used on the newly created box. Click on the plus button in the Assets tab, and click on the Material option in the dropdown list that appears to create a new material. Click on your new material in the a...
2D maze game with device orientation - Game development
e, you would have to write something like this inside the <body> tag: <canvas id='game' width='320' height='480'></canvas> The important thing to remember is that the framework is setting up helpful methods to speed up a lot of things like image manipulation or assets management, which would be a lot harder to do manually. Note: You can read the Building Monster Wants Candy article for the in-
depth introduction to the basic Phaser-specific functions and methods. Back to game states: the line below is adding a new state called Boot to the game: game.state.add('Boot', Ball.Boot); The first value is the name of the state and the second one is the object we want to assign to it. The start method is starting the given state and making it active. Let's see what the states are actually. Manag...
Signature (functions) - MDN Web Docs Glossary: Definitions of Web-related terms
A function signature (or type signature, or method signature) defines input and output of functions or methods. A signature can include: parameters and their types a return value and type exceptions that might be thrown or passed back information about the availability of the method in an object-oriented program (such as the keywords public, static, or prototype). In
depth Signatures in JavaScript JavaScript is a loosely typed or a dynamic language. That means you don't have to declare the type of a variable ahead of time. The type will get determined automatically while the program is being processed. A signature in JavaScript can still give you some information about the method: MyObject.prototype.myFunction(value) The method is installed on an object called MyObject. ...
Smoke Test - MDN Web Docs Glossary: Definitions of Web-related terms
A smoke test consists of functional or unit tests of critical software functionality. Smoke testing comes before further, in-
depth testing. Smoke testing answers questions like "Does the program start up correctly?" "Do the main control buttons function?" "Can you save a simple blank new test user account?" If this basic functionality fails, there is no point investing time in more detailed QA work at this stage. Learn more General knowledge Smoke testing (software) on Wikipedia ...
Texel - MDN Web Docs Glossary: Definitions of Web-related terms
thin a texture map, which is an image that gets used (in whole or in part) as the image presented on a polygon's surface within a 3D rendered image. It is not to be confused with pixel which is the unit of screen space. This is one of the main differences between Texel's and pixels, pixels are image data. Texel components are made up of subjective data, therefore they can be an image as well as a
depth map. The process of mapping the appropriate Texel's to their corresponding points on a polygon is called texture mapping, which is a stage of the process of rendering a 3D image for display. Texture mapping is typically done prior to lighting the scene; however, in WebGL, lighting is performed as part of the texture mapping process. Textures are characterised by collections of Texel's, as how i...
Debugging CSS - Learn web development
columns. You can also take a look at the Browser compatibility tables at the bottom of each property page on MDN. These show you browser support for that property, often broken down if there is support for some usage of the property and not others. The below table shows the compat data for the shape-outside property. No compatibility data found. Please contribute data for "css.shape-outside" (
depth: 1) to the MDN compatibility data repository. Is something else overriding your CSS? This is where the information you have learned about specificity will come in very useful. If you have something more specific overriding what you are trying to do, you can enter into a very frustrating game of trying to work out what. However, as described above, DevTools will show you what CSS is applying and...
Using your new knowledge - Learn web development
see their code. A link to the actual task or assessment page, so we can find the question you want help with. What's next? Congratulations on finishing this first module. You should now have a good general understanding of CSS, and be able to understand much of what is happening in a stylesheet. In the next module, CSS building blocks, we will go on to look at a number of key areas in
depth. Previous Overview: First steps In this module What is CSS? Getting started with CSS How CSS is structured How CSS works Using your new knowledge ...
How to build custom form controls - Learn web development
the control function, when it loads successfully To achieve this, we need two things: First, we need to add a regular <select> element before each instance of our custom control. There is a benefit to having this "extra" select even if our JavaScript works as hoped: we will use this select to send data from our custom control along with the rest of our form data. We will discuss this in greater
depth later. <body class="no-widget"> <form> <select name="myFruit"> <option>Cherry</option> <option>Lemon</option> <option>Banana</option> <option>Strawberry</option> <option>Apple</option> </select> <div class="select"> <span class="value">Cherry</span> <ul class="optList hidden"> <li class="option">Cherry</li> <li class="optio...
Images in HTML - Learn web development
nning, the Web was just text, and it was really quite boring. Fortunately, it wasn't too long before the ability to embed images (and other more interesting types of content) inside web pages was added. There are other types of multimedia to consider, but it is logical to start with the humble <img> element, used to embed a simple image in a webpage. In this article we'll look at how to use it in
depth, including the basics, annotating it with captions using <figure>, and detailing how it relates to CSS background images. Prerequisites: Basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with HTML fundamentals (as covered in Getting started with HTML.) Objective: To learn how to embed simple images in HTML, annotate them...
Multimedia and Embedding - Learn web development
coding program such as JSBin or Glitch. Guides This module contains the following articles which will take you through all the fundamentals of embedding multimedia on webpages. Images in HTML There are other types of multimedia to consider, but it is logical to start with the humble <img> element used to embed a simple image in a webpage. In this article we'll look at how to use it in more
depth, including basics, annotating it with captions using <figure>, and how it relates to CSS background images. Video and audio content Next, we'll look at how to use the HTML5 <video> and <audio> elements to embed video and audio on our pages, including basics, providing access to different file formats to different browsers, adding captions and subtitles, and how to add fallbacks for older browse...
Index - Learn web development
t, Learn, React, Style, client-side Now our todo list app actually looks a bit more like a real app! The problem is: it doesn't actually do anything. We'll start fixing that in the next chapter! 274 Componentizing our React app Beginner, Frameworks, JavaScript, Learn, React, client-side, events, interactivity, state And that's it for this article -- we've gone into some
depth on how to break up your app nicely into components, end render them efficiently. Now we'll go on to look at how we handle events in React, and start adding some interactivity. 275 Componentizing our Svelte app Beginner, Components, Frameworks, JavaScript, Learn, Svelte, client-side, conditional rendering, passing data Now we have all of our app's required functionality in pla...
Graceful asynchronous programming with Promises - Learn web development
u how promises work, how you'll see them in use with web APIs, and how to write your own. Prerequisites: Basic computer literacy, a reasonable understanding of JavaScript fundamentals. Objective: To understand promises and how to use them. What are promises? We looked at Promises briefly in the first article of the course, but here we'll look at them in a lot more
depth. Essentially, a Promise is an object that represents an intermediate state of an operation -- in effect, a promise that a result of some kind will be returned at some point in the future. There is no guarantee of exactly when the operation will complete and the result will be returned, but there is a guarantee that when the result is available, or the promise fails, the code you provide will be ...
Object prototypes - Learn web development
on the prototype of the String, Date, Number, and Array global objects, for example. These all have a number of members defined on their prototype, which is why for example when you create a string, like this: let myString = 'This is my string.'; myString immediately has a number of useful methods available on it, like split(), indexOf(), replace(), etc. Note: It is worth reading our more in-
depth guide to "Using prototypes in JavaScript", once you've made sense of this section and wish to know more. This section is intentionally simplified to make these concepts a little easier to understand when you first meet them. Important: The prototype property is one of the most confusingly-named parts of JavaScript -- you might think that this points to the prototype object of the current objec...
JavaScript — Dynamic client-side scripting - Learn web development
technologies first, and perhaps others as well. Start by working through the following modules: Getting started with the Web Introduction to HTML Introduction to CSS Having previous experience with other programming languages might also help. After getting familiar with the basics of JavaScript, you should be in a position to learn about more advanced topics, for example: JavaScript in
depth, as taught in our JavaScript guide Web APIs Modules This topic contains the following modules, in a suggested order for working through them. JavaScript first steps In our first JavaScript module, we first answer some fundamental questions such as "what is JavaScript?", "what does it look like?", and "what can it do?", before moving on to taking you through your first practical experience...
Aprender y obtener ayuda - Learn web development
learning web development is more about problem-solving and learning patterns than it is about learning lots of syntaxes. Videos There are also a number of sites that have video learning content on them. YouTube is an obvious one, with channels such as Mozilla Layout Land, MozillaDeveloper, and Google ChromeDevelopers providing many useful videos. Many people prefer textual articles for more in-
depth learning and reference material, and videos for quick explanations of concepts and new features, but it is really up to you what you prefer to learn from. There is no right and wrong answer here. Interactive code playgrounds You might be the kind of person that prefers minimal instructions and would prefer to jump straight in and start playing with code. This is also a reasonable approach, and ...
Multimedia: Images - Learn web development
ter literacy, basic software installed, and basic knowledge of client-side web technologies. Objective: To learn about the various image formats, their impact on performance, and how to reduce the impact of images on overall page load time. This is a high-level introduction to optimizing multimedia delivery on the web, covering general principles and techniques. For a more in-
depth guide, see https://images.guide. Why optimize your multimedia? For the average website, 51% of its bandwidth comes from imagery, followed by video at 25%, so it's safe to say it's important to address and optimize your multi-media content. You need to be considerate of data usage. Many people are on capped data plans or even pay-as-you-go where they are literally paying by the megabyte. This...
Componentizing our React app - Learn web development
Now we'll go on to look at how we handle events in React, and start adding some interactivity. Previous Overview: Client-side JavaScript frameworks Next In this module Introduction to client-side frameworks Framework main features React Getting started with React Beginning our React todo list ...
Getting started with React - Learn web development
lf unless you want to. Because JSX is a blend of HTML and JavaScript, some developers find it intuitive. Others say that its blended nature makes it confusing. Once you're comfortable with it, however, it will allow you to build user interfaces more quickly and intuitively, and allow others to better understand your codebase at a glance. To read more about JSX, check out the React team's JSX In
Depth article. Setting up your first React app There are many ways to use React, but we're going to use the command-line interface (CLI) tool create-react-app, as mentioned earlier, which expedites the process of developing a React application by installing some packages and creating some files for you, handling the tooling described above. It's possible to add React to a website without create-reac...
Getting started with Svelte - Learn web development
uld be enough to make you interested to explore it. Note: recently Svelte has added official TypeScript support, one of its most requested features. We'll look at it later on in this tutorial series. We encourage you to go through the Svelte tutorial for a really quick introduction to the basic concepts, before returning to this tutorial series to learn how to build something slightly more in-
depth. It should take you about 30 minutes to complete. Use cases Svelte can be used to develop small pieces of an interface or whole applications. You can either start from scratch letting Svelte drive your UI or you can incrementally integrate it into an existing application. Nevertheless, Svelte is particularly appropriate to tackle the following situations: Web applications intended for low p...
Vue resources - Learn web development
terminal with node + npm installed. Objective: To learn where to go to find further information on Vue, to continue your learning. Further resources Here's where you should go to learn more about Vue: Vue Docs -- The main Vue site. Contains comprehensive documentation, including examples, cookbooks, and reference material. This is the best place to start learning Vue in
depth. Vue Github Repo -- The Vue code itself. This is where you can report issues and/or contribute directly to the Vue codebase. Studying the Vue source code can help you better understand how the framework works, and write better code. Vue Forum -- The official forum for getting help with Vue. Vue CLI Docs -- Documentation for the Vue CLI. This contains information on customizing and extending th...
Understanding client-side JavaScript frameworks - Learn web development
We want you to go forward and learn about frameworks in a pragmatic way that doesn't forget about web platform fundamental best practices such as accessibility. Get started now, with "Introduction to client-side frameworks" Prerequisites You should really learn the basics of the core web languages first before attempting to move on to learning client-side frameworks -- HTML, CSS, and...
Handling common HTML and CSS problems - Learn web development
n:hover { background-color: rgba(255,0,0,0.5); } button:active { box-shadow: inset 1px 1px 3px rgba(0,0,0,0.4), inset -1px -1px 3px rgba(255,255,255,0.4); } Here we are providing an RGBA background-color that changes opacity on hover to give the user a hint that the button is interactive, and some semi-transparent inset box-shadow shades to give the button a bit of texture and
depth. The trouble is that RGBA colors and box shadows don't work in IE versions older than 9 -- in older versions the background just wouldn't show up at all so the text would be unreadable, no good at all! To sort this out, we have added a second background-color declaration, which just specifies a hex color -- this is supported way back in really old browsers, and acts as a fallback if the modern...
Git and GitHub - Learn web development
rse, but for now, these will help you get to grips with the subject in hand. Hello World (from GitHub) This is a good place to start -- this practical guide gets you to jump right into using GitHub, learning the basics of Git such as creating repositories and branches, making commits, and opening and merging pull requests. Git Handbook (from GitHub) This Git Handbook goes into a little more
depth, explaining what a VCS is, what a repository is, how the basic GitHub model works, Git commands and examples, and more. Forking Projects (from GitHub) Forking projects is essential when you want to contribute to someone else's code. This guide explains how. About Pull Requests (from GitHub) A useful guide to managing pull requests, the way that your suggested code changes are delivered to peo...
Creating reftest-based unit tests
e exactly 4. But an operating system does change with time. It is not invariant. And a browser may change the visual effect produced by a tag while still being compliant with relevant standards. For example, the HTML 4.01 specification at the W3C specifies that text inside of a <blockquote> will be indented, but it does not specify the number of pixels of the indentation. If a browser changes the
depth of the indenting and the visual construct is tested against an invariant, the test would appear to fail. But the test should not fail, unless the "<blockquote>" element did not cause any indentation at all. If a regression test harness has false failures, it makes the harness not trustworthy and the harness will not be used. Running reftest-based unit tests Note: mach is a Python2 script. If y...
How to add a build-time test
will go orange (once we've set this up - see bug 352240 for status). For example, to add an xpcshell test to a module, do the following: Copy tools/test-harness/xpcshell-simple/example to yourmoduledir/tests_type, wheretests_type is something that describes your tests. You can of course use unit or test if you're not feeling creative. In <tt>yourmoduledir/tests_type/Makefile.in</tt> change
DEPTH, MODULE, and XPCSHELL_TESTS appropriately:
DEPTH should be a relative path pointing to <tt>mozilla/</tt>, e.g. if you're in <tt>netwerk/test</tt>, set
DEPTH = ../.. MODULE should be defined to test_yourmodule or just yourmodule -- either will work fine. XPCSHELL_TESTS be a list of subdirectories of the current directory which contain xpcshell tests. You can of course just use the onet...
Extras
</mo> <mo>[</mo> <mtable> <mtr> <mtd><mn>1</mn></mtd> <mtd> <mtext> <img width="16" height="16" src="https://udn.realityripple.com/samples/3f/9341cbddc0.png" alt="mozilla-16" /> </mtext> </mtd> </mtr> <mtr> <mtd> <mtext><input value="type" size="4"/></mtext> </mtd> <mtd><mn>4</mn></mtd> </mtr> </mtable> <mo>]</mo> </mrow> </math> <math display="block"> <msqrt> <mpadded width="30px" height="15px"
depth="15px" voffset="-15px"> <mtext> <svg width="30px" height="30px"> <defs> <radialGradient id="radGrad1" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:rgb(255,255,255); stop-opacity:1;"/> <stop offset="100%" style="stop-color:rgb(255,0,0); stop-opacity:.8;"/> </radialGradient> </defs> <g transform=...
MathML Demo: <mo> - operator, fence, separator, or accent
a + b ? c / d a + b ? c ? d a + b ? c * d a + b !<= c x d a + b !=> c / d a + b !<=> c ? d a + b !<-> c * d Fences LaTeX fences that begin with \left and \right are stretchy. They grow vertically to the height and
depth of the enclosed math run. This growth is continuous and symmetric. Here are examples of the standard LaTeX fences ( x ) [ y ] { 1 } < T > ? a ? ? . ? | ? | || ? || and / F / \ n \ ? R ? ? 1.0 ? ? x 2 ? ? x a 2 ? ? x ? ? M ? . Here are some examples with a bit more stretching ( k 1 2 2 ) [ k 1 2 2 ] { k 1 2 2 } < ...
Mozilla Style System Documentation
e rather than the style context and shared between all style contexts pointing to that rule node. Furthermore, if the rule specifies no values for a struct, it can use the same struct as its parent. While the style context tree is generally quite deep, since it corresponds roughly to the content tree, the rule tree is generally quite broad (but are there cases where it is quite deep??), since the
depth of a node in the tree corresponds to the number of rules matched. Therefore, inherited structs are cached on the style context (but only the top style contexts pointing to them actually "owns" them), but structs that are shared between rule nodes are stored only on the highest rule node to which they apply and then retrieved from that most upper rule node every time they are needed. The code that...
Profiling with the Firefox Profiler
m with time. Factors such as sampling or stack-walking variance and system load can lead to sampling delays which manifest as gaps in the timeline. Note: because this is a sampling profiler, be cautious when examining running time that is equal to the sampling interval. For very time-sensitive profiling, you may want to consider a non-sampling profiler. Y (Stack) axis: The Y axis is the stack
depth, not the CPU activity. The change in stack height is useful to find patterns like long blocking calls (long flatlines) or very tall spiky blocks (recursive calls and JS). With more experience you can read profiles faster by recognizing patterns. Also note that you can click on timeline elements (the selected element gets darker when selected) and the tree view (see below) reflects the selected el...
TraceMalloc
leak tests use: python leaktest.py -- --trace-malloc malloc.log --shutdown-leaks=sdleak.log # Note 2: It appears that the shutdown log is not recorded if --trace-malloc is given the - argument. build/dist/Minefield.App/Contents/MacOS/firefox --trace-malloc /dev/null --shutdown-leaks=sdleak.log # Convert raw log to text representation of call trees perl source/tools/trace-malloc/diffbloatdump.pl --
depth=15 --use-address /dev/null sdleak.log > sdleak.tree.raw # Frobulate trees to remove extraneous junk perl source/tools/rb/fix-macosx-stack.pl sdleak.tree.raw > sdleak.tree You can also use the leakstats program to analyze a log for shutdown leaks. It will produce a report like the following. Leaks: 382739 bytes, 3465 allocations Maximum Heap Size: 7751799 bytes 62095212 bytes were allocated in 391...
about:memory
rvice +--585 (100.0%) -- referent +--493 (84.27%) -- strong +---92 (15.73%) -- weak +--92 (15.73%) -- alive +---0 (00.00%) -- dead Leaf nodes represent actual measurements; the value of each internal node is the sum of all its children. The use of trees allows measurements to be broken down into further categories, sub-categories, sub-sub-categories, etc., to arbitrary
depth, as needed. All the measurements within a single tree are non-overlapping. Tree paths can be written using '/' as a separator. For example, preference/referent/weak/dead represents the path to the final leaf node in the example tree above. Sub-trees can be collapsed or expanded by clicking on them. If you find any particular tree overwhelming, it can be helpful to collapse all the sub-trees imm...
NSS CERTVerify Log
ntry; log->tail is the last entry. Each entry is a CERTVerifyLogNode. Defined in certt.h: /* * This structure is used to keep a log of errors when verifying * a cert chain. This allows multiple errors to be reported all at * once. */ struct CERTVerifyLogNodeStr { CERTCertificate *cert; /* what cert had the error */ long error; /* what error was it? */ unsigned int
depth; /* how far up the chain are we */ void *arg; /* error specific argument */ struct CERTVerifyLogNodeStr *next; /* next in the list */ struct CERTVerifyLogNodeStr *prev; /* next in the list */ }; The list is a doubly linked NULL terminated list sorted from low to high based on
depth into the cert chain. When you are through, you will need to walk the list and free a...
Python binding for NSS
nss.Certificate.get_cert_chain nss.Certificate.check_ocsp_status nss.PK11Slot.list_certs nss.CertVerifyLogNode.format_lines nss.CertVerifyLog.format_lines nss.CRLDistributionPts.format_lines The following class properties were added: nss.CertVerifyLogNode.certificate nss.CertVerifyLogNode.error nss.CertVerifyLogNode.
depth nss.CertVerifyLog.count The following module functions were added: nss.x509_cert_type nss.key_usage_flags nss.list_certs nss.find_certs_from_email_addr nss.find_certs_from_nickname nss.nss_get_version nss.nss_version_check nss.set_shutdown_callback nss.get_use_pkix_for_validation nss.set_use_pkix...
Getting SpiderMonkey source code
tire Mozilla repository, including the full change history and a lot of Gecko and Firefox source code that isn't part of SpiderMonkey. It also changes to the SpiderMonkey directory (js/src). git clone https://github.com/mozilla/gecko-dev.git cd gecko-dev/js/src If you want a faster (about 5 times as of January 2015) download, try doing a shallow clone (no version control history). git clone --
depth 1 https://github.com/mozilla/gecko-dev.git If you have any problems check the https://wiki.mozilla.org/Github page. Getting older SpiderMonkey sources from CVS Note: You will need to explicitly fetch the JavaScript shell sources even if you currently build another Mozilla project, as there are files specific to the shell that are not normally found in a Mozilla source tree. Just like when yo...
Bytecodes
lue is called a "slot", so the categories are: Argument slots: holds the actual arguments passed to the current frame. Local slots: holds the local variables used by the current code. Expression slots: holds the temporary space that you need to calculate expressions on a stack. For example, in (a + b) + c you would push a, then push b, then add, then push c, then add, which requires a maximum
depth of two expression slots. There are also some slots reserved for dedicated functionality, holding values like this and the callee / return value. There is always a "Top of Stack" (TOS) that corresponds to the latest value pushed onto the expression stack. All bytecodes implicitly operate in terms of this location. Bytecode Listing All opcodes are annotated with a [-popcount, +pushcount] to repres...
JIT Optimization Outcomes
ICGetElemStub_ReadUnboxed ICGetElemStub_Dense ICGetElemStub_DenseHole ICGetElemStub_TypedArray ICGetElemStub_ArgsElement ICGetElemStub_ArgsElementStrict ICSetElemStub_Dense ICSetElemStub_TypedArray ICNameStub_ReadSlot ICNameStub_CallGetter Call Inlining Outcomes Optimization outcomes of attempts to inline function calls. CantInlineGeneric CantInlineClassConstructor CantInlineExceeded
Depth CantInlineExceededTotalBytecodeLength CantInlineBigCaller CantInlineBigCallee CantInlineBigCalleeInlinedBytecodeLength CantInlineNotHot CantInlineNotInDispatch CantInlineNativeBadType CantInlineNoTarget Unable to inline function call. The callee (target) function, f in f(x), is not known at JIT time. CantInlineNotInterpreted Unable to inline function call. The callee function is not an...
JS_NewContext
ption JS_NewContext creates a new JSContext in the runtime rt. On success, it returns a pointer to the new context. Otherwise it returns NULL. For more details about contexts, see JSContext. For sample code that creates and initializes a JSContext, see JSAPI User Guide. The stackchunksize parameter does not control the JavaScript stack size. (The JSAPI does not provide a way to adjust the stack
depth limit.) Passing a large number for stackchunksize is a mistake. In a DEBUG build, large chunk sizes can degrade performance dramatically. The usual value of 8192 is recommended. The application must call JS_DestroyContext when it is done using the context. Before a JSRuntime may be destroyed, all the JSContexts associated with it must be destroyed. The new JSContext initially has no global obje...
A Web PKI x509 certificate primer
fines what other names (such as DNS names) are valid for this certificate. This allows for a certificate to be used for more than one FQDN, for example you can have a certificate that is valid for both a.example.com and b.example.com Basic constraints This allows certificates to be asserted as issuing certificates (it is mandatory for CA certificates). It can also be used to express the maximum
depth of the trust path from the CA. Key usage This extension is used to constrain the purpose for the key in the certificate. More than one key usage can be asserted. Examples of key usages are: digitalSignature, keyEncipherment, dataEncipherment, keyCertSign, and cRLSign. For CA certificates the keyCertSign bit must be set. Extended key usages This is another bitfield to constrain the usages of t...
Animated PNG graphics
east one 'fdAT' chunk is required for each frame. The compressed datastream is then the concatenation of the contents of the data fields of all the 'fdAT' chunks within a frame. When decompressed, the datastream is the complete pixel data of a PNG image, including the filter byte at the beginning of each scanline, similar to the uncompressed data of all the 'IDAT' chunks. It utilizes the same bit
depth, color type, compression method, filter method, interlace method, and palette (if any) as the default image. Byte offset Field name Field type Description 0 sequence_number unsigned int Sequence number of the animation chunk, starting from 0. 4 frame_data X bytes Frame data for this frame. Each frame inherits every property specified b...
XPCShell Reference
ipt.js in the current directory. print(obj1, obj2, ...) print() is useful to print something to the screen. It dumps whatever is passed to the screen, putting spaces between arguments and appending a newline at the end. An example print(1, 2, 3) Will print 1 2 3<newline>. dump(object) dump() is almost like print. It only handles one parameter and it doesn't append a newline. dumpXPC(
depth) This function dumps the XPConnect object. See the documentation on debugDump() for the nsIXPConnect interface for more information. version(newVersion) version() returns the JavaScript engine version number. If you pass a number to it, it will set the version number (and return the old version number). See the above documentation on the -v command-line argument for more information. qu...
Debugger.Frame - Firefox Developer Tools
ptimizing, baseline JIT. "ion": a frame running in the optimizing JIT. "wasm": a frame running in WebAssembly baseline JIT. this The value of this for this frame (a debuggee value). For a wasmcall frame, this property throws a TypeError. older The next-older visible frame, in which control will resume when this frame completes. If there is no older frame, this is null.
depth The
depth of this frame, counting from oldest to youngest; the oldest frame has a
depth of zero. live True if the frame this Debugger.Frame instance refers to is still on the stack; false if it has completed execution or been popped in some other way. script The script being executed in this frame (a Debugger.Script instance), or null on frames that do not represent calls to debuggee code. O...
Index - Firefox Developer Tools
te various connection speeds so you can see how your app will behave under different connection types. 54 Page Inspector CSS, DOM, HTML, Stylesheets, Web Development, Web Development:Tools, l10n:priority Use the Page Inspector to examine and modify the HTML and CSS of a page. 55 How to Links for various HOW TO's can be found here. These links describe in
depth the HOW TO techniques. 56 CSS Flexbox Inspector: Examine Flexbox layouts Guide, Inspector, Tools, flexbox The Flexbox Inspector allows you to examine CSS Flexbox Layouts using the Firefox DevTools, which is useful for discovering flex containers on a page, examining and modifying them, debugging layout issues, and more. 57 CSS Grid Inspector: Examine grid layouts ...
How to - Firefox Developer Tools
Links for various HOW TO's can be found here. These links describe in
depth the HOW TO techniques. CSS Flexbox Inspector: Examine Flexbox layoutsCSS Grid Inspector: Examine grid layoutsEdit CSS filtersEdit Shape Paths in CSSEdit fontsExamine Event ListenersExamine and edit CSSExamine and edit HTMLExamine and edit the box modelInspect and select colorsOpen the InspectorReposition elements in the pageSelect an elementSelect and highlight elementsUse the Inspector APIUse the Inspector from the Web ConsoleView background imagesVisualize transformsWork with animations ...
AbstractRange - Web APIs
t"> <h2>Aside</h2> <p>An interesting aside to share with you...</p> </aside> </section> </article> <pre id="log"></pre> </div> After loading the HTML and constructing the DOM representation of the document, the resulting DOM tree looks like this: In this diagram, the nodes representing HTML elements are shown in green. Eah row beneath them shows the next layer of
depth into the DOM tree. Blue nodes are text nodes, containing the text that gets shown onscreen. Each element's contents are linked below it in the tree, potentially spawning a series of branches below as elements include other elements and text nodes. If you want to create a range that incorporates the contents of the <p> element whose contents are "A <em>very</em> interesting thing happened on the ...
BaseAudioContext.createBuffer() - Web APIs
method decodeAudioData() does the same thing -- takes compressed audio, say, an MP3 file, and directly gives you back an AudioBuffer that you can then set to play via in an AudioBufferSourceNode. For simple uses like playing an MP3, decodeAudioData() is what you should be using. Syntax var buffer = baseAudioContext.createBuffer(numOfchannels, length, sampleRate); Parameters Note: For an in-
depth explanation of how audio buffers work, and what these parameters mean, read Audio buffers: frames, samples and channels from our Basic concepts guide. numOfChannels An integer representing the number of channels this buffer should have. The default value is 1, and all user agents must support at least 32 channels. length An integer representing the size of the buffer in sample-frames (wher...
DOMPoint.z - Web APIs
Unless transforms have changed the orientation, a z of 0 is the plane of the screen, with positive values extending outward toward the user from the screen, and negative values receding into the distance behind the screen. Syntax var zPos = DOMPoint.z; Value A double-precision floating-point value indicating the z coordinate's value for the point. This value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be NaN or +-Infinity). Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'z' in that specification. ...
DOMPointInit - Web APIs
umber providing the point's y-coordinate. This is the vertical coordinate, and barring any transforms applied to the coordinate system, positive values are downward and negative values upward toward the top of the screen. The default is 0. DOMPointInit.z An unrestricted floating-point value which gives the point's z-coordinate, which is (assuming no transformations that alter the situation) the
depth coordinate; positive values are closer to the user and negative values retreat back into the screen. The default value is 0. DOMPointInit.w The point's w perspective value, given as an unrestricted floating-point number. The default is 1. Example This example creates a new DOMPoint representing the top-left corner of the current window, with a z component added to move the point closer to th...
DOMPointReadOnly() - Web APIs
or 3D space, optionally with perspective, whose values cannot be altered by script code. Syntax point = new DOMPointReadOnly(x, y, z, w); Parameters x Optional The value of the horizontal coordinate, x, as a floating point number. The default value is 0. y Optional The value of the vertical coordinate, y, as a floating point number. The default value is 0. z Optional The value of the
depth coordinate, z, as a floating point number. The default value is 0. w Optional The value of the perspective, w, as a floating point number. The default is 1. Note: Each of these values is what's called an unrestricted number. In addition to any finite floating-point value, you may use special values such as +-Infinity and NaN. Return value A new DOMPointReadOnly object representing the spe...
DOMPointReadOnly.z - Web APIs
If your script needs to be able to change the value of this property, you should instead use the DOMPoint object. In general, positive values of z mean toward the user (out from the screen), and negative values of z mean away from the user (into the screen), assuming no transforms have resulted in a reversal. Syntax const zPos = someDOMPointReadOnly.z; Value A double-precision floating-point value indicating the z coordinate's value for the point. This value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be NaN or +-Infinity). ...
DOMPointReadOnly - Web APIs
ointReadOnly() Creates a new DOMPointReadOnly object given the values of its coordinates and perspective. To create a point using aDOMPointInit object, you can instead use DOMPointReadOnly.fromPoint(). Properties DOMPointReadOnly.x Read only The point's horizontal coordinate, x. DOMPointReadOnly.y Read only The point's vertical coordinate, y. DOMPointReadOnly.z Read only The point's
depth coordinate, z. DOMPointReadOnly.w Read only The point's perspective value, w. Static methods DOMPointReadOnly.fromPoint() A static method that creates a new DOMPointReadOnly object given the coordinates provided in the specified DOMPointInit object. Methods matrixTransform() Applies a matrix transform specified as a DOMMatrixInit object to the DOMPointReadOnly object. toJSON() Re...
DocumentFragment.querySelector() - Web APIs
If the selector matches an ID and this ID is erroneously used several times in the document, it returns the first matching element. If the selectors specified in parameter are invalid a DOMException with a SYNTAX_ERR value is raised. Syntax element = documentfragment.querySelector(selectors); Parameters selectors Is a DOMString containing one or more CSS selectors separated by commas. ...
DocumentFragment.querySelectorAll() - Web APIs
If the selectors specified in parameter are invalid a DOMException with a SYNTAX_ERR value is raised. Note: The definition of this API was moved to the ParentNode interface. Syntax elementList = documentfragment.querySelectorAll(selectors); Parameters selectors Is a DOMString containing one or more CSS selectors separated by commas. ...
FileSystemEntrySync - Web APIs
le over an existing file replaces that existing file. Moving a directory over an existing empty directory replaces that directory. [todo: What if the directory is not empty? ] [todo: Verify ] This is the same method for renaming files. You can keep it in the same location and then define the newName parameter. You cannot do the following: Move a directory inside itself or to any child at any
depth Move an entry into its parent if a name different from its current one isn't provided Move a file to a path occupied by a directory or move a directory to a path occupied by a file Move any element to a path occupied by a directory that is not empty. FileSystemEntrySync moveTo ( in DirectoryEntrySync parent, optional DOMString newName ) raises (FileException); Parameters parent The di...
HTMLFormElement.elements - Web APIs
operty. Syntax nodeList = HTMLFormElement.elements Value An HTMLFormControlsCollection containing all non-image controls in the form. This is a live collection; if form controls are added to or removed from the form, this collection will update to reflect the change. The form controls in the returned collection are in the same order in which they appear in the form by following a preorder,
depth-first traversal of the tree. This is called tree order. The elements included by HTMLFormElement.elements and HTMLFormElement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> No other elements are included in the list returned by elements, which makes it an...
HTMLImageElement.lowSrc - Web APIs
e A DOMString specifying the URL of a version of the image specified by src which has been modified in some fashion so that it loads significantly more quickly than the primary image. There are a number of ways to achieve this; primary among them: Higher compression levels (for example, a primary image saved as a JPEG using 85% quality might have a lowSrc version saved at 15%. Reduced color
depth; a primary image in 32-bit color might have an alternate image in 8-bit color. Important: The lowSrc property is obsolete and should not be used. Instead, you should use an image format which loads progressively (such as progressive JPEG). Or simply make sure your images are all well-optimized and balanced for appearance versus size. Usage notes lowSrc is a strange case. It was never techni...
HTMLMediaElement.autoplay - Web APIs
ch automatically play audio (or videos with an audio track) can be an unpleasant experience for users, so it should be avoided when possible. If you must offer autoplay functionality, you should make it opt-in (requiring a user to specifically enable it). However, autoplay can be useful when creating media elements whose source will be set at a later time, under user control. For a much more in-
depth look at autoplay, autoplay blocking, and how to respond whena autoplay is blocked by the user's browser, see our article Autoplay guide for media and Web Audio APIs. Syntax HTMLMediaElement.autoplay = true | false; var autoplay = HTMLMediaElement.autoplay; Value A Boolean whose value is true if the media element will begin playback as soon as enough content has loaded to allow it to do so wi...
HTMLMediaElement.play() - Web APIs
automatically, but should instead update their UI based on whether the returned promise is resolved or rejected. See the example below for more information. Note: The play() method may cause the user to be asked to grant permission to play the media, resulting in a possible delay before the returned promise is resolved. Be sure your code doesn't expect an immediate response. For even more in-
depth information about autoplay and autoplay blocking, see our article Autoplay guide for media and Web Audio APIs. Example This example demonstrates how to confirm that playback has begun and how to gracefully handle blocked automatic playback: let videoElem = document.getElementById("video"); let playButton = document.getElementById("playbutton"); playButton.addEventListener("click", handlePlayB...
Using microtasks in JavaScript with queueMicrotask() - Web APIs
polyfills, the queueMicrotask() method is exposed on the Window and Worker interfaces through the WindowOrWorkerGlobalScope mixin. Tasks vs microtasks To properly discuss microtasks, it's first useful to know what a JavaScript task is and how microtasks differ from tasks. This is a quick, simplified explanation, but if you would like more details, you can read the information in the article In
depth: Microtasks and the JavaScript runtime environment. Tasks A task is any JavaScript code which is scheduled to be run by the standard mechanisms such as initially starting to run a program, an event callback being run, or an interval or timeout being fired. These all get scheduled on the task queue. Tasks get added to the task queue when: A new JavaScript program or subprogram is executed (s...
IntersectionObserver.IntersectionObserver() - Web APIs
ult is "0px 0px 0px 0px". threshold Either a single number or an array of numbers between 0.0 and 1.0, specifying a ratio of intersection area to total bounding box area for the observed target. A value of 0.0 means that even a single visible pixel counts as the target being visible. 1.0 means that the entire target element is visible. See Thresholds in Intersection Observer API for a more in-
depth description of how thresholds are used. The default is a threshold of 0.0. Return value A new IntersectionObserver which can be used to watch for the visibility of a target element within the specified root crossing through any of the specified visibility thresholds. Call its observe() method to begin watching for the visibility changes on a given target. Exceptions SyntaxError The sp...
IntersectionObserver.rootMargin - Web APIs
tersection test is performed. This lets you, for example, adjust the bounds outward so that the target element is considered 100% visible even if a certain number of pixels worth of width or height is clipped away, or treat the target as partially hidden if an edge is too close to the edge of the root's bounding box. See The root element and root margin in Intersection Observer API for a more in-
depth look at the root margin and how it works with the root's bounding box. Syntax var marginString = IntersectionObserver.rootMargin; Value A string, formatted similarly to the CSS margin property's value, which contains offsets for one or more sides of the root's bounding box. These offsets are added to the corresponding values in the root's bounding box before the intersection between the resu...
PannerNode.orientationZ - Web APIs
The complete vector is defined by the position of the audio source, given as (positionX, positionY, positionZ), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationX, orientationY, orientationZ). Depending on the directionality of the sound (as specified using the attributes coneInnerAngle, coneOuterAngle, and codeOuterGain), the orientation of the sound may alter the perceived volume of the sound as it's being played. ...
PannerNode.positionZ - Web APIs
The complete vector is defined by the position of the audio source, given as (positionX, positionY, positionZ), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationX, orientationY, orientationZ). ...
PannerNode.rolloffFactor - Web APIs
w the volume of the test tone decreases with increasing distance from the listener: const context = new AudioContext(); // all our test tones will last this many seconds const NOTE_LENGTH = 4; // this is how far we'll move the sound const Z_DISTANCE = 20; // this function creates a graph for the test tone with a given rolloffFactor // and schedules it to move away from the listener along the Z (
depth-wise) axis // at the given start time, resulting in a decrease in volume (decay) const scheduleTestTone = (rolloffFactor, startTime) => { const osc = new OscillatorNode(context); const panner = new PannerNode(context); panner.rolloffFactor = rolloffFactor; // set the initial Z position, then schedule the ramp panner.positionZ.setValueAtTime(0, startTime); panner.positionZ.linearRamp...
PaymentRequest.shippingAddress - Web APIs
n that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. No compatibility data found. Please contribute data for "api.PaymentRequest.shippingAddress" (
depth: 1) to the MDN compatibility data repository. ...
RTCPeerConnection.setRemoteDescription() - Web APIs
rently open, so negotiation cannot take place. InvalidSessionDescriptionError The RTCSessionDescription specified by the sessionDescription parameter is invalid. Example Here we see a function which handles an offer received from the remote peer. This code is derived from the example and tutorial in the article Signaling and video calling; take a look at that for more details and a more in-
depth explanation of what's going on. function handleOffer(msg) { createMyPeerConnection(); myPeerConnection.setRemoteDescription(msg.description).then(function () { return navigator.mediaDevices.getUserMedia(mediaConstraints); }) .then(function(stream) { document.getElementById("local_video").srcObject = stream; return myPeerConnection.addStream(stream); }) .then(function() {...
WebGL2RenderingContext.beginQuery() - Web APIs
method of the WebGL 2 API starts an asynchronous query. The target parameter indicates which kind of query to begin. Syntax void gl.beginQuery(target, query); Parameters target A GLenum specifying the target of the query. Possible values: gl.ANY_SAMPLES_PASSED: Specifies an occlusion query: these queries detect whether an object is visible (whether the scoped drawing commands pass the
depth test and if so, how many samples pass). gl.ANY_SAMPLES_PASSED_CONSERVATIVE: Same as above above, but less accurate and faster version. gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: Number of primitives that are written to transform feedback buffers. query A WebGLQuery object for which to start the querying. Return value None. Examples var query = gl.createQuery(); gl.beginQuery(gl.ANY_...
WebGL2RenderingContext.blitFramebuffer() - Web APIs
dstX0, dstY0, dstX1, dstY1, mask, filter); Parameters srcX0, srcY0, srcX1, srcY1 A GLint specifying the bounds of the source rectangle. dstX0, dstY0, dstX1, dstY1 A GLint specifying the bounds of the destination rectangle. mask A GLbitfield specifying a bitwise OR mask indicating which buffers are to be copied. Possible values: gl.COLOR_BUFFER_BIT gl.
DEPTH_BUFFER_BIT gl.STENCIL_BUFFER_BIT filter A GLenum specifying the interpolation to be applied if the image is stretched. Possible values: gl.NEAREST gl.LINEAR Return value None. Examples gl.blitFramebuffer(0, 0, canvas.width, canvas.height, 0, 0, canvas.width, canvas.height, gl.COLOR_BUFFER_BIT, gl.NEAREST); Specifications Spe...
WebGL2RenderingContext.endQuery() - Web APIs
The WebGL2RenderingContext.endQuery() method of the WebGL 2 API marks the end of a given query target. Syntax void gl.endQuery(target); Parameters target A GLenum specifying the target of the query. Possible values: gl.ANY_SAMPLES_PASSED: Specifies an occlusion query: these queries detect whether an object is visible (whether the scoped drawing commands pass the
depth test and if so, how many samples pass). gl.ANY_SAMPLES_PASSED_CONSERVATIVE: Same as above above, but less accurate and faster version. gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: Number of primitives that are written to transform feedback buffers. Return value None. Examples var query = gl.createQuery(); gl.beginQuery(gl.ANY_SAMPLES_PASSED, query); // ... gl.endQuery(gl.ANY_SAMPLES_PASSED); Sp...
WebGL2RenderingContext.getInternalformatParameter() - Web APIs
ernal formats. Syntax any gl.getInternalformatParameter(target, internalformat, pname); Parameters target A Glenum specifying the target renderbuffer object. Possible values: gl.RENDERBUFFER: Buffer data storage for single images in a renderable internal format. internalformat A GLenum specifying the internal format about which to retrieve information (must be a color-renderable,
depth-renderable or stencil-renderable format). pname A GLenum specifying the type of information to query. Possible values: gl.SAMPLES: Returns a Int32Array containing sample counts supported for internalformat in descending order. Return value Depends on the requested information (as specified with pname). It is an Int32Array if pname is gl.SAMPLES. Examples var samples = gl.getInterna...
WebGL2RenderingContext.getQuery() - Web APIs
ingContext.getQuery() method of the WebGL 2 API returns the currently active WebGLQuery for the target, or null. Syntax WebGLQuery gl.getQuery(target, pname); Parameters target A GLenum specifying the target of the query. Possible values: gl.ANY_SAMPLES_PASSED: Specifies an occlusion query: these queries detect whether an object is visible (whether the scoped drawing commands pass the
depth test and if so, how many samples pass). gl.ANY_SAMPLES_PASSED_CONSERVATIVE: Same as above above, but less accurate and faster version. gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: Number of primitives that are written to transform feedback buffers. pname A GLenum specifying the query object target. Must be gl.CURRENT_QUERY. Return value A WebGLQuery object. Examples var currentQuery =...
WebGL2RenderingContext.renderbufferStorageMultisample() - Web APIs
fying the internal format of the renderbuffer. Possible values: gl.R8 gl.R8UI gl.R8I gl.R16UI gl.R16I gl.R32UI gl.R32I gl.RG8 gl.RG8UI gl.RG8I gl.RG16UI gl.RG16I gl.RG32UI gl.RG32I gl.RGB8 gl.RGBA8 gl.SRGB8_ALPHA8 gl.RGBA4 gl.RGB565 gl.RGB5_A1 gl.RGB10_A2 gl.RGBA8UI gl.RGBA8I gl.RGB10_A2UI gl.RGBA16UI gl.RGBA16I gl.RGBA32I gl.RGBA32UI gl.
DEPTH_COMPONENT16 gl.
DEPTH_COMPONENT24 gl.
DEPTH_COMPONENT32F gl.
DEPTH_STENCIL gl.
DEPTH24_STENCIL8 gl.
DEPTH32F_STENCIL8 gl.STENCIL_INDEX8 width A GLsizei specifying the width of the renderbuffer in pixels. height A GLsizei specifying the height of the renderbuffer in pixels. Return value None. Examples gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RBGA4, 256, 256); ...
WebGLRenderingContext.bindFramebuffer() - Web APIs
The WebGLRenderingContext.bindFramebuffer() method of the WebGL API binds a given WebGLFramebuffer to a target. Syntax void gl.bindFramebuffer(target, framebuffer); Parameters target A GLenum specifying the binding point (target). Possible values: gl.FRAMEBUFFER: Collection buffer data storage of color, alpha,
depth and stencil buffers used to render an image. When using a WebGL 2 context, the following values are available additionally: gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. framebuffer A WebGLFramebuffer object to bind. Return value None. Exceptions A gl.INVALID_ENUM error is thrown if target is n...
WebGLRenderingContext.disable() - Web APIs
void gl.disable(cap); Parameters cap A GLenum specifying which WebGL capability to disable. Possible values: Constant Description gl.BLEND Deactivates blending of the computed fragment color values. See WebGLRenderingContext.blendFunc(). gl.CULL_FACE Deactivates culling of polygons. See WebGLRenderingContext.cullFace(). gl.
DEPTH_TEST Deactivates
depth comparisons and updates to the
depth buffer. See WebGLRenderingContext.
depthFunc(). gl.DITHER Deactivates dithering of color components before they get written to the color buffer. gl.POLYGON_OFFSET_FILL Deactivates adding an offset to
depth values of polygon's fragments. See WebGLRenderingContext.polygonOffset(). gl.SAMPLE_AL...
WebGLRenderingContext.enable() - Web APIs
ntax void gl.enable(cap); Parameters cap A GLenum specifying which WebGL capability to enable. Possible values: Constant Description gl.BLEND Activates blending of the computed fragment color values. See WebGLRenderingContext.blendFunc(). gl.CULL_FACE Activates culling of polygons. See WebGLRenderingContext.cullFace(). gl.
DEPTH_TEST Activates
depth comparisons and updates to the
depth buffer. See WebGLRenderingContext.
depthFunc(). gl.DITHER Activates dithering of color components before they get written to the color buffer. gl.POLYGON_OFFSET_FILL Activates adding an offset to
depth values of polygon's fragments. See WebGLRenderingContext.polygonOffset(). gl.SAMPLE_ALPHA_TO...
WebGLRenderingContext.isEnabled() - Web APIs
disabled. Syntax GLboolean gl.isEnabled(cap); Parameters cap A GLenum specifying which WebGL capability to test. Possible values: Constant Description gl.BLEND Blending of the computed fragment color values. See WebGLRenderingContext.blendFunc(). gl.CULL_FACE Culling of polygons. See WebGLRenderingContext.cullFace(). gl.
DEPTH_TEST
Depth comparisons and updates to the
depth buffer. See WebGLRenderingContext.
depthFunc(). gl.DITHER Dithering of color components before they get written to the color buffer. gl.POLYGON_OFFSET_FILL Adding an offset to
depth values of polygon's fragments. See WebGLRenderingContext.polygonOffset(). gl.SAMPLE_ALPHA_TO_COVERAGE Computation of a...
Basic scissoring - Web APIs
ference between pixels and fragments. A pixel is a picture element (in practice, a point) on the screen, or a single element of the drawing buffer, that area in memory that holds your pixel data (such as RGBA color components). A fragment refers to the pixel while it is being handled by the WebGL pipeline. The reason for this distinction is that fragment color (and other fragment values, such as
depth) may be manipulated and changed several times during graphics operations before finally being written to the screen. We have already seen how fragment color changes during graphics operations, by applying color masking. In other cases, the fragments may be discarded altogether (so the pixel value is not updated), or it may interact with the already existing pixel value (such as when doing color b...
Adding 2D content to a WebGL context - Web APIs
ished, the locations are looked up, and the square plane's vertex positions put in a buffer, we can actually render the scene. Since we're not animating anything in this example, our drawScene() function is very simple. It uses a few utility routines we'll cover shortly. function drawScene(gl, programInfo, buffers) { gl.clearColor(0.0, 0.0, 0.0, 1.0); // Clear to black, fully opaque gl.clear
Depth(1.0); // Clear everything gl.enable(gl.
DEPTH_TEST); // Enable
depth testing gl.
depthFunc(gl.LEQUAL); // Near things obscure far things // Clear the canvas before we start drawing on it. gl.clear(gl.COLOR_BUFFER_BIT | gl.
DEPTH_BUFFER_BIT); // Create a perspective matrix, a special matrix that is // used to simulate the distortion of perspective i...
Lighting in WebGL - Web APIs
matrix and vertex math. You'll need to include it if you create your own project based on this code. Our sample loads a copy from a CDN in our HTML's <head>. Simulating lighting and shading in 3D Although going into detail about the theory behind simulated lighting in 3D graphics is far beyond the scope of this article, it's helpful to know a bit about how it works. Instead of discussing it in
depth here, take a look at the article on Phong shading at Wikipedia, which provides a good overview of the most commonly used lighting model or if you'd like to see a WebGL based explanation see this artcle. There are three basic types of lighting: Ambient light is the light that permeates the scene; it's non-directional and affects every face in the scene equally, regardless of which direction it's...
WebRTC coding guide - Web APIs
Once you have an overall understanding of what WebRTC does and how it works, your mind likely turns to implementation. How do you create a Web application that uses two-way video or data streams without having to do all the hard work of compressing frames, building streams, and so forth by yourself? This coding guide will explain in
depth how WebRTC works, and will dive into actual code that uses WebRTC to do useful things. There are no subpages at this time. If you need to learn more about the fundamentals of how WebRTC and its protocols work, check out our High-level guides for WebRTC. ...
High-level guides - Web APIs
t run into as you explore and build Web content or apps using the WebRTC API. In addition, you'll find suggestions as to tools, libraries, and frameworks that might be helpful and compatibility information so you know which parts of the overall suite of WebRTC features can be safely used given your target audience. There are no subpages at this time. When you're ready to explore WebRTC in more
depth, be sure to take a look at our Low-level guide to WebRTC. ...
Lighting a WebXR setting - Web APIs
face, but the angle is always the same. Components of a light source A light source has three major components; each component is in essence a type of light There are three kinds of light that can affect the color and brightness of objects and their pixels as displayed on the viewer's screen or headset. A sphere with only ambient lighting. Note the total lack of any shading to indicate the
depth of the sphere. Ambient light Ambient light is light that doesn't come from a defined source, but is just present throughout the scene. This light reaches every surface in the scene at the same intensity from every direction, and is then reflected equally in every direction. As a result, the effect applied by ambient light is universally equal all through the scene. The effect of ambient l...
Window.devicePixelRatio - Web APIs
recision floating-point value indicating the ratio of the display's resolution in physical pixels to the resolution in CSS pixels. A value of 1 indicates a classic 96 DPI (76 DPI on some platforms) display, while a value of 2 is expected for HiDPI/Retina displays. Other values may be returned as well in the case of unusually low resolution displays or, more often, when a screen has a higher pixel
depth than simply double the standard resolution of 96 or 76 DPI. Examples Correcting resolution in a <canvas> A <canvas> can appear too blurry on retina screens. Use window.devicePixelRatio to determine how much extra pixel density should be added to allow for a sharper image. HTML <canvas id="canvas"></canvas> JavaScript var canvas = document.getElementById('canvas'); var ctx = canvas.getCon...
Window.screen - Web APIs
The Window property screen returns a reference to the screen object associated with the window. The screen object, implementing the Screen interface, is a special object for inspecting properties of the screen on which the current window is being rendered. Syntax let screenObj = window.screen; Example if (screen.pixel
Depth < 8) { // use low-color version of page } else { // use regular, colorful page } Specifications Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'window.screen' in that specification. Working Draft Initial definition. ...
XRRenderState - Web APIs
plays. When you apply changes using the XRSession method updateRenderState(), the specified changes take effect after the current animation frame has completed, but before the next one begins. Properties The followiing properties are available on XRRenderState objects. baseLayer Read only The XRWebGLLayer from which the browser's compositing system obtains the image for the XR session.
depthFar Read only The distance, in meters, of the far clip plane from the viewer. The far clip plane is the plane which is parallel to the display beyond which rendering of the scene no longer takes place. This, essentially, specifies the maximum distance the user can see.
depthNear Read only The distance, in meters, of the near clip plane from the viewer. The near clip plane is the plane, pa...
XRWebGLLayer.framebufferHeight - Web APIs
The read-only XRWebGLLayer property framebufferHeight indicates the height of the framebuffer, in pixels. You can get the width of the framebuffer using the framebufferWidth property. Syntax let bufferHeight = xrWebGLLayer.framebufferHeight; Value The height in pixels of the XR device's framebuffer. Each of the framebuffer's attachments (pixel,
depth, color, and/or stencil buffers, for example) are all this many pixels tall. Examples This snippet simply fetches the framebuffer's width and height for later use. let glLayer = xrSession.renderState.baseLayer; gl.bindFramebuffer(gl.FRAMEBUFFER, glLayer.framebuffer); frameWidth = glLayer.framebufferHeight; frameHeight = glLayer.framebufferHeight; Specifications Specification Status Comment WebXR Device APIThe d...
XRWebGLLayer.framebufferWidth - Web APIs
The read-only XRWebGLLayer property framebufferWidth specifies the width of the framebuffer, in pixels. You can get the height of the framebuffer using the framebufferHeight property. Syntax let bufferWidth = xrWebGLLayer.framebufferWidth; Value The width in pixels of the XR device's framebuffer. Each of the framebuffer's attachments (pixel,
depth, color, and/or stencil buffers, for example) are all this many pixels wide. Examples This snippet simply fetches the framebuffer's width and height for later use. let glLayer = xrSession.renderState.baseLayer; gl.bindFramebuffer(gl.FRAMEBUFFER, glLayer.framebuffer); frameWidth = glLayer.framebufferWidth; frameHeight = glLayer.framebufferHeight; Specifications Specification Status Comment WebXR Device APIThe defin...
XRWebGLLayer - Web APIs
the WebGL context's framebuffer supports anti-aliasing. The specific type of anti-aliasing is determined by the user agent. framebuffer Read only Returns a WebGLFramebuffer suitable for passing into the bindFrameBuffer() method. framebufferWidth Read only Returns the width of the XRWebGLLayer's framebuffer. framebufferHeight Read only Returns the height of the layer's framebuffer. ignore
DepthValues Read only A Boolean which Indicates whether or not the WebXR compositor should make use of the contents of the layer's
depth buffer while compositing the scene. Methods getViewport() Returns a new XRViewport instance representing the position, width, and height to which the WebGL context's viewport must be set to contain drawing to the area of the framebuffer designated for the spec...
XRWebGLLayerInit.stencil - Web APIs
When using the XRWebGLLayer() constructor to create a new WebGL rendering layer for WebXR, providing as the layerInit parameter an object whose stencil property is false requests that the new layer be created without a stencil buffer. The stencil buffer is an optional buffer which, just like the
depth buffer, contains one entry for every pixel in the frame buffer. Also just like the
depth buffer, the value of an enter in the stencil buffer directly affects how (or if) the corresponding pixel is drawn during rendering. You can store values into each entry in the stencil bufer, then specify an operation that determines which stencil buffer values correspond to pixels which should be drawn to the screen during each frame. Syntax let layerInit = { stencil: false }; let glLayer = new XRWebGL...
An overview of accessible web applications and widgets - Accessibility
ab and Shift-Tab keys. Once keyboard focus is inside the container, the arrow keys should allow the user to navigate between each tab (the <li> elements). From here, conventions vary from platform to platform. On Windows, the next tab should automatically be activated when the user presses the arrow keys. On Mac OS X, the user can press either Enter or the Spacebar to activate the next tab. An in-
depth tutorial for creating Keyboard-navigable JavaScript widgets describes how to implement this behavior with JavaScript. ...
Accessibility Information for Web Authors - Accessibility
d accessible. Accessible Web Page Authoring IBM has put together a simple, practical resource for web authors to learn accessibility the fast and painless way. Highly recommended, an excellent resource. Dive Into Accessibility by Mark Pilgrim An excellent, easy-to-understand resource (available in English and in 9 other languages) on accessible website authoring, which goes into greater
depth. In 30 days, you will know why your website should be accessible and how to make it more accessible. Automated Checking & Repair Cynthia says(TM) from HiSoftware(R) Company "Cynthia says(TM)" is a free online webpage accessibility validation service that is designed to identify errors in webpage related to Section 508 standards and/or the WCAG guidelines. It can perform a "Complete Webp...
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
ir) :is(ol, ul, menu, dir) dir { list-style-type: square; } Simplifying section selectors The :is() pseudo-class is particularly useful when dealing with HTML5 sections and headings. Since <section>, <article>, <aside>, and <nav> are commonly nested together, without :is(), styling them to match one another can be tricky. ...
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
of creating space between items, such as the column-gap and row-gap feature as seen in CSS Grid Layout. The inclusion of these properties in Box Alignment means that in future we should be able to use column-gap and row-gap in flex layouts too, and in Firefox 63 you will find the first browser implementation of the gap properties in flex layout. My suggestion when exploring flexbox alignment in
depth is to do so alongside looking at alignment in Grid Layout. Both specifications use the alignment properties as detailed in the Box Alignment specification. You can see how these properties behave when working with a grid in the MDN article Box Alignment in Grid Layout, and I have also compared how alignment works in these specifications in my Box Alignment Cheatsheet. See Also Box Alignment ...
Basic concepts of flexbox - CSS: Cascading Style Sheets
space on either end. Or, to cause items to have equal space around them use the value space-evenly. With space-evenly, items have a full-size space on either end. Try the following values of justify-content in the live example: flex-start flex-end center space-around space-between space-evenly In the article Aligning Items in a Flex Container we will explore these properties in more
depth, in order to have a better understanding of how they work. These simple examples however will be useful in the majority of use cases. Next steps After reading this article you should have an understanding of the basic features of Flexbox. In the next article we will look at how this specification relates to other parts of CSS. ...
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
f the item before growing and shrinking happens? The properties are usually expressed as the shorthand flex property. The following code would set the flex-grow property to 2, flex-shrink to 1 and flex-basis to auto. .item { flex: 2 1 auto; } If you have read the article Basic Concepts of Flexbox, then you will have already had an introduction to the properties. Here we will explore them in
depth in order that you can fully understand what the browser is doing when you use them. Important concepts when working on the main axis There are a few concepts worth digging into before looking at how the flex properties work to control ratios along the main axis. These relate to the natural size of flex items before any growing or shrinking takes place, and to the concept of free space. Flex it...
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
uages that have a different writing mode to English, but also for creative purposes. I'll be using the writing-mode property to make changes to the writing mode applied to our grid, in order to demonstrate how the logical values work. If you want to dig into writing modes further, however, then I would recommend that you read Jen Simmons excellent article on CSS Writing Modes. This goes into more
depth on that specification than we will touch upon here. writing-mode Writing Modes are more than just left to right and right to left text, and the writing-mode property helps us display text running in other directions. The writing-mode property can have values of: horizontal-tb vertical-rl vertical-lr sideways-rl sideways-lr The value horizontal-tb is the default for text on the web. It ...
display - CSS: Cascading Style Sheets
le Adapting to the new two-value syntax of display. Global /* Global values */ display: inherit; display: initial; display: unset; Description The individual pages for the different types of value that display can have set on it feature multiple examples of those values in action -- see the Syntax section. In addition, see the following material, which covers the various values of display in
depth. Adapting to the new two-value syntax of display CSS Flow Layout (display: block, display: inline) Block and Inline Layout in Normal Flow Flow Layout and Overflow Flow Layout and Writing Modes Formatting Contexts Explained In Flow and Out of Flow display: flex Basic concepts of flexbox Aligning Items in a Flex Container Controlling Ratios of Flex Items Along the Main Axis Cros...
Introduction to Web development - Developer guides
answers for beginners Intermediate CSS concepts -- grouping, pseudo-classes and more. JavaScript Beginning Getting started with JavaScript -- what is JavaScript and how can it help you? JavaScript reference guide -- a comprehensive, regularly updated guide to JavaScript for all levels of learning from beginner to advanced. Crockford on JavaScript -- an in-
depth video series on the JavaScript language. Eloquent JavaScript -- a comprehensive guide to intermediate and advanced JavaScript methodologies Intermediate A re-introduction to JavaScript -- a recap on the JavaScript programming language aimed at intermediate-level developers Essential JavaScript design patterns -- an introduction to essential JavaScript design patter...
<tr>: The Table Row element - HTML: Hypertext Markup Language
across) columns, both <th> and <td> support the colspan attribute, which lets you specify how many columns wide the cell should be, with the default being 1. Similarly, you can use the rowspan attribute on cells to indicate they should span more than one table row. This can take a little practice to get right when building your tables. We have some examples below, but for more examples and an in-
depth tutorial, see the HTML tables series in our Learn web development area, where you'll learn how to use the table elements and their attributes to get just the right layout and formatting for your tabular data. Attributes This element includes the global attributes. There are also several deprecated attributes, which you should avoid but may need to know when reading older code. Deprecated attri...
data-* - HTML: Hypertext Markup Language
nd powerful program-objects. For example, a space-ship "sprite" in a game could be a simple <img> element with a class attribute and several data-* attributes: <img class="spaceship cruiserX3" src="shipX3.png" data-ship-id="324" data-weapons="laserI laserII" data-shields="72%" data-x="414354" data-y="85160" data-z="31940" onclick="spaceships[this.dataset.shipId].blasted()"> For a more in-
depth tutorial about using HTML data attributes, see Using data attributes. Specifications Specification Status Comment HTML Living StandardThe definition of 'data-*' in that specification. Living Standard No change from latest snapshot, HTML 5.1 HTML 5.1The definition of 'data-*' in that specification. Recommendation Snapshot of HTML Living Standard, ...
lang - HTML: Hypertext Markup Language
e is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If the attribute value is the empty string (lang=""), the language is set to unknown; if the language tag is not valid according to BCP47, it is set to invalid. Language tag syntax The full BCP47 syntax is in-
depth enough to mark extremely specific language dialects, but most usage is much simpler. A language tag is made of hyphen-separated language subtags, where each subtag indicates a certain property of the language. The 3 most common subtags are: Language subtag Required. A 2-or-3-character code that defines the basic language, typically written in all lowercase. For example, the language code for...
Using HTTP cookies - HTTP
hat a server is unable to confirm that a cookie was set on a secure origin or even to tell where a cookie was originally set. A vulnerable application on a sub-domain can set a cookie with the Domain attribute, which gives access to that cookie on all other subdomains. This mechanism can be abused in a session fixation attack. See session fixation for primary mitigation methods. As a defence-in-
depth measure, however, it is possible to use cookie prefixes to assert specific facts about the cookie. Two prefixes are available: __Host- If a cookie name has this prefix, it is accepted in a Set-Cookie header only if it is also marked with the Secure attribute, was sent from a secure origin, does not include a Domain attribute, and has the Path attribute set to /. In this way, these cookies can...
Protocol upgrade mechanism - HTTP
if you included all of the listed extensions in one such header. Sec-WebSocket-Extensions: extensions extensions A comma-separated list of extensions to request (or agree to support). These should be selected from the IANA WebSocket Extension Name Registry. Extensions which take parameters do so by using semicolon delineation. For example: Sec-WebSocket-Extensions: superspeed, colormode;
depth=16 Sec-WebSocket-Key Provides information to the server which is needed in order to confirm that the client is entitled to request an upgrade to WebSocket. This header can be used when insecure (HTTP) clients wish to upgrade, in order to offer some degree of protection against abuse. The value of the key is computed using an algorithm defined in the WebSocket specification, so this does not pro...
508 Loop Detected - HTTP
The HyperText Transfer Protocol (HTTP) 508 Loop Detected response status code may be given in the context of the Web Distributed Authoring and Versioning (WebDAV) protocol. It indicates that the server terminated an operation because it encountered an infinite loop while processing a request with "
Depth: infinity". This status indicates that the entire operation failed. Status 508 Loop Detected Specifications Specification Title RFC 5842, section 7.2: 508 Loop Detected Web Distributed Authoring and Versioning ...
About JavaScript - JavaScript
onstructed it can be used as a blueprint (or prototype) for creating similar objects. JavaScript's dynamic capabilities include runtime object construction, variable parameter lists, function variables, dynamic script creation (via eval), object introspection (via for ... in), and source code recovery (JavaScript programs can decompile function bodies back into their source text). For a more in
depth discussion of JavaScript programming follow the JavaScript resources links below. What JavaScript implementations are available? The Mozilla project provides two JavaScript implementations. The first ever JavaScript was created by Brendan Eich at Netscape, and has since been updated to conform to ECMA-262 Edition 5 and later versions. This engine, code named SpiderMonkey, is implemented in C/C+...
Functions - JavaScript
multiplier * x); } var arr = multiply(2, 1, 2, 3); console.log(arr); // [2, 4, 6] Arrow functions An arrow function expression (previously, and now incorrectly known as fat arrow function) has a shorter syntax compared to function expressions and does not have its own this, arguments, super, or new.target. Arrow functions are always anonymous. See also this hacks.mozilla.org blog post: "ES6 In
Depth: Arrow functions". Two factors influenced the introduction of arrow functions: shorter functions and non-binding of this. Shorter functions In some functional patterns, shorter functions are welcome. Compare: var a = [ 'Hydrogen', 'Helium', 'Lithium', 'Beryllium' ]; var a2 = a.map(function(s) { return s.length; }); console.log(a2); // logs [8, 6, 7, 9] var a3 = a.map(s => s.length)...
JavaScript modules - JavaScript
unction, const, etc.) has been referred to by its name upon export, and that name has been used to refer to it on import as well. There is also a type of export called the default export -- this is designed to make it easy to have a default function provided by a module, and also helps JavaScript modules to interoperate with existing CommonJS and AMD module systems (as explained nicely in ES6 In
Depth: Modules by Jason Orendorff; search for "Default exports"). Let's look at an example as we explain how it works. In our basic-modules square.js you can find a function called randomSquare() that creates a square with a random color, size, and position. We want to export this as our default, so at the bottom of the file we write this: export default randomSquare; Note the lack of curly braces. ...
Arrow function expressions - JavaScript
Two factors influenced the introduction of arrow functions: the need for shorter functions and the behavior of the this keyword. Shorter functions var elements = [ 'Hydrogen', 'Helium', 'Lithium', 'Beryllium' ]; // This statement returns the array: [8, 6, 7, 9] elements.map(function(element) { return element.length; }); // The regular functio...
Error - JavaScript
r(e.name + ': ' + e.message) } // ... etc } Custom Error Types You might want to define your own error types deriving from Error to be able to throw new MyError() and use instanceof MyError to check the kind of error in the exception handler. This results in cleaner and more consistent error handling code. See "What's a good way to extend Error in JavaScript?" on StackOverflow for an in-
depth discussion. ES6 Custom Error Class Versions of Babel prior to 7 can handle CustomError class methods, but only when they are declared with Object.defineProperty(). Otherwise, old versions of Babel and other transpilers will not correctly handle the following code without additional configuration. Some browsers include the CustomError constructor in the stack trace when using ES2015 classes.
MathML attribute reference - MathML
d crossout <mscarry> Specifies what kind of line is drawn to cross out carries. Unimplemented decimalpoint <mstyle> If the decimalpoint value is used to specify the alignment, this attribute is specifying the character for the alignment point within <mstack> and <mtable> columns. denomalign <mfrac> The alignment of the denominator under the fraction.
depth <mpadded> Sets or increments the
depth. See length. dir <math>, <mi>, <mo>, <mrow>, <ms>, <mtext> The text direction. Possible values are either ltr (left to right) or rtl (right to left). display <math> Specifies the rendering mode. The values block and inline are allowed. displaystyle <mstyle>, <mtable> A Boolean value specifying whether more v...
<mstyle> - MathML
specified in scriptsizemultiplier. scriptminsize Specifies a minimum font size allowed due to changes in scriptlevel. The default value is 8pt. scriptsizemultiplier Specifies the multiplier to be used to adjust font size due to changes in scriptlevel. The default value is 0.71. The <mstyle> element accepts all attributes of all presentation elements with the following exceptions: height,
depth or width do not apply to <mglyph>, <mpadded> or <mtable>. rowalign, columnalign, or groupalign do not apply to <mtr>, <mlabeledtr>, <mtd> or <maligngroup>. lspace or voffset do not apply to <mpadded>. fontfamily does not apply to <mglyph>. align does not apply to <mtable> or <mstack>. index cannot be set on <mstyle>. src and alt on <mglyph> cannot be set on <mstyle>. actiontype on <maction...
Digital audio concepts - Web media technologies
e options tend to revolve around choosing the method by which the encoder performs the encoding and how much time and processor power it's allowed to consume in order to do so. These parameters vary depending on the codec, but can include: Specifying specific algorithms to use during particular phases of the encoding process Parameters for those algorithms to use, such as how much predictive
depth to use when trying to model the audio The number of passes to make while analyzing the audio, or the number of times given algorithms should be run Lossy encoder parameters Most codecs have input values you can tune to optimize the compression in various ways, either for size or for quality. When using a lossy encoder, the higher the quality, the larger the encoded audio will be. Because of t...
Performance fundamentals - Web Performance
position, scale, and so forth of your content. The reason is, once again, hardware acceleration. The browser can do these tasks on your GPU, letting the CPU handle other things. In addition, transforms give you capabilities you might not otherwise have. Not only can you translate elements in 2D space, but you can transform in three dimensions, skew and rotate, and so forth. Paul Irish has an in-
depth analysis of the benefits of translate() from a performance point of view. In general, however, you have the same benefits you get from using CSS animations: you use the right tool for the job and leave the optimization to the browser. You also use an easily extensible way of positioning elements -- something that needs a lot of extra code if you simulate translation with top and left positioning.
Privacy, permissions, and information security
e, ideally only with sites they trust. Cooperation among web content, the web browser, and the web server is needed to achieve as much privacy and information security as possible. In this article, we examine how to create web content that minimizes the risk of users' personal information or imagery being obtained unexpectedly by third parties. Security and privacy defined Before we go into any
depth about the various security and privacy features available to users on the web, let's define some important terms. Personally identifiable information Personally identifiable information (PII) is information which can be used, in whole or in part, to track down and/or identify a specific person. As such, PII extends beyond the web to all aspects of life. For example, if a site leaks a list o...
Progressive web apps (PWAs)
Introduction to progressive web apps Progressive web app structure Making PWAs work offline with Service workers How to make PWAs installable How to make PWAs re-engageable using Notifications and Push Progressive loading Technology guides Client-side storage -- A lengthy guide showing how and when to use web storage, IndexedDB, and service workers. Using service workers -- A more in-
depth guide covering the Service Worker API. Using IndexedDB -- The fundamentals of IndexedDB, explained in detail. Using the Web Storage API -- The Web storage API made simple. Instant Loading Web Apps with An Application Shell Architecture -- A guide to using the App Shell coding pattern to create apps that load quickly. Using the Push API -- Learn the essentials behind the Web Push API. Using t...
descent - SVG: Scalable Vector Graphics
Note: It was specified to share the syntax and semantics of the obsolete descent descriptor of the @font-face at-rule defined in an early version of CSS 2. ...
spreadMethod - SVG: Scalable Vector Graphics
ation. Recommendation Initial definition for <linearGradient> Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. No compatibility data found. Please contribute data for "svg.attributes.presentation.spreadMethod" (
depth: 1) to the MDN compatibility data repository. ...
Content type - SVG: Scalable Vector Graphics
an RGB value in hexadecimal notation is a "#" immediately followed by either three or six hexadecimal characters. The three-digit RGB notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. For example, #fb0 expands to #ffbb00. This ensures that white (#ffffff) can be specified with the short notation (#fff) and removes any dependencies on the color
depth of the display. The format of an RGB value in the functional notation is an RGB start-function, followed by a comma-separated list of three numerical values (either three integer values or three percentage values) followed by ")". An RGB start-function is the case-insensitive string "rgb(", for example "RGB(" or "rGb(". For compatibility, the all-lowercase form "rgb(" is preferred. The integer va...
SVG documentation index - SVG: Scalable Vector Graphics
om data attributes. They let SVG markup and its resulting DOM share information that standard attributes can't, usually for scripting purposes. Their custom data are available via the SVGElement interface of the element the attributes belong to, with the SVGElement.dataset property. 56 descent Deprecated, SVG, SVG Attribute The descent attribute defines the maximum unaccented
depth of the font. 57 diffuseConstant Filters, SVG, SVG Attribute The diffuseConstant attribute represents the kd value in the Phong lighting model. In SVG, this can be any non-negative number. 58 direction SVG, SVG Attribute The direction attribute specifies the inline-base direction of a <text> or <tspan> element. It defines the start and end points of a line...
Getting started - SVG: Scalable Vector Graphics
rc="image.svg"></iframe> An img element can theoretically be used too. However, this technique doesn't work in Firefox before 4.0. Finally, SVG can be created dynamically with JavaScript and injected into the HTML DOM. With this method, replacement technologies can be implemented for browsers which normally can't process SVG. See this dedicated article which deals with the topic in-
depth. How SVG handles sizes and units will be explained on the next page. SVG file types SVG files come in two flavors. Normal SVG files are simple text files containing SVG markup. The recommended filename extension for these files is ".svg" (all lowercase). Due to the potentially massive size SVG files can reach when used for some applications (e.g., geographical applications), the SVG specific...
Tutorials
essential JavaScript design patterns. Advanced level JavaScript Guide A comprehensive, regularly updated guide to JavaScript for all levels of learning from beginner to advanced. You Don't Know JS A series of books diving deep into the core mechanisms of the JavaScript language. JavaScript Garden Documentation of the most quirky parts of JavaScript. Exploring ES6 Reliable and in-
depth information on ECMAScript 2015. JavaScript Patterns A JavaScript pattern and antipattern collection that covers function patterns, jQuery patterns, jQuery plugin patterns, design patterns, general patterns, literals and constructor patterns, object creation patterns, code reuse patterns, DOM. How browsers work A detailed research article describing different modern browsers, their engine...
XML introduction - XML: Extensible Markup Language
ns (XSLT) which can be used to transform XML into other languages such as HTML. This makes XML incredibly versatile. <?xml-stylesheet type="text/xsl" href="transform.xsl"?> Recommendations This article is obviously only a very brief introduction to what XML is, with a few small examples and references to get you started. For more details about XML, you should look around on the Web for more in-
depth articles. Learning the HyperText Markup Language (HTML) will help you better understand XML. ...