Search completed in 1.53 seconds.
<output>: The Output element - HTML: Hypertext Markup Language
the html
output element (<
output>) is a container element into which a site or app can inject the results of a calculation or the outcome of a user action.
... implicit aria role status permitted aria roles any dom interface html
outputelement attributes this element includes the global attributes.
... form the <form> element to associate the
output with (its form owner).
...And 6 more matches
nsIOutputStream
xpcom/io/nsi
outputstream.idlscriptable an interface describing a writable stream of data.
... inherits from: nsisupports last changed in gecko 1.0 an
output stream may be "blocking" or "non-blocking" (see the isnonblocking() method).
... a blocking
output stream may suspend the calling thread in order to satisfy a call to close(), flush(), write(), writefrom(), or writesegments().
...And 18 more matches
HTMLOutputElement - Web APIs
the html
outputelement interface provides properties and methods (beyond those inherited from htmlelement) for manipulating the layout and presentation of <
output> elements.
...aco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlelement</text></a><polyline points="491,25 501,20 501,30 491,25" stroke="#d4dde4" fill="none"/><line x1="501" y1="25" x2="509" y2="25" stroke="#d4dde4"/><line x1="509" y1="25" x2="509" y2="90" stroke="#d4dde4"/><line x1="509" y1="90" x2="492" y2="90" stroke="#d4dde4"/><a xlink:href="/docs/web/api/html
outputelement" target="_top"><rect x="321" y="65" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="406" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">html
outputelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this inte...
... html
outputelement.defaultvalue a domstring representing the default value of the element, initially the empty string.
...And 15 more matches
Enc Dec MAC Output Public Key as CSR
nss sample code 5: encryption/decryption and mac and
output public as a csr.
... generates encryption/mac keys and
outputs public key as certificate signing request /* this source code form is subject to the terms of the mozilla public * license, v.
...l]\n\n", "-f "); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z "); fprintf(stderr, "%-21s specify subject\n\n", "-s "); fprintf(stderr, "%-21s specify certficate request file name\n\n", "-r "); fprintf(stderr, "%-21s specify an input file name\n\n", "-i "); fprintf(stderr, "%-21s specify an
output file name\n\n", "-o "); fprintf(stderr, "%-7s for encrypt, it takes as an input file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate
output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final outpu...
...And 9 more matches
nsIAsyncOutputStream
xpcom/io/nsiasync
outputstream.idlscriptable please add a summary to this article.
... inherits from: nsi
outputstream last changed in gecko 1.7 if an
output stream is non-blocking, it may return ns_base_stream_would_block when written to.
...if the stream implements nsiasync
outputstream, then the caller can use this interface to request an asynchronous notification when the stream becomes writable or closed (via the asyncwait() method).
...And 9 more matches
<xsl:output> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:
output> element controls the characteristics of the
output document.
... syntax <xsl:
output method="xml" | "html" | "text" version=string encoding=string omit-xml-declaration="yes" | "no" standalone="yes" | "no" doctype-public=string doctype-system=string cdata-section-elements=list-of-names indent="yes" | "no" media-type=string /> required attributes none.
... optional attributes method specifies
output format.
...And 8 more matches
nsIBinaryOutputStream
xpcom/io/nsibinary
outputstream.idlscriptable this interface allows writing of primitive data types (integers, floating-point values, booleans, and so on.) to a stream in a binary, untagged, fixed-endianness format.
...
output is written in big-endian order (high-order byte first), as this is traditional network order.
... inherits from: nsi
outputstream last changed in gecko 1.7 method overview void set
outputstream(in nsi
outputstream a
outputstream); void write8(in pruint8 abyte); void write16(in pruint16 a16); void write32(in pruint32 a32); void write64(in pruint64 a64); void writeboolean(in prbool aboolean); void writebytearray([array, size_is(alength)] in pruint8 abytes, in pruint32 alength); void writebytes(alength)] in string astring, in pruint32 alength); void writedouble(in double adouble); void writefloat(in float afloat); void writestringz(in string astring); void writeutf8z(in wstring astring); void writewstringz(in wstring astring); methods set
outputstream() sets the stream to which
output is directed.
...And 6 more matches
AudioContext.getOutputTimestamp() - Web APIs
the get
outputtimestamp() property of the audiocontext interface returns a new audiotimestamp object containing two audio timestamp values relating to the current audio context.
... the two values are as follows: audiotimestamp.contexttime: the time of the sample frame currently being rendered by the audio
output device (i.e.,
output audio stream position), in the same units and origin as the context's audiocontext.currenttime.
... audiotimestamp.performancetime: an estimation of the moment when the sample frame corresponding to the stored contexttime value was rendered by the audio
output device, in the same units and origin as performance.now().
...And 5 more matches
XForms Output Element - Archive of obsolete content
attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control accesskey - used to specify the keyboard shortcut for focusing this control single-node binding special value - xpath expression whose evaluation result is used as the
output's value.
... type restrictions the
output element can be bound to a node containing simple content of any data type.
... representations the xforms
output element can be represented by the following widgets for the specified data types (or types derived from these data types): text - default representation for instance data of most types, especially static text (xhtml/xul).
...And 4 more matches
<samp>: The Sample Output element - HTML: Hypertext Markup Language
the html sample element (<samp>) is used to enclose inline text which represents sample (or quoted)
output from a computer program.
... the css to override the default font face would look like this: samp { font-family: "courier"; } if you need an element which will serve as a container for
output generated by your website or app's javascript code, you should instead use the <
output> element.
... examples basic example in this simple example, a paragraph includes an example of the
output of a program.
...And 3 more matches
nsIConverterOutputStream
xpcom/io/nsiconverter
outputstream.idlscriptable this interface allows writing strings to a stream, doing automatic character encoding conversion.
... 1.0 66 introduced gecko 1.8 inherits from: nsiunichar
outputstream last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/intl/converter-
output-stream;1.
... to create an instance, use: var converter
outputstream = components.classes["@mozilla.org/intl/converter-
output-stream;1"] .createinstance(components.interfaces.nsiconverter
outputstream); method overview void init(in nsi
outputstream aoutstream, in string acharset, in unsigned long abuffersize, in prunichar areplacementcharacter); methods init() initialize this stream.
...And 2 more matches
Rich output - Firefox Developer Tools
in particular, it: provides extra information for certain types enables detailed examination of the object's properties provides richer information for dom elements, and enables you to select them in the inspector type-specific rich
output the web console provides rich
output for many object types, including the following: object array date promise regexp window document element event examining object properties when an object is logged to the console it has a right-pointing triangle next to it, indicating that it can be expanded.
... export
output to the clipboard once you have
output in the console window, you can save it to the clipboard by right-clicking on the
output and selecting export visible messages to clipboard: this will copy all of the
output to the clipboard.
...the
output will look something like this: console.log(todolist) array(4) [ {…}, {…}, {…}, {…} ] debugger eval code:1:9 undefined if you expand objects, such as arrays, you get slightly different content.
...les", datecreated: 1552404493169 } 2: object { status: "to do", description: "create feedback form", datecreated: 1552404512630 } 3: object { status: "to do", description: "normalize table", datecreated: 1552404533790 } length: 4 <prototype>: array [] debugger eval code:1:9 undefined highlighting and inspecting dom nodes if you hover the mouse over any dom element in the console
output, it's highlighted on the page: in the screenshot above you'll also see a blue "target" icon next to the node in the console
output: click it to switch to the inspector with that node selected.
AudioContext.outputLatency - Web APIs
the
outputlatency read-only property of the audiocontext interface provides an estimation of the
output latency of the current audio context.
... this is the time, in seconds, between the browser passing an audio buffer out of an audio graph over to the host system's audio subsystem to play, and the time at which the first sample in the buffer is actually processed by the audio
output device.
... syntax var
outputlatency = audioctx.
outputlatency; value a double representing the
output latency in seconds.
... example const audioctx = new audiocontext(); console.log(audioctx.
outputlatency); specifications specification status comment web audio apithe definition of '
outputlatency' in that specification.
nsIOutputStreamCallback
xpcom/io/nsiasync
outputstream.idlscriptable this is a companion interface for nsiasync
outputstream.asyncwait.
... inherits from: nsisupports last changed in gecko 1.7 method overview void on
outputstreamready(in nsiasync
outputstream astream); methods on
outputstreamready() called to indicate that the stream is either writable or closed.
... void on
outputstreamready( in nsiasync
outputstream astream ); parameters astream the stream whose nsiasync
outputstream.asyncwait() method was called.
AudioNode.numberOfOutputs - Web APIs
the numberof
outputs property of the audionode interface returns the number of
outputs coming out of the node.
... syntax var num
outputs = audionode.numberof
outputs; value an integer ≥ 0.
... example const audioctx = new audiocontext(); const oscillator = audioctx.createoscillator(); const gainnode = audioctx.creategain(); oscillator.connect(gainnode).connect(audioctx.destination); console.log(oscillator.numberof
outputs); // 1 console.log(gainnode.numberof
outputs); // 1 console.log(audioctx.destination.numberof
outputs); // 0 specifications specification status comment web audio apithe definition of 'numberof
outputs' in that specification.
HTMLOutputElement.labels - Web APIs
the html
outputelement.labels read-only property returns a nodelist of the <label> elements associated with the <
output> element.
... syntax var labelelements =
output.labels; return value a nodelist containing the <label> elements associated with the <
output> element.
... example html <label id="label1" for="test">label 1</label> <
output id="test">
output</
output> <label id="label2" for="test">label 2</label> javascript window.addeventlistener("domcontentloaded", function() { const
output = document.getelementbyid("test"); for(var i = 0; i <
output.labels.length; i++) { console.log(
output.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html living standardthe definition of 'labels' in that specification.
nsIFileOutputStream
netwerk/base/public/nsifilestreams.idlscriptable this interface is an
output stream that lets you stream to a file.
... inherits from: nsi
outputstream last changed in gecko 1.7 method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants behavior flag constants constant value description defer_open 1<<0 see the same constant in nsifileinputstream.
MIDIOutputMap - Web APIs
the midi
outputmap read-only interface of the web midi api provides a map-like interface to the currently available midi
output ports.
Index - Web APIs
it is an audionode that passes the audio stream unchanged from the input to the
output, but allows you to take the generated data, process it, and create audio visualizations.
... 132 audiocontext.get
outputtimestamp() api, audio, audiocontext, method, reference, web audio api, get
outputtimestamp, sound the get
outputtimestamp() property of the audiocontext interface returns a new audiotimestamp object containing two correlated context's audio stream position values.
... 133 audiocontext.
outputlatency api, audio, audiocontext, experimental, property, reference, web audio api,
outputlatency the
outputlatency read-only property of the audiocontext interface provides an estimation of the
output latency of the current audio context.
...And 59 more matches
Index
170 enc dec mac
output public key as csr generates encryption/mac keys and
outputs public key as certificate signing request 171 enc dec mac using key wrap certreq pkcs10 csr generates encryption/mac keys and
outputs public key as pkcs11 certificate signing request 172 encdecmac using token object - sample 3 encdecmac, html, ncc, ncc article, web, web development no...
... -n suppress
output of contents (decode only).
... -a use ascii format or allow the use of ascii format for input and
output.
...And 40 more matches
Basic concepts behind Web Audio API - Web APIs
audio nodes are linked via their inputs and
outputs, forming a chain that starts with one or more sources, goes through one or more nodes, then ends up at a destination.
...the number after the period indicates the number of those channels which are reserved for low-frequency effect (lfe)
outputs; these are often referred to as subwoofers.
... each input or
output is composed of one or more audio channels, which together represent a specific audio layout.
...And 33 more matches
AudioNode.channelInterpretation - Web APIs
when the number of channels doesn't match between an input and an
output, up- or down-mixing happens according the following rules.
... this can be somewhat controlled by setting the audionode.channelinterpretation property to speakers or discrete: interpretation input channels
output channels mixing rules speakers 1 (mono) 2 (stereo) up-mix from mono to stereo.
... the m input channel is used for both
output channels (l and r).
...And 27 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
tton label="horizontal1"/> <button label="horizontal2"/> </hbox> <label value="vertical layout"/> <vbox> <button label="vertical1"/> <button label="vertical2"/> </vbox> <label value="mixed"/> <hbox> <button label="mixed1"/> <vbox> <button label="mixed2"/> <button label="mixed3"/> </vbox> <button label="mixed4"/> </hbox> listing 3: horizontal and vertical boxes figure 1:
output of listing 3 there is also a grid element, which can be used for layouts similar to those achieved using the html table element, a stack element for layering other elements, and so on.
...figure 2 shows how setting align="center" pack="start" on two elements will result in completely different
output with the only difference being the value for orient.
... <box flex="1" align="end" pack="end"> <button label="happy"/> <button label="sad"/> </box> listing 2: how align and pack respond to orient figure 2:
output from listing 2 flex elements ordinarily have fixed height and width.
...And 25 more matches
console - Web APIs
console.debug()
outputs a message to the console with the log level debug.
... console.error()
outputs an error message.
... console.group() creates a new inline group, indenting all following
output by another level.
...And 22 more matches
Background audio processing using AudioWorklet - Web APIs
create module that defines a audio worklet processor class, based on audioworkletprocessor which takes audio from one or more incoming sources, performs its operation on the data, and
outputs the resulting audio data.
...slider controls are available to allow controlling the gain of both the oscillator and the audio worklet's
output.
... basic code framework the barest framework of an audio processor class looks like this: class myaudioprocessor extends audioworkletprocessor { constructor() { super(); } process(inputlist,
outputlist, parameters) { /* using the inputs (or not, as needed), write the
output into each of the
outputs */ return true; } }; registerprocessor("my-audio-processor", myaudioprocessor); after the implementation of the processor comes a call to the global function registerprocessor(), which is only available within the scope of the audio context's audioworklet, which is the invoke...
...And 21 more matches
FileUtils.jsm
.jsm"); the file constructor if you have a path to a file (or directory) you want to obtain an nsifile for, you can do so using the file constructor, like this: var f = new fileutils.file(mypath); method overview nsifile getfile(string key, array patharray, bool followlinks); nsifile getdir(string key, array patharray, bool shouldcreate, bool followlinks); nsifile
outputstream openfile
outputstream(nsifile file, int modeflags); nsifile
outputstream openatomicfile
outputstream(nsifile file, int modeflags); nsifile
outputstream opensafefile
outputstream(nsifile file, int modeflags); void closeatomicfile
outputstream(nsifile
outputstream stream); void closesafefile
outputstream(nsifile
outputstream stream); constants const...
...instead use the file constructor, so simply: var dir = new fileutils.file('c:\\blah\\blah'); if (dir.exists()) { //yes directory exists } openfile
outputstream() opens a file
output stream for writing.
... the stream is opened with the defer_open nsifile
outputstream.behavior flag constant this means the file is not actually opened until the first time it's accessed.
...And 17 more matches
XPCOM Stream Guide
that water line represents an
output stream: a controller for data going into something.
...@mozilla.org/io/string-input-stream;1 nsistringinputstream stream.setdata(data, length); file nsfileinputstream @mozilla.org/network/file-input-stream;1 nsifileinputstream stream.init(file, ioflags, perm, behaviorflags); zip nsjarinputstream n/a nsiinputstream zipreader.getinputstream(zipentry); similarly, each of these implements nsi
outputstream.
... primitive
output streams type native class contract id interface how to bind to a data target generic nsstoragestream @mozilla.org/storagestream;1 nsistoragestream stream.get
outputstream(); // returns nsi
outputstream file nsfile
outputstream @mozilla.org/network/file-
output-stream;1 nsifile
outputstream stream.init(file, ioflags, perm, behaviorflags); file nssafefile
outputstream @mozilla.org/network/safe-file-
output-stream;1 nsisafefile
outputstream, nsifile
outputstream stream.init(file, ioflags, perm, behaviorflags); channels have streams too any implementation of nsichannel will have an input stream as well, but unless you own the channel, you shouldn't try to read from the input strea...
...And 17 more matches
nsIWebBrowserPersist
t = components.classes["@mozilla.org/embedding/browser/nswebbrowserpersist;1"] .createinstance(components.interfaces.nsiwebbrowserpersist); method overview void cancelsave(); void savechannel(in nsichannel achannel, in nsisupports afile); void savedocument(in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string a
outputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn); void saveuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext); void saveprivacyawareuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in l...
... persist_flags_serialize_
output 1024 force serialization of
output (one file at a time; not concurrent) persist_flags_dont_change_filenames 2048 don't make any adjustments to filenames.
... encode_flags_selection_only 1
output only the current selection as opposed to the whole document.
...And 16 more matches
DMD
for instance, on osx, you can run something like: dmd=1 /applications/firefox\ nightly.app/contents/macos/firefox you can tell it is working by going to about:memory and looking for "save dmd
output".
... const cc = components.classes; let mydumper = cc["@mozilla.org/memory-info-dumper;1"] .getservice(ci.nsimemoryinfodumper); mydumper.dumpmemoryinfototempdir(identifier, anonymize, minimize); this will dump memory reports and dmd
output to the temporary directory.
...dmd[5222] } in an e10s-enabled build, you'll see separate
output for each process.
...And 15 more matches
NSS Tools ssltap
syntax to run the ssl debugging tool, type this command in a command shell: ssltap [-vhfsxl] [-p port] hostname:port options the command does not require any options other than hostname:port, but you normally use them to control the connection interception and
output.
...instead of
outputting raw data, the command interprets each record as a numbered line of hex values, followed by the same data as ascii characters.
...
output is printed in colored html.
...And 15 more matches
Box-shadow generator - CSS: Cascading Style Sheets
<div class="input" data-topic="r" data-title='r:' data-action="rgb"></div> <div class="input" data-topic="g" data-title='g:' data-action="rgb"></div> <div class="input" data-topic="b" data-title='b:' data-action="rgb"></div> </div> <div class="preview block"> <div id="
output_color"> </div> </div> <div class="block info"> <div class="input" data-topic="a" data-title='alpha:' data-action="alpha"></div> <div class="input" data-topic="hexa" data-title='' data-action="hexa"></div> </div> </div> </div> </div> <div class="w...
... data-min="0" data-max="400" data-step="1" data-value="200"> </div> <div class="ui-slider-btn-set" data-topic="height" data-type="add"></div> <div class="ui-slider-input" data-topic="height" data-unit="px"></div> </div> </div> </div> <div id="
output" class="category"> <div id="menu" class="menu"></div> <div class="title"> css code </div> <div class="group" style="border-top-left-radius: 0;"> <div class="
output" data-topic="element" data-name="element" data-prop="width height background-color position=[relative] box-shadow"> </di...
...v> <div class="
output" data-topic="before" data-name="element:before" data-prop="content=[""] position=[absolute] width height top left z-index background-color box-shadow transform -webkit-transform -ms-transform"> </div> <div class="
output" data-topic="after" data-name="element:after" data-prop="content=[""] position=[absolute] width height top left z-index background-color box-shadow transform -webkit-transform -ms-transform"> </div> </div> </div> </div> </div> </div> css content /* grid of twelve * ========================================================================== */ .span_12 { width: 100%; }...
...And 15 more matches
Eclipse CDT Manual Setup
the way that eclipse cdt does build option discovery is to scan the console
output from a real build looking for lines where a compiler was invoked.
...if relative paths are used to specify the source file or any of its include paths (common in mozilla), and if you fail to take steps to make sure the build
output specifies which directory the compiler is invoked from, this will not be possible.
...first, eclipse needs build console
output for a complete build, so that it can find compiler options for as many source files as possible.
...And 14 more matches
Animated PNG graphics
the canvas is the area on the
output device on which the frames are to be displayed.
... the
output buffer is a pixel array with dimensions specified by the width and height parameters of the png 'ihdr' chunk.
... conceptually, each frame is constructed in the
output buffer before being composited onto the canvas.
...And 14 more matches
Index - Archive of obsolete content
by default the time for each test is
output.
... when the number of iterations is greater than 2 all times are displayed in [], faster time is displayed in the
output column, and the 95% confidence interval is calculated.
... the testsuite allows more flexibility by coding scripts in python allowing any executable to run, sending commands to stdin, and asserting
output using regular expressions.
...And 13 more matches
NSS tools : ssltab
instead of
outputting raw data, the command interprets each record as a numbered line of hex values, followed by the same data as ascii characters.
...
output is printed in colored html.
...you can use this option to upload the
output into a browser.
...And 13 more matches
NSS tools : ssltap
instead of
outputting raw data, the command interprets each record as a numbered line of hex values, followed by the same data as ascii characters.
...
output is printed in colored html.
...you can use this option to upload the
output into a browser.
...And 13 more matches
NSS tools : ssltap
instead of
outputting raw data, the command interprets each record as a numbered line of hex values, followed by the same data as ascii characters.
...
output is printed in colored html.
...you can use this option to upload the
output into a browser.
...And 13 more matches
Writing to Files - Archive of obsolete content
to write to a file, an
output stream is used.
... an
output stream is an object which can be used to write bytes, strings and other values to a file.
... to create an
output stream, use nsiscriptableio.new
outputstream().
...And 12 more matches
Index - XSLT: Extensible Stylesheet Language Transformations
22 <xsl:attribute-set> element, reference, xslt, attribute-set the <xsl:attribute-set> element creates a named set of attributes, which can then be applied as whole to the
output document, in a manner similar to named styles in css.
... 23 <xsl:attribute> attribute, element, reference, xslt the <xsl:attribute> element creates an attribute in the
output document, using any values that can be accessed from the stylesheet.
... the element must be defined before any other
output document element inside the
output document element for which it establishes attribute values.
...And 12 more matches
Command line crash course - Learn web development
we’ve already looked at ls, which
outputs the contents of the current directory: ls but what if we wanted to quickly count the number of files and directories inside the current directory?
...this can be a text file — the below example
outputs the number of lines in myfile.txt: wc -l myfile.txt but it can also count the number of lines of whatever
output is piped into it.
... for example, the below command counts the number of lines
outputted by the ls command (what it would normally print to the terminal if run on its own) and
outputs that count to the terminal instead: ls | wc -l since ls prints each file or directory on its own line, that effectively gives us a directory and file count.
...And 10 more matches
Looping code - Learn web development
const cats = ['bill', 'jeff', 'pete', 'biggles', 'jasmin']; let info = 'my cats are called '; const para = document.queryselector('p'); for (let i = 0; i < cats.length; i++) { info += cats[i] + ', '; } para.textcontent = info; this gives us the following
output: hidden code 2 <!doctype html> <html> <head> <meta charset="utf-8"> <title>basic for loop example</title> <style> </style> </head> <body> <p></p> <script> const cats = ['bill', 'jeff', 'pete', 'biggles', 'jasmin']; let info = 'my cats are called '; const para = document.queryselector('p'); for (let i = 0; i < cats.length; i++) { info += ca...
... one small problem we are left with is that the final
output sentence isn't very well-formed: my cats are called bill, jeff, pete, biggles, jasmin, ideally, we want to change the concatenation on the final loop iteration so that we haven't got a comma on the end of the sentence.
... the html is basically the same as the last example — a simple text input, and a paragraph for
output.
...And 9 more matches
TimerFirings logging
nspr_log_modules=timerfirings:4
output once enabled, timerfirings will print one line of logging
output per timer fired.
... it's best to redirect this
output to a file.
... the following sample shows the basics of this
output.
...And 9 more matches
Index
338 nsiasync
outputstream interfaces, interfaces:scriptable, needscontent, streams, xpcom, xpcom api reference, xpcom interface reference if an
output stream is non-blocking, it may return ns_base_stream_would_block when written to.
...if the stream implements nsiasync
outputstream, then the caller can use this interface to request an asynchronous notification when the stream becomes writable or closed (via the asyncwait() method).
... 359 nsibinary
outputstream file i/o, interfaces, interfaces:scriptable, streams, xpcom, xpcom api reference, xpcom interface reference sets the stream to which
output is directed.
...And 9 more matches
Web Audio API - Web APIs
audio nodes are linked into chains and simple webs by their inputs and
outputs.
...
outputs of these nodes could be linked to inputs of others, which mix or modify these streams of sound samples into different streams.
...a biquadfilternode always has exactly one input and one
output.
...And 9 more matches
Scaling of SVG backgrounds - CSS: Cascading Style Sheets
source: no dimensions or intrinsic ratio given this css: background: url(no-dimensions-or-ratio.svg); background-size: 125px 175px; the rendered
output would look like this: source: one specified dimension, no intrinsic ratio given this css: background: url(100px-wide-no-height-or-ratio.svg); background-size: 250px 150px; the rendered
output would look like this: source: one specified dimension with intrinsic ratio given this css: background: url(100px-height-3x4-ratio.svg); background-size: 275px 125px; the rendered
output would l...
...ook like this: source: no specified width or height with intrinsic ratio given this css: background: url(no-dimensions-1x1-ratio.svg); background-size: 250px 100px; the rendered
output would look like this: using contain or cover specifying cover for background-size makes the picture as small as possible while still covering the entire background area.
... background: url(no-dimensions-or-ratio.svg); background-size: contain; the rendered
output looks like this: source: one specified dimension, no intrinsic ratio similarly, if the image has one dimension specified but no intrinsic ratio, rule 4 applies, and the image is scaled to cover the entire background area.
...And 9 more matches
Public class fields - JavaScript
class classwithstaticfield { static staticfield = 'static field' } console.log(classwithstaticfield.staticfield) // expected
output: "static field" fields without initializers are initialized to undefined.
... class classwithstaticfield { static staticfield } console.assert(classwithstaticfield.hasownproperty('staticfield')) console.log(classwithstaticfield.staticfield) // expected
output: "undefined" public static fields are not reinitialized on subclasses, but can be accessed via the prototype chain.
... class classwithstaticfield { static basestaticfield = 'base field' } class subclasswithstaticfield extends classwithstaticfield { static substaticfield = 'sub class field' } console.log(subclasswithstaticfield.substaticfield) // expected
output: "sub class field" console.log(subclasswithstaticfield.basestaticfield) // expected
output: "base field" when initializing fields, this refers to the class constructor.
...And 9 more matches
Getting started with HTML - Learn web development
see your changes update live in the
output area.
... playable code <h2>live
output</h2> <div class="
output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="playable-code" style="min-height: 100px;width: 95%"> this is my text.
...on" /> </div> html { font-family: 'open sans light',helvetica,arial,sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var
output = document.queryselector('.
output'); var code = textarea.value; var userentry = textarea.value; function updatecode() {
output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { ...
...And 8 more matches
HTML text fundamentals - Learn web development
in the example below, add elements to the raw text in the input field so that it appears as a heading and two paragraphs in the
output field.
... playable code <h2>live
output</h2> <div class="
output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="min-height: 100px; width: 95%">my short story i am a statistician and my name is trish.
...tion" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var
output = document.queryselector('.
output'); var code = textarea.value; var userentry = textarea.value; function updatecode() {
output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { ...
...And 8 more matches
AudioWorkletProcessor.process - Web APIs
syntax var isactivelyprocessing = audioworkletprocessor.process(inputs,
outputs, parameters); parameters inputs an array of inputs connected to the node, each item of which is, in turn, an array of channels.
...
outputs an array of
outputs that is similar to the inputs parameter in structure.
...each of the
output channels is filled with zeros by default — the processor will
output silence unless the
output arrays are modified.
...And 8 more matches
Functions — reusable blocks of code - Learn web development
it also contains a third function called
output(), which takes a single parameter and
outputs it in a paragraph on the page.
...in the javascript console, enter the following command:
output(x); you should see the value of variable x
output to the screen.
... now try entering the following in your console
output(y);
output(z); both of these should return an error along the lines of "referenceerror: y is not defined".
...And 7 more matches
NSS tools : certutil
output defaults to standard out unless you use -o
output-file argument.
... use the -a argument to specify ascii
output.
... -a use ascii format or allow the use of ascii format for input or
output.
...And 7 more matches
NSS Tools certutil
output defaults to standard out unless you use -o
output-file argument.
... use the -a argument to specify ascii
output.
... arguments -a use ascii format or allow the use of ascii format for input or
output.
...And 7 more matches
AudioNode.connect() - Web APIs
the connect() method of the audionode interface lets you connect one of the node's
outputs to a target, which may be either another audionode (thereby directing the sound data to the specified node) or an audioparam, so that the node's
output data is automatically used to change the value of that parameter over time.
... syntax var destinationnode = audionode.connect(destination,
outputindex, inputindex); audionode.connect(destination,
outputindex); parameters destination the audionode or audioparam to which to connect.
...
outputindex optional an index specifying which
output of the current audionode to connect to the destination.
...And 7 more matches
AudioNode - Web APIs
description the audio routing graph each audionode has inputs and
outputs, and multiple audio nodes are connected to build a processing graph.
... a source node has zero inputs but one or multiple
outputs, and can be used to generate sound.
... on the other hand, a destination node has no
outputs; instead, all its inputs are directly played back on the speakers (or whatever audio
output device the audio context uses).
...And 7 more matches
AudioWorkletNodeOptions - Web APIs
numberof
outputs optional the value to initialize the numberof
outputs property to.
...
outputchannelcount optional an array defining the number of channels for each
output.
... for example,
outputchannelcount: [n, m] specifies the number of channels in the first
output to be n and the second
output to be m.
...And 7 more matches
switch - JavaScript
'giraffe'; switch (animal) { case 'cow': case 'giraffe': case 'dog': case 'pig': console.log('this animal will go on noah\'s ark.'); break; case 'dinosaur': default: console.log('this animal will not.'); } multi-case : chained operations this is an example of a multiple-operation sequential case clause, where, depending on the provided integer, you can receive different
output.
... var foo = 1; var
output = '
output: '; switch (foo) { case 0:
output += 'so '; case 1:
output += 'what ';
output += 'is '; case 2:
output += 'your '; case 3:
output += 'name'; case 4:
output += '?'; console.log(
output); break; case 5:
output += '!'; console.log(
output); break; default: console.log('please pick a number from 0 to 5!'); } the
output from this example: value log text foo is nan or not 1, 2, 3, 4, 5, or 0 please pick a number from 0 to 5!
... 0
output: so what is your name?
...And 7 more matches
File I/O - Archive of obsolete content
this article describes local file input/
output in chrome javascript.
...it defaults to // fileutils.mode_wronly | fileutils.mode_create | fileutils.mode_truncate; var ostream = fileutils.opensafefile
outputstream(file); var converter = components.classes["@mozilla.org/intl/scriptableunicodeconverter"].
... function streamtofile(stream, file, callback) { var
output = fileutils.opensafefile
outputstream(file) netutil.asynccopy(stream,
output, callback); } synchronous checking the existence of a file // |file| is nsifile if (file.exists()) { // ...
...And 6 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
true javascript.options.showinconsole (present in firefox 3.5+)
outputs javascript errors to the error console.
... true javascript.options.strict (present in firefox 3.5+) enforces strict error
output from javascript true table 1: preferences to set for developing extensions to make these changes, start your development profile, type about:config into firefox’s location bar and open the preferences window; find the preferences listed in table 1 and double-click on them to set them accordingly.
... listing 23: content for _writefile method _writefile: function(afile, adata) { // init stream var stream = components.classes["@mozilla.org/network/safe-file-
output-stream;1"].
...And 6 more matches
Creating a Microsummary - Archive of obsolete content
for example, if you use php scripts to generate pages on your site, you could write php code to
output a microsummary when the view=microsummary url parameter is present.
...plate> element: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> </transform> </template> </generator> note that while microsummary generators can include arbitrary xslt, including xslt that produces rich text
output, firefox currently only displays the text version of the xslt
output.
... specifying the
output type since the xslt transform sheet will generate a text microsummary, we should indicate this with the xslt <
output> element: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> <
output method="text"/> </transform> </template> </generator> using a simple xslt <template> the xslt processor transforms documents by comparing each xslt <template> element in the transform sheet to a set of nodes in the document.
...And 6 more matches
Advanced text formatting - Learn web development
<dd>in writing, a section of content that is related to the current topic, but doesn't fit directly into the main flow of content so is presented nearby (often in a box off to the side.)</dd> </dl> active learning: marking up a set of definitions it's time to try your hand at description lists; add elements to the raw text in the input field so that it appears as a description list in the
output field.
... playable code <h2>live
output</h2> <div class="
output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="min-height: 100px; width: 95%"> bacon the glue that binds the world together.
...pe="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const
output = document.queryselector('.
output'); const code = textarea.value; const userentry = textarea.value; function updatecode() {
output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function()...
...And 6 more matches
certutil
output defaults to standard out unless you use -o
output-file argument.
... use the -a argument to specify ascii
output.
... -a use ascii format or allow the use of ascii format for input or
output.
...And 6 more matches
Rhino serialization
rhino serialization apis two new classes, scriptable
outputstream and scriptableinputstream, were introduced to handle serialization of rhino classes.
... these classes extend object
outputstream and objectinputstream respectively.
... writing an object to a file can be done in a few lines of java code: file
outputstream fos = new file
outputstream(filename); scriptable
outputstream out = new scriptable
outputstream(fos, scope); out.writeobject(obj); out.close(); here filename is the file to write to, obj is the object or function to write, and scope is the top-level scope containing obj.
...And 6 more matches
ScriptProcessorNode - Web APIs
the scriptprocessornode interface is an audionode audio-processing module that is linked to two buffers, one containing the input audio data, one containing the processed
output audio data.
... an event, implementing the audioprocessingevent interface, is sent to the object each time the input buffer contains new data, and the event handler terminates when it has filled the
output buffer with data.
... the size of the input and
output buffer are defined at the creation time, when the audiocontext.createscriptprocessor() method is called (both are defined by audiocontext.createscriptprocessor()'s buffersize parameter).
...And 6 more matches
Using media queries - CSS: Cascading Style Sheets
media features media features describe specific characteristics of the user agent,
output device, or environment.
... aspect-ratio width-to-height aspect ratio of the viewport color number of bits per color component of the
output device, or zero if the device isn't color color-gamut approximate range of colors that are supported by the user agent and
output device added in media queries level 4.
... color-index number of entries in the
output device's color lookup table, or zero if the device does not use such a table device-aspect-ratio width-to-height aspect ratio of the
output device deprecated in media queries level 4.
...And 6 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
running this code should produce the
output "58 55 4c" so you can check your results.
...
outputting binary files listing 14 shows the opposite operation, taking a string of bytes and
outputting them as a binary file.
... here, we're
outputting a text file consisting of the ascii characters "xul." when we initialized nsifileinputstream, we set the second and third parameters to initialize it in write-only mode.
...And 5 more matches
Index - Archive of obsolete content
ading and downloading files | working with directories ] 432 working with directories file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] 433 writing to files to write to a file, an
output stream is used.
... an
output stream is an object which can be used to write bytes, strings and other values to a file.
... to create an
output stream, use nsiscriptableio.new
outputstream().
...And 5 more matches
RDF Modifications - Archive of obsolete content
« previousnext » one of the most useful aspects of using templates with rdf datasources is that when the rdf datasource changes, for instance a new triple is added, or a triple is removed, the template updates accordingly, adding or removing result
output as needed.
...if the triple wouldn't cause any change in the
output, the builder won't make any changes.
... if the
output would change, the builder will need to adjust the
output, either by adding a new result, removing an old result, or by changing the value of some part of the result.
...And 5 more matches
XForms Custom Controls - Archive of obsolete content
purpose you are in the right place if you would like to create your own custom renderings of the xforms controls like input,
output, trigger, etc.
...xf|
output[mediatype^="image"] { -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-
output-mediatype-anyuri'); } custom data types if you define a new schema data type or you use a built-in data type and find the current xforms control for this type to be insufficient, then you should write a new custom control.
...for example, every
output control implementation extends the base binding xforms.xml#xformswidget-
output-base.
...And 5 more matches
HTTP Cache
the response payload) to write to the cache entry, it must open the
output stream on it before it calls metadataready.
... when the writer still keeps the cache entry and has open and keeps open the
output stream on it, other consumers may open input streams on the entry.
... the data will be available as the writer writes data to the cache entry's
output stream immediately, even before the
output stream is closed.
...And 5 more matches
nsIScriptableIO
le", "cookies.txt"); method overview nsifile getfile(in astring alocation, in astring afilename); nsifile getfilewithpath(in astring afilepath); nsisupports newinputstream(in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize); nsisupports new
outputstream(in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize, [optional] in unsigned long apermissions); nsiuri newuri(in nsivariant auri); methods getfile() retrieves a reference to a file or directory on disk.
... the file does not have to exist already; this method simply creates the file reference which may then be passed to the newinputstream() or new
outputstream() method to open the file for reading or writing.
... new
outputstream() retrieves a stream to which data can be written.
...And 5 more matches
Working with data
example: creating an array of strings var cstr1 = ctypes.jschar.array()('rawr'); var cstr2 = ctypes.jschar.array()('boo'); var mycarray_ofstrings = ctypes.jschar.ptr.array(2)([cstr1, cstr2]); // specifying length of 2 is optional, can omit it, so can just do `ctypes.jschar.ptr.array()([cstr1, cstr2])` mycarray_ofstrings.addressofelement(0).contents.readstring(); //
outputs: "rawr" mycarray_ofstrings.addressofelement(1).contents.readstring(); //
outputs: "boo" example: creating an array of integers var jsarr = [4, 10]; var mycarr = ctypes.int.array(jsarr.length)(jsarr); // specifying length is optional, can omit.
... this will also work: `ctypes.int.array()(jsarr)` mycarr.addressofelement(0).contents; //
outputs: 4 mycarr.addressofelement(1).contents; //
outputs: 10 type casting you can type cast data from one type to another by using the ctypes.cast() function: var newobj = ctypes.cast(origobj, newtype); this will return a new object whose data block is shared with the original object, but whose type is newtype.
... // lets create an array of long's var my = ctypes.long.array()([1, 2, 3, 4]); my.tostring(); // this
outputs to browser console: `"ctypes.long.array(4)([ctypes.int64("1"), ctypes.int64("2"), ctypes.int64("3"), ctypes.int64("4")])"` my.addressofelement(1).contents; // this
outputs `int64 { }` my.addressofelement(1).contents.tostring(); //
outputs: `"2"` // now this is how to get the array of long's cast to array of int's var mycasted = ctypes.cast(my.address(), ctypes.int.array(my.length).ptr).content...
...And 5 more matches
@media - CSS: Cascading Style Sheets
media features media features describe specific characteristics of the user agent,
output device, or environment.
... aspect-ratio width-to-height aspect ratio of the viewport color number of bits per color component of the
output device, or zero if the device isn't color color-gamut approximate range of colors that are supported by the user agent and
output device added in media queries level 4.
... color-index number of entries in the
output device's color lookup table, or zero if the device does not use such a table device-aspect-ratio width-to-height aspect ratio of the
output device deprecated in media queries level 4.
...And 5 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
<div class="name"> alpha background </div> <div id="canvas-bg"></div> <div id="add-axis" class="button"> add line </div> </div> <div id="order"> <div id="gradient-axes"></div> <div id="gradient-order"></div> </div> </div> </div> <div id="
output"> <div class="css-property"> <span class="property">background:</span> <span class="value"></span> </div> </div> </div> css content /* * color picker tool */ .ui-color-picker { width: 420px; margin: 0; border: 1px solid #ddd; background-color: #fff; display: table; -moz-user-select: none; -webkit-user-select: none; ...
...rgin: 5px 0 0 0; overflow: visible; background-color: #ccc; position: relative; } #gradient-order:before { content: "gradient order - drag to order"; position: absolute; top: 100%; color: #ccc; } #gradient-order:after { content: ""; width: 24px; height: 24px; background: url('images/arrow.svg'); background-size: 24px 24px; position: absolute; right: -10px; top: -9.5px; } /** *
output */ #
output { width: 100%; padding: 10px 0; margin: 20px 0 50px 0; border: 2px dashed #ccc; border-radius: 5px; display: table; font-size: 13px; overflow: hidden; -moz-user-select: text; -webkit-user-select: text; -ms-user-select: text; user-select: text; } #
output .css-property { width: 90%; margin: 5px 5%; color: #777; position: relative; float: left; } #
output .property { ...
... height: 100%; width: 12%; position: absolute; left: 0; } #
output .value { width: 88%; position: absolute; white-space: pre; word-wrap: break-word; display: block; right: 0; } javascript content var uicolorpicker = (function uicolorpicker() { 'use strict'; function getelembyid(id) { return document.getelementbyid(id); } var subscribers = []; var pickers = []; /** * rgba color class * * hsv/hsb and hsl (hue, saturation, value / brightness, lightness) * @param hue 0-360 * @param saturation 0-100 * @param value 0-100 * @param lightness 0-100 */ function color(color) { if(color instanceof color === true) { this.copy(color); return; } this.r = 0; this.g = 0; this.b = 0; this.a = 1; this.hue = 0; this.saturation = 0; this.valu...
...And 5 more matches
Web video codec guide - Web media technologies
effect of source video format on encoded
output the degree to which the format of the source video will affect the
output varies depending on the codec and how it works.
...however, things such as frame rate and, obviously, resolution will always have an impact on the
output size of the media.
...for this and other reasons, the more motion there is in a video, the larger the
output file will typically be.
...And 5 more matches
Rule Compilation - Archive of obsolete content
this will return a table of result records which are then used to generate
output.
...the job of the query is to generate a set of
output results.
...this way, different kinds of
output can be created based on the specifics of the result.
...And 4 more matches
Mozilla XForms User Interface - Archive of obsolete content
when a xf:
output binds to a node that has a type of xsd:date, we
output the date value as plain text.
... an
output bound to a date and also having @appearance='full' will display as a calendar.
...
output serves to show the instance data that the element is bound to in a read-only manner (see the spec).
...And 4 more matches
Useful string methods - Learn web development
all you need to do in each case is write the code that will
output the strings in the format that we want them in.
... playable code <h2>live
output</h2> <div class="
output" style="min-height: 125px;"> <ul> </ul> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="playable-code" style="height: 290px; width: 95%"> const list = document.queryselector('.
output ul'); list.innerhtml = ''; let greetings = ['happy birthday!', ...
... jssolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); const jssolution = 'const list = document.queryselector(\'.
output ul\');' + '\nlist.innerhtml = \'\';' + '\nlet greetings = [\'happy birthday!\',' + '\n \'merry christmas my love\',' + '\n \'a happy christmas to all the family\',' + '\n \'you\\\'re all i want for christmas\',' + '\n \'get well soon\'];' + '\n' + '\nfor (let i = 0; i < greetings.length; i++) {' + '\n let input = greetings[i];' + '\...
...And 4 more matches
Introduction to automated testing - Learn web development
the second pipe() function writes the
output html file to the build directory.
... in the input version of the file, you may have noticed that we put an empty <p> element; htmltidy has removed this by the time the
output file has been created.
...dd the following test to the bottom of gulpfile.js: function css(cb) { return gulp.src('src/style.css') .pipe(csslint()) .pipe(csslint.formatter('compact')) .pipe(autoprefixer({ browsers: ['last 5 versions'], cascade: false })) .pipe(gulp.dest('build')); cb(); } here we grab our style.css file, run csslint on it (which
outputs a list of any errors in your css to the terminal), then runs it through autoprefixer to add any prefixes needed to make nascent css features run in older browsers.
...And 4 more matches
Gecko Logging
mozilla logging macros moz_log(module, level, message)
outputs the given message if the module has the given log level enabled.
... message - a printf-style message to
output.
... level - the
output level of the message.
...And 4 more matches
NetUtil.jsm
method overview nsiasyncstreamcopier asynccopy(nsiinputstream asource, nsi
outputstream asink, [optional] acallback) void asyncfetch(asource, acallback) nsichannel newchannel(awhattoload, [optional] aorigincharset, [optional] nsiuri abaseuri) nsiuri newuri(atarget, [optional] aorigincharset, [optional] nsiuri abaseuri) string readinputstreamtostring(ainputstream, acount, aoptions) attributes attribute type description ...
... methods asynccopy() the asynccopy() method performs a simple asynchronous copy of data from a source input stream to a destination
output stream.
... asink the
output stream to which to copy the data.
...And 4 more matches
nsIPipe
xpcom/io/nsipipe.idlscriptable this interface represents an in-process buffer that can be read using nsiinputstream and written using nsi
outputstream.
... inherits from: nsisupports last changed in gecko 1.6 method overview void init(in boolean nonblockinginput, in boolean nonblocking
output, in unsigned long segmentsize, in unsigned long segmentcount, in nsimemory segmentallocator); attributes attribute type description inputstream nsiasyncinputstream the pipe's input end, which also implements nsisearchableinputstream.
...
outputstream nsiasync
outputstream the pipe's
output end.
...And 4 more matches
AudioWorkletProcessor() - Web APIs
numberof
outputs optional the value to initialize the numberof
outputs property to.
...
outputchannelcount optional an array defining the number of channels for each
output.
... for example,
outputchannelcount: [n, m] specifies the number of channels in the first
output to be n and the second
output to be m.
...And 4 more matches
BaseAudioContext.createScriptProcessor() - Web APIs
syntax var scriptprocessor = audioctx.createscriptprocessor(buffersize, numberofinputchannels, numberof
outputchannels); parameters buffersize the buffer size in units of sample-frames.
... numberof
outputchannels integer specifying the number of channels for this node's
output, defaults to 2.
... note: it is invalid for both numberofinputchannels and numberof
outputchannels to be zero.
...And 4 more matches
BiquadFilterNode.getFrequencyResponse() - Web APIs
the two
output arrays, magresponse
output and phaseresponse
output, must be created before calling this method; they must be the same size as the array of input frequency values (frequencyarray).
... syntax biquadfilternode.getfrequencyresponse(frequencyarray, magresponse
output, phaseresponse
output); parameters frequencyarray a float32array containing an array of frequencies, specified in hertz, which you want to filter.
... magresponse
output a float32array to receive the computed magnitudes of the freqency response for each frequency value in the frequencyarray.
...And 4 more matches
console.assert() - Web APIs
objn a list of javascript objects to
output.
... the string representations of each of these objects are appended together in the order listed and
output.
...this parameter gives you additional control over the format of the
output.
...And 4 more matches
Using microtasks in JavaScript with queueMicrotask() - Web APIs
html <pre id="log"> </pre> javascript the code below is used to log the
output.
...this call is bracketed by calls to log(), a custom function that simply
outputs text to the screen.
... html <pre id="log"> </pre> javascript the code below is used to log the
output.
...And 4 more matches
IIRFilterNode.getFrequencyResponse() - Web APIs
the two
output arrays, magresponse
output and phaseresponse
output, must be created before calling this method; they must be the same size as the array of input frequency values (frequencyarray).
... syntax iirfilternode.getfrequencyresponse(frequencyarray, magresponse
output, phaseresponse
output); parameters frequencyarray a float32array containing an array of frequencies, specified in hertz, which you want to filter.
... magresponse
output a float32array to receive the computed magnitudes of the freqency response for each frequency value in the frequencyarray.
...And 4 more matches
TextEncoder.prototype.encodeInto() - Web APIs
encode into a specific position encoder.encodeinto always puts its
output at the start of the array.
... however, it is sometimes useful to make the
output start at a particular index.
...u8array.subarray(position|0) : u8array); } var u8array = new uint8array(8); encodeintoatposition("hello", u8array, 2); console.log( "" + u8array.join() ); // 0,0,104,101,108,108,111,0 buffer sizing to convert a javascript string s, the
output space needed for full conversion is never less than s.length bytes and never greater than s.length * 3 bytes.
...And 4 more matches
Border-image generator - CSS: Cascading Style Sheets
" data-min="10" data-max="10000" data-sensivity="3"></div> </div> <div class="property"> <div class="ui-input-slider" data-topic="preview-height" data-info="height" data-unit=" px" data-min="10" data-max="10000" data-sensivity="3"> </div> </div> </div> <div id="
output" class="category"> <div class="title"> css code </div> <div class="css-property"> <span class="name"> border-image-slice: </span> <span id="out-border-slice" class="value"> </span> </div> <div class="css-property"> <span class="name"> border-image-width: </span> ...
...ight: 16px; background: url('https://mdn.mozillademos.org/files/6019/close.png') no-repeat center center; background-size: 75%; position: absolute; top: 4px; right: 4px; opacity: 0.5; } #unit-settings .close:hover { cursor: pointer; opacity: 1; } #unit-settings[data-active='true'] { opacity: 1; } #unit-settings[data-active='false'] { opacity: 0; top: -100px !important; } /* * css
output code */ #
output { padding: 10px; border: 2px dashed #888 !important; box-shadow: none !important; border-radius: 3px; overflow: hidden; -moz-user-select: text; -webkit-user-select: text; -ms-user-select: text; user-select: text; } @media (min-width: 880px) { #
output { width: 63.33% !important; } } @media (max-width: 879px) { #
output { width: 87% !important; } } #
output .t...
...itle { width: 100%; height: 30px; margin: 0 0 10px 0; line-height: 25px; text-align: center; color: #aaa; } #
output .css-property { width: 100%; margin: 0; color: #555; font-size: 14px; line-height: 18px; float: left; } #
output .css-property .name { width: 30%; font-weight: bold; text-align: right; float: left; } #
output .css-property .value { width: 65%; padding: 0 2.5%; word-break: break-all; float: left; } javascript content 'use strict'; /** * ui-slidersmanager */ var inputslidermanager = (function inputslidermanager() { var subscribers = {}; var sliders = []; var inputcomponent = function inputcomponent(obj) { var input = document.createelement('input'); input.setattribute('type', 'text'); input.style.width = 50 + obj.precision * 10 + 'px'; inpu...
...And 4 more matches
Content categories - Developer guides
<bdi>, <blockquote>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <data>, <datalist>, <del>, <details>, <dfn>, <div>, <dl>, <em>, <embed>, <fieldset>, <figure>, <footer>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <header>, <hgroup>, <hr>, <i>, <iframe>, <img>, <input>, <ins>, <kbd>, <keygen>, <label>, <main>, <map>, <mark>, <math>, <menu>, <meter>, <nav>, <noscript>, <object>, <ol>, <
output>, <p>, <picture>, <pre>, <progress>, <q>, <ruby>, <s>, <samp>, <script>, <section>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <table>, <template>, <textarea>, <time>, <ul>, <var>, <video>, <wbr> and text.
... elements belonging to this category are <abbr>, <audio>, <b>, <bdo>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <data>, <datalist>, <dfn>, <em>, <embed>, <i>, <iframe>, <img>, <input>, <kbd>, <keygen>, <label>, <mark>, <math>, <meter>, <noscript>, <object>, <
output>, <picture>, <progress>, <q>, <ruby>, <samp>, <script>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <textarea>, <time>, <var>, <video>, <wbr> and plain text (not only consisting of white spaces characters).
... <button> <fieldset> <input> <keygen> <label> <meter> <object> <
output> <progress> <select> <textarea> this category contains several sub-categories: listed elements that are listed in the form.elements and fieldset.elements idl collections.
...And 4 more matches
Web audio codec guide - Web media technologies
factors affecting the encoded audio there are two general categories of factors that affect the encoded audio which is
output by an audio codec's encoder: details about the source audio's format and contents, and the codec and its configuration during the encoding process.
... the effect of source audio format on encoded audio
output because encoded audio inherently uses fewer bits to represent each sample, the source audio format may actually have less impact on the encoded audio size than one might expect.
...for example, if the encoder is configured to reduce the sample rate, the sample rate's effect on the
output file will be reduced in kind.
...And 4 more matches
Compiling a New C/C++ Module to WebAssembly - WebAssembly
stdio.h> int main(int argc, char ** argv) { printf("hello world\n"); } now, using the terminal window you used to enter the emscripten compiler environment, navigate to the same directory as your hello.c file, and run the following command: emcc hello.c -s wasm=1 -o hello.html the options we’ve passed in with the command are as follows: -s wasm=1 — specifies that we want wasm
output.
... if we don’t specify this, emscripten will just
output asm.js, as it does by default.
... at this point in your source directory you should have: the binary wasm module code (hello.wasm) a javascript file containing glue code to translate between the native c functions, and javascript/wasm (hello.js) an html file to load, compile, and instantiate your wasm code, and display its
output in the browser (hello.html) running your example now all that remains is for you to load the resulting hello.html in a browser that supports webassembly.
...And 4 more matches
Developing for Firefox Mobile - Archive of obsolete content
then type: adb devices you should see some
output like: list of devices attached 51800f220f01564 device (the long hex string will be different.) if you do, then adb has found your device and you can get started.
... this will be followed by lots of debug
output.
... console.log()
output from your add-on is written to the command shell, just as it is in desktop development.
...And 3 more matches
Introducing the Audio API extension - Archive of obsolete content
for example: // create a new audio element var audio
output = new audio(); // set up audio element with 2 channel, 44.1khz audio stream.
... audio
output.mozsetup(2, 44100); once this is done, the samples need to be created.
...you can see an example below: // write samples using a js array var samples = [0.242, 0.127, 0.0, -0.058, -0.242, ...]; var numbersampleswritten = audio
output.mozwriteaudio(samples); // write samples using a typed array var samples = new float32array([0.242, 0.127, 0.0, -0.058, -0.242, ...]); var numbersampleswritten = audio
output.mozwriteaudio(samples); in the following example, we create an audio pulse: <!doctype html> <html> <head> <title>generating audio in real time</title> <script type="text/javascript"> function playtone() { ...
...And 3 more matches
Explaining basic 3D theory - Game development
rendering pipeline the rendering pipeline is the process by which images are prepared and
output onto the screen.
... vertex and fragment processing are programmable — you can write your own shaders that manipulate the
output.
... the last step is viewport transformation, which involves
outputting everything for the next step in the rendering pipeline.
...And 3 more matches
Styling lists - Learn web development
the following example: <ol start="4"> <li>toast pita, leave to cool, then slice down the edge.</li> <li>fry the halloumi in a shallow, non-stick pan, until browned on both sides.</li> <li>wash and chop the salad.</li> <li>fill pita with salad, hummus, and fried halloumi.</li> </ol> gives you this
output: reversed the reversed attribute will start the list counting down instead of up.
... the following example: <ol start="4" reversed> <li>toast pita, leave to cool, then slice down the edge.</li> <li>fry the halloumi in a shallow, non-stick pan, until browned on both sides.</li> <li>wash and chop the salad.</li> <li>fill pita with salad, hummus, and fried halloumi.</li> </ol> gives you this
output: note: if there are more list items in a reversed list than the value of the start attribute, the count will continue to zero and then into negative values.
...the following example: <ol> <li value="2">toast pita, leave to cool, then slice down the edge.</li> <li value="4">fry the halloumi in a shallow, non-stick pan, until browned on both sides.</li> <li value="6">wash and chop the salad.</li> <li value="8">fill pita with salad, hummus, and fried halloumi.</li> </ol> gives you this
output: note: even if you are using a non-number list-style-type, you still need to use the equivalent numerical values in the value attribute.
...And 3 more matches
The HTML5 input types - Learn web development
first of all, the basic html: <label for="price">choose a maximum house price: </label> <input type="range" name="price" id="price" min="50000" max="500000" step="100" value="250000"> <
output class="price-
output" for="price"></
output> this example creates a slider whose value may range between 50000 and 500000, which increments/decrements by 100 at a time.
...this is why we've included an <
output> element — to contain the current value (we'll also look at this element in the next article).
... you could display an input value or the
output of a calculation inside any element, but <
output> is special — like <label>, it can take a for attribute that allows you to associate it with the element or elements that the
output value came from.
...And 3 more matches
Creating reftest-based unit tests
automated testing usually compares
output against an invariant, a "gold standard", that is determined to be correct.
... the re-direct and the grep reduce the amount of excess
output from the browser.
... if you built a debug version of the browser, there can be a lot of extra console
output.
...And 3 more matches
How Mozilla's build system works
the primary
output of the configure script is an executable file in the object directory called config.status.
... config.status contains 2 parts: data structures representing the
output of configure and a command-line interface for preparing, configuring, or generating an appropriate build backend.
... when config.status runs, you'll see the following
output: reticulating splines...
...And 3 more matches
Eclipse CDT
for this to work reliably though, you still need to build using slow -j1 -w builds, so that make
outputs non-interleaved "entering"/"leaving" lines.
... it also used to be necessary to add the following two lines to your mozconfig to make the compiler
output errors all on a single line, but that may not be needed anymore: export cflags="-fmessage-length=0" export cppflags="-fmessage-length=0" debugging to create a debug configuration, open the project properties window, and select "run/debug settings" on the left.
... this "parse once" strategy can also cause "unresolved inclusion" errors in headers if the first time eclipse sees the header is while indexing a file for which it doesn't have any build
output parser data.
...And 3 more matches
mach
if you don't use mach, you have to find another solution for the following problems: discovering what commands or make targets are available (mach exposes everything through mach help while inside "mozilla-central" , else you'll just get a cryptic error message) making more sense out of command
output (mach offers terminal colorization and structured logging) getting productive tools in the hands of others (mach "advertises" tools to people through mach help (unless it actually just gives you a cryptic error message) - in the former case, people don't need to discover your tool from a blog post, wiki page, or word of mouth).
... failed commands spew lots of extra error
output, e.g.
... mach will print timings with each line of
output from the build.
...And 3 more matches
TraceMalloc
try running with the unified
output format option, -u.
... the
output is a large html file that hyperlinks ancestor and descendent libraries, classes, and functions that call into one another, attributing malloc blame up and down each graph.
...this file can be post-processed by tools in mozilla/tools/trace-malloc as follows: histogram.pl, which produces a type histogram that can be diffed with histogram-diff.sh to produce
output that looks like this: ---- base ---- ---- incr ---- ----- difference ---- type count bytes count bytes count bytes %total total 48942 4754774 76136 6566453 27194 1811679 100.00 nstokenallocator 17 110007 60 388260 43 278253 15.36 nsimagegtk 476 2197708 341 2366564 -135 168856 9.32 ...
...And 3 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
nss sample code 6: encryption/decryption and mac and
output public as a pkcs 11 csr.
... generates encryption/mac keys and
outputs public key as pkcs11 certificate signing request /* this source code form is subject to the terms of the mozilla public * license, v.
... fprintf(stderr, "%-30s - noise file name [optional]\n\n", "-z <noisefilename>"); fprintf(stderr, "%-30s - input file name\n\n", "-i <ipfilename>"); fprintf(stderr, "%-30s - header file name\n\n", "-b <headerfilename>"); fprintf(stderr, "%-30s - encrypt file name\n\n", "-e <encryptfilename>"); fprintf(stderr, "%-30s -
output file name\n\n", "-o <opfilename>"); fprintf(stderr, "%-30s - certificate serial number\n\n", "-m <serialnumber>"); fprintf(stderr, "%-30s - certificate nickname\n\n", "-n <nickname>"); fprintf(stderr, "%-30s - certificate trust\n\n", "-t <trustargs>"); fprintf(stderr, "%-30s - certificate issuer nickname\n\n", ...
...And 3 more matches
Encrypt Decrypt_MAC_Using Token
"-d "); fprintf(stderr, "%-20s specify db password [optional]\n\n", "-p "); fprintf(stderr, "%-20s specify db password file [optional]\n\n", "-f "); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z "); fprintf(stderr, "%-21s specify an input file name\n\n", "-i "); fprintf(stderr, "%-21s specify an
output file name\n\n", "-o "); fprintf(stderr, "%-7s for encrypt, it takes as an input file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate
output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final outpu...
... */ infile = pr_open(encryptedfilename, pr_rdonly , 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* open the
output file.
... * open
output file.
...And 3 more matches
NSS Sample Code Sample_3_Basic Encryption and MACing
cify db password [optional]\n\n", "-p <dbpwd>"); fprintf(stderr, "%-20s specify db password file [optional]\n\n", "-f <dbpwdfile>"); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z <noisefilename>"); fprintf(stderr, "%-21s specify an input file name\n\n", "-i <ipfilename>"); fprintf(stderr, "%-21s specify an
output file name\n\n", "-o <opfilename>"); fprintf(stderr, "%-7s for encrypt, it takes <ipfilename> as an input file and produces\n", "note :"); fprintf(stderr, "%-7s <ipfilename>.enc and <ipfilename>.header as intermediate
output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes <ipfilename>.enc and <ipfilename>.header\n", "");...
... fprintf(stderr, "%-7s as input files and produces <opfilename> as a final
output file.\n\n", ""); exit(-1); } /* this source code form is subject to the terms of the mozilla public * license, v.
... */ infile = pr_open(encryptedfilename, pr_rdonly , 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* open the
output file.
...And 3 more matches
nss tech note2
using the pkcs #11 module logger nss technical note: 2 modes of operation extracting
output from log files the logger displays all activity between nss and a specified pkcs #11 module.
...to enable this mode, set: nspr_log_modules=nss_mod_log:1 nspr_log_file=<logfile> the
output format is: osthreadid[nsprthreadid]: c_xxx osthreadid[nsprthreadid]: rv = 0xyyyyyyyy for example, 1024[805ef10]: c_initialize 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getinfo 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getslotlist 1024[805ef10]: rv = 0x0 2.
...to enable this mode, set: nspr_log_modules=nss_mod_log:3 nspr_log_file=<logfile> the
output format is: osthreadid[nsprthreadid]: c_xxx osthreadid[nsprthreadid]: arg1 = 0xaaaaaaaa ...
...And 3 more matches
Rhino shell
output - the process
output instead of java.lang.system.out.
... if it is not instance of java.io.
outputstream, the process
output is read, converted to a string, appended to the
output property value converted to string and put as the new value of the
output property.
... err - the process error
output instead of java.lang.system.err.
...And 3 more matches
Hacking Tips
be aware that functions which are usually dumping some
output will do it in the shell where valgrind is started and not in the shell where gdb is started.
... thus functions such as js::dumpbacktrace, when called from gdb, will print their
output in the shell containing valgrind.
... $ valgrind --tool=callgrind --callgrind-out-file=bench.clg \ --smc-check=all-non-file --vex-iropt-register-updates=allregs-at-mem-access ./js ./run.js the
output file can then be use with kcachegrind which provides a graphical view of the call graph.
...And 3 more matches
imgIEncoder
pruint32 stride, in pruint32 frameformat, in astring frameoptions); void encodeclipboardimage(in nsiclipboardimage aclipboardimage, out nsifile aimagefile); obsolete since gecko 1.9 void endimageencode(); void initfromdata([array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 inputformat, in astring
outputoptions); void startimageencode(in pruint32 width, in pruint32 height, in pruint32 inputformat, in astring
outputoptions); constants possible values for input format (note that not all image formats support saving alpha channels): constant value description input_format_rgb 0 input is rgb each pixel is represented by three bytes: r, g, and b (in that order, regardless of host endiannes...
... us used (for example 50% transparent red is 0xff000080) input_format_hostargb 2 input is host-endian argb: on big-endian machines each pixel is therefore argb, and for little-endian machiens (intel) each pixel is bgra (this is used by canvas to match it's internal representation) pre-multiplied alpha is used (that is, 50% transparent red is 0x80800000, not 0x80ff0000) possible values for
outputoptions.
...initfromdata() void initfromdata( [array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 inputformat, in astring
outputoptions ); parameters data list of bytes in the format specified by inputformat.
...And 3 more matches
nsICacheEntryDescriptor
inherits from: nsicacheentryinfo last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void close(); void doom(); void doomandfailpendingrequests(in nsresult status); string getmetadataelement(in string key); void markvalid(); nsiinputstream openinputstream(in unsigned long offset); nsi
outputstream open
outputstream(in unsigned long offset); void setdatasize(in unsigned long size); void setexpirationtime(in pruint32 expirationtime); void setmetadataelement(in string key, in string value); void visitmetadata(in nsicachemetadatavisitor visitor); attributes attribute type description accessgranted nscacheaccessmode get the access granted to this descriptor.
...open
outputstream() this method opens blocking
output stream to cache data.
...if opening an
output stream to existing cached data, the data will be truncated to the specified offset.
...And 3 more matches
AudioProcessingEvent - Web APIs
outputbuffer read only audiobuffer the buffer where the
output audio data should be written.
... the number of channels is defined as a parameter, numberof
outputchannels, of the factory method audiocontext.createscriptprocessor().
...for each channel and each sample frame, the scriptnode.onaudioprocess function takes the associated audioprocessingevent and uses it to loop through each channel of the input buffer, and each sample in each channel, and add a small amount of white noise, before setting that result to be the
output sample in each case.
...And 3 more matches
AudioWorkletNode() - Web APIs
numberof
outputs optional the value to initialize the numberof
outputs property to.
...
outputchannelcount optional an array defining the number of channels for each
output.
... for example,
outputchannelcount: [n, m] specifies the number of channels in the first
output to be n and the second
output to be m.
...And 3 more matches
AudioWorkletProcessor - Web APIs
this method gets called for each block of 128 sample-frames and takes input and
output arrays and calculated values of custom audioparams (if they are defined) as parameters.
... you can use inputs and audio parameter values to fill the
outputs array, which by default holds silence.
...their calculated values will be passed into the process() method of the processor for you to shape the node
output accordingly.
...And 3 more matches
console.debug() - Web APIs
the console method debug()
outputs a message to the web console at the "debug" log level.
... the message is only displayed to the user if the console is configured to display debug
output.
...objn a list of javascript objects to
output.
...And 3 more matches
msAudioDeviceType - Web APIs
msaudiodevicetype specifies the
output device id that the audio will be sent to.
... syntax <audio src="sound.mp3" msaudiodevicetype="communications" /> by default, audio on your system will
output to your default speakers and be considered a foreground element, meaning that the audio will play only when the element is active in the app.
... for real-time communications, you can use the msaudiodevicetype property with the value console, multimedia, or communications to specify where the current audio should
output.
...And 3 more matches
MediaDevices.ondevicechange - Web APIs
it displays in the browser window two lists: one of audio devices and one of video devices, with both the device's label (name) and whether it's an input or an
output device.
... function updatedevicelist() { navigator.mediadevices.enumeratedevices() .then(function(devices) { audiolist.innerhtml = ""; videolist.innerhtml = ""; devices.foreach(function(device) { let elem = document.createelement("li"); let [kind, type, direction] = device.kind.match(/(\w+)(input|
output)/i); elem.innerhtml = "<strong>" + device.label + "</strong> (" + direction + ")"; if (type === "audio") { audiolist.appendchild(elem); } else if (type === "video") { videolist.appendchild(elem); } }); }); } updatedevicelist() consists entirely of a call to the function enumeratedevices() on the mediadevices object referenced in the navigator.mediad...
...the list is passed into the fulfillment handler as an array of mediadeviceinfo objects, each describing one media input or
output device.
...And 3 more matches
Using Navigation Timing - Web APIs
for example, to measure the perceived loading time for a page: window.addeventlistener("load", function() { let now = new date().gettime(); let loadingtime = now - performance.timing.navigationstart; document.queryselector(".
output").innertext = loadingtime + " ms"; }, false); this code, executed when the load event occurs, subtracts from the current time the time at which the navigation whose timing was recorded began (performance.timing.navigationstart), and
outputs that information to the screen by inserting it into an element.
... html <div class="
output"> </div> css .
output { border: 1px solid #bbb; font: 16px "open sans", "helvetica", "arial", sans-serif; } in tandem with appropriate html and css, the result is: the values listed are for the <iframe> in which the sample is presented above.
...the new code looks like this: window.addeventlistener("load", function() { let now = new date().gettime(); let loadingtime = now - performance.timing.navigationstart;
output = "load time: " + loadingtime + " ms<br/>";
output += "navigation type: "; switch(performance.navigation.type) { case performancenavigation.type_navigate:
output += "navigation"; break; case performancenavigation.type_reload:
output += "reload"; break; case performancenavigation.type_back_forward:
output += "history"; break; default...
...And 3 more matches
Using the Web Speech API - Web APIs
we simply have a title, instructions paragraph, and a div into which we
output diagnostic messages.
... <h1>speech color changer</h1> <p>tap/click then say a color to change the background color of the app.</p> <div> <p class="
output"><em>...diagnostic messages</em></p> </div> the css provides a very simple responsive styling so that it looks ok across devices.
...but it is not needed for this simple demo, so we are just specifying one (which is actually the default anyway.) recognition.grammars = speechrecognitionlist; recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; starting the speech recognition after grabbing references to the
output <div> and the html element (so we can
output diagnostic messages and update the app background color later on), we implement an onclick handler so that when the screen is tapped/clicked, the speech recognition service will start.
...And 3 more matches
window.dump() - Web APIs
if the -console option was not specified then the
output goes to stderr.
...
output from dump() is not sent to the browser console.
...
output can be sent to the browser console using console.log().
...And 3 more matches
Border-radius generator - CSS: Cascading Style Sheets
sions"> <div class="ui-input-slider" data-topic="width" data-info="width" data-unit=" px" data-min="150" data-max="700" data-sensivity="1"></div> <div class="ui-input-slider" data-topic="height" data-info="height" data-unit=" px" data-min="75" data-max="350" data-sensivity="1"></div> </div> <div id="
output"></div> </div> <div class="group section"> <div id="radius-lock"> <div class="info"> rounded corner </div> <div class="ui-checkbox" data-topic='top-left'></div> <div class="ui-checkbox" data-topic='top-right'></div> <div class="ui-checkbox" data-topic='bottom-right'></div> <div class="ui-c...
... 10px; } #radius-lock [data-topic="top-right"] { top: 10px; right: 10px; } #radius-lock [data-topic="bottom-right"] { bottom: 10px; right: 10px; } #radius-lock [data-topic="bottom-left"] { bottom: 10px; left: 10px; } /** * controls */ #dimensions { width: 200px; color: #444; float:left; } #dimensions input { background: #555; color: #fff; border: none; border-radius: 3px; } #
output { width: 500px; padding: 10px 0; margin: 10px 0; color: #555; text-align: center; border: 1px dashed #999; border-radius: 3px; -moz-user-select: text; -webkit-user-select: text; -ms-user-select: text; user-select: text; float: right; } javascript content 'use strict'; /** * ui-inputslidermanager */ var inputslidermanager = (function inputslidermanager() { var subscribers ...
...} var unsubscribe = function unsubscribe(callback) { var index = subscribers.indexof(callback); subscribers.splice(index, 1); } var notify = function notify(deltax, deltay) { for (var i in subscribers) subscribers[i](deltax, deltay); } return { init : init, subscribe : subscribe, unsubscribe : unsubscribe } })(); var subject; var units = ['px', '%']; var
output = null; var unitselector = function unitselector(topic) { this.container = document.createelement("div"); this.select = document.createelement("select"); for (var i in units) { var option = document.createelement("option"); option.value = i; option.textcontent = units[i]; this.select.appendchild(option); } this.container.classname = 'dropdown ' + 'unit-' + topic; this.
...And 3 more matches
<easing-function> - CSS: Cascading Style Sheets
they correlate a time ratio to an
output ratio, both expressed as <number>s.
... depending on the specific function used, the calculated
output can sometimes grow to be greater than 1.0 or smaller than 0.0 during the course of an animation.
... however, certain properties will restrict the
output if it goes outside an allowable range.
...And 3 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
html the html here creates a box that contains a color picker control (with a label created using the <label> element) and an empty paragraph element (<p>) into which we'll
output some text from our javascript code.
... <div id="box"> <label for="colorpicker">border color:</label> <input type="color" value="#8888ff" id="colorpicker"> <p id="
output"></p> </div> css the css simply establishes a size for the box and some basic styling for appearances.
... let colorpicker = document.getelementbyid("colorpicker"); let box = document.getelementbyid("box"); let
output = document.getelementbyid("
output"); box.style.bordercolor = colorpicker.value; colorpicker.addeventlistener("input", function(event) { box.style.bordercolor = event.target.value; }, false); colorpicker.addeventlistener("change", function(event) {
output.innertext = "color set to " + colorpicker.value + "."; }, false); the input event is sent every time the value of the element changes; t...
...And 3 more matches
cfx - Archive of obsolete content
cfx supports the following global options: -h, --help - show a help message and exit -v, --verbose - enable lots of
output "command-specific options" are documented alongside the commands.
... --logfile=logfile log console
output to the file specified by logfile.
... --logfile=logfile log console
output to the file specified by logfile.
...And 2 more matches
console - Archive of obsolete content
console.error(object[, object, ...]) logs the arguments to the console, preceded by "error:" and the name of your add-on: console.error("this is an error message"); error: my-addon: this is an error message console.exception(exception) logs the given exception instance as an error,
outputting information about the exception's stack traceback if one is available.
...but the more logging there is, the more noise you see in the console
output.
... for example, if the logging level is set to "info", then calls to info(), log(), warn(), and error() will all result in
output being written.
...And 2 more matches
Running Tamarin performance tests - Archive of obsolete content
performance test options there are a variety of options available with runtests.py - here is the help text followed by explanations for some options: $ ./runtests.py -h usage: runtests.py [options] [tests] -v --verbose enable additional
output -e --avm avmplus command to use -a --asc compiler to use -g --globalabc deprecated but still works - use builtin.abc (used to be location of global.abc) -b --builtinabc location of builtin.abc -s --shellabc location of shell_toplevel.abc -x --exclude comma separated list of directories to skip -h --help display help and exit -t --notime do not...
... generate timestamps (cleaner diffs) -f --forcerebuild force rebuild all test files -c --config sets the config string [default os-tvm] -q --quiet display minimum
output during testrun -l --log also log all
output to given logfile --summaryonly only display final summary --rebuildtests rebuild the tests only - do not run against vm --showtimes shows the time for each test --ascargs args to pass to asc on rebuild of test files --vmargs args to pass to vm --timeout max time to run all tests --testtimeout max time to let a test run, in sec (default -1 = never timeout) --html also create an html
output file --notimecheck do not recompile .abc if timestamp is older than .as --java locatio...
...javaargs arguments to pass to java --random run tests in random order --seed explicitly specify random seed for --random -s --avm2 second avmplus command to use --avmname nickname for avm to use as column header --avm2name nickname for avm2 to use as column header --detail display results in 'old-style' format --raw
output all raw test values -i --iterations number of times to repeat test -l --log logs results to a file -k --socketlog logs results to a socket server -r --runtime name of the runtime vm used, including switch info eg.
...And 2 more matches
Writing textual data - Archive of obsolete content
when writing textual data to an
output stream or to a file, you need to pick a character encoding.
... writing to a stream in gecko 1.8 (seamonkey 1.0, firefox 1.5), you can use nsiconverter
outputstream: var charset = "utf-8"; // can be any character encoding name that mozilla supports var os = components.classes["@mozilla.org/intl/converter-
output-stream;1"] .createinstance(components.interfaces.nsiconverter
outputstream); // this assumes that fos is the nsi
outputstream you want to write to os.init(fos, charset, 0, 0x0000); os.writestring("umlaute: \u00fc \u00e4\n");...
... versions before gecko 1.8 firefox 1.0.x, mozilla 1.7.x and older versions do not support nsiconverter
outputstream.
...And 2 more matches
Using Recursive Templates - Archive of obsolete content
the result is
output like the following: <groupbox> ...
...you could use multiple rules as well, in order to generate different
output for each level.
...the
output for groups is a groupbox with a caption containing the name.
...And 2 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
for example, <p> is by default a block-level element, whereas <a> is an inline element — you can put several links next to one another in your html source and they will sit on the same line as one another in the rendered
output.
... 201 hash codingscripting, cryptography, glossary, hash the hash function takes a variable length message input and produces a fixed-length hash
output.
...it is the software that handles communication between components and input/
output, so developers can focus on the specific purpose of their application.
...And 2 more matches
Test your skills: Conditionals - Learn web development
note: in the examples below, if there is an error in your code it will be
outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
... response — begins uninitialized, but is later used to store a reponse that will be printed to the
output panel.
... response — begins uninitialized, but is later used to store a reponse that will be printed to the
output panel.
...And 2 more matches
Making decisions in your code — conditionals - Learn web development
playable code <h2>live
output</h2> <div class="
output" style="height: 500px;overflow: auto;"> <label for="month">select month: </label> <select id="month"> <option value="january">january</option> <option value="february">february</option> <option value="march">march</option> <option value="april">april</option> <option value="may">may</option> <option value="june">june</option> <option value="...
... list.innerhtml = ''; h1.textcontent = choice; for (let i = 1; i <= days; i++) { const listitem = document.createelement('li'); listitem.textcontent = i; list.appendchild(listitem); } } createcalendar(31,'january'); </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> .
output * { box-sizing: border-box; } .
output ul { padding-left: 0; } .
output li { display: block; float: left; width: 25%; border: 2px solid white; padding: 5px; height: 40px; background-color: #4a2db6; color: white; } html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margi...
... playable code 2 <h2>live
output</h2> <div class="
output" style="height: 300px;"> <label for="theme">select theme: </label> <select id="theme"> <option value="white">white</option> <option value="black">black</option> <option value="purple">purple</option> <option value="yellow">yellow</option> <option value="psychedelic">psychedelic</option> </select> <h1>this is my website</h1> </div> <h2>editable...
...And 2 more matches
Arrays - Learn web development
playable code <h2>live
output</h2> <div class="
output" style="min-height: 150px;"> <ul> </ul> <p></p> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="playable-code" style="height: 410px;width: 95%"> const list = document.queryselector('.
output ul'); const totalbox = document.queryselector('.
output p'); let...
... jssolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); const jssolution = 'const list = document.queryselector(\'.
output ul\');\nconst totalbox = document.queryselector(\'.
output p\');\nlet total = 0;\nlist.innerhtml = \'\';\ntotalbox.textcontent = \'\';\n\nlet products = [\'underpants:6.99\',\n \'socks:5.99\',\n \'t-shirt:14.99\',\n \'trousers:31.99\',\n \'shoes:23.99\'];\n\nfor(let i = 0; i < products.length; i++) {\n let subarray = products[i].split(\':\');\n let name = subarray[0];\n let price = number(s...
... playable code 2 <h2>live
output</h2> <div class="
output" style="min-height: 150px;"> <input type="text"><button>search</button> <ul> </ul> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="playable-code" style="height: 370px; width: 95%"> const list = document.queryselector('.
output ul'); const searchinput = d...
...And 2 more matches
L10n Checks
you pass both paths to the files, e.g.: check-l10n-completeness -i file en-us.dtd my.dtd the
output the
output of l10n checks shows the missing and obsolete strings in a pseudo-diff format.
...the
output closes with a summary, giving the total counts of missing and obsolete strings and some statistics on how many strings are changed or not, excluding access and command keys.
...options reference locale in the source and xpi modes you can change the default reference locale (en-us) by setting the -r parameter, e.g.: check-l10n-completeness -r pl browser/locales/l10n.ini ../l10n/ de
output mode you can change the look and feel of the
output by setting the -o parameter to 0 (tree; default), 1 (full tree) or 2 (full relative paths), e.g.: check-l10n-completeness -o 2 browser/locales/l10n.ini ../l10n/ de en-us in the locale directory in the source mode you can tell l10n checks to look for the en-us locale in the directory containing all other locales instead of the directory containing the source by setting the -l parameter (us...
...And 2 more matches
Localizing without a specialized tool
$ compare-locales mozilla-1.9.2/browser/locales/l10n.ini l10n-mozilla-1.9.2 x-testing for convenience, try saving the
output of this command to a text file on your desktop so you can review it as you go.
...x-testing: unchanged: 2 changed: 3 missinginfiles: 6117 missing: 13 0% of entries changed the beauty of the compare-locales
output is that it tells you all the missing files and which files you need to add and localize.
...going one-by-one with your compare-locales
output open for review, we will start with the first file with "// add and localize this file" note.
...And 2 more matches
Encrypt Decrypt MAC Keys As Session Objects
"-d "); fprintf(stderr, "%-20s specify db password [optional]\n\n", "-p "); fprintf(stderr, "%-20s specify db password file [optional]\n\n", "-f "); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z "); fprintf(stderr, "%-21s specify an input file name\n\n", "-i "); fprintf(stderr, "%-21s specify an
output file name\n\n", "-o "); fprintf(stderr, "%-7s for encrypt, it takes as an input file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate
output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final outpu...
... */ infile = pr_open(encryptedfilename, pr_rdonly , 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* open the
output file.
... const char *outfilename, const char *headerfilename, char *encryptedfilename, secupwdata *pwdata, prbool ascii) { /* * the db is open read only and we have authenticated to it * open input file, read in header, get iv and cka_ids of two keys from it * find those keys in the db token * open
output file * loop until eof(input): * read a buffer of ciphertext from input file, * save last block of ciphertext * decrypt ciphertext buffer using cbc and iv, * compute and check mac, then remove mac from plaintext * replace iv with saved last block of ciphertext * write the plain text to
output file * close files * report success ...
...And 2 more matches
Encrypt and decrypt MAC using token
"-d "); fprintf(stderr, "%-20s specify db password [optional]\n\n", "-p "); fprintf(stderr, "%-20s specify db password file [optional]\n\n", "-f "); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z "); fprintf(stderr, "%-21s specify an input file name\n\n", "-i "); fprintf(stderr, "%-21s specify an
output file name\n\n", "-o "); fprintf(stderr, "%-7s for encrypt, it takes as an input file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate
output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final outpu...
... */ infile = pr_open(encryptedfilename, pr_rdonly , 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* open the
output file.
... const char *outfilename, const char *headerfilename, char *encryptedfilename, secupwdata *pwdata, prbool ascii) { /* * the db is open read only and we have authenticated to it * open input file, read in header, get iv and cka_ids of two keys from it * find those keys in the db token * open
output file * loop until eof(input): * read a buffer of ciphertext from input file, * save last block of ciphertext * decrypt ciphertext buffer using cbc and iv, * compute and check mac, then remove mac from plaintext * replace iv with saved last block of ciphertext * write the plain text to
output file * close files * report success ...
...And 2 more matches
EncDecMAC using token object - sample 3
ypt operation\n\n", " "); fprintf(stderr, "%-20s specify db directory path\n\n", "-d "); fprintf(stderr, "%-20s specify db password [optional]\n\n", "-p "); fprintf(stderr, "%-20s specify db password file [optional]\n\n", "-f "); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z "); fprintf(stderr, "%-21s specify an input file name\n\n", "-i "); fprintf(stderr, "%-21s specify an
output file name\n\n", "-o "); fprintf(stderr, "%-7s for encrypt, it takes as an input file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate
output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final
output file.\n\n", ""); exit(-1); } /* * gather a cka_id */ secstatus gathe...
...*/ infile = pr_open(encryptedfilename, pr_rdonly , 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* open the
output file.
...up; } cleanup: return rv; } /* * decryptfile */ secstatus decryptfile(pk11slotinfo *slot, const char *dbdir, const char *outfilename, const char *headerfilename, char *encryptedfilename, secupwdata *pwdata, prbool ascii) { /* * the db is open read only and we have authenticated to it * open input file, read in header, get iv and cka_ids of two keys from it * find those keys in the db token * open
output file * loop until eof(input): * read a buffer of ciphertext from input file, * save last block of ciphertext * decrypt ciphertext buffer using cbc and iv, * compute and check mac, then remove mac from plaintext * replace iv with saved last block of ciphertext * write the plain text to
output file * close files * report success */ secstatus rv; secitem ivitem; secitem enckeyitem; secitem mackeyite...
...And 2 more matches
sslfnc.html
on
output, the integer will be one of these values: ssl_security_status_ off (= 0) ssl_security_status_ on_high (= 1) ssl_security_status_on_low (= 2) cipher a pointer to a string pointer.
... on
output, the string pointer references a newly allocated string specifying the name of the cipher.
...on
output, the integer is the session key size used, in bits.
...And 2 more matches
NSS Tools crlutil
-a use ascii format or allow the use of ascii format for input and
output.
... -o
output-file specify the
output file name for new crl.
... bracket the
output-file string with quotation marks if it contains spaces.
...And 2 more matches
NSS tools : signtool
the higher the level of compression, the smaller the
output but the longer the operation takes.
...in all cases, the certificate is also
output to a file named x509.cacert, which has the mime-type application/x-x509-ca-cert.
... --outfile
outputfile specifies a file to receive redirected
output from netscape signing tool.
...And 2 more matches
NSS tools : signver
synopsis signtool -a | -v -d directory [-a] [-i input_file] [-o
output_file] [-s signature_file] [-v] description the signature verification tool, signver, is a simple command-line utility that unpacks a base-64-encoded pkcs#7 signed object and verifies the digital signature using standard cryptographic techniques.
... -o
output_file gives the
output file to which to write the results.
... -v enables verbose
output.
...And 2 more matches
Index
if quote is not 0, it must be a single or double quote character that will quote the
output.
...returns the length of the written
output, not including the nul.
... thus, a return value of size or more means that the
output was truncated.
...And 2 more matches
nsIFaviconService
amimetype
output parameter where the mime type will be placed.
... adatalen
output parameter where the size of the binary data will be placed.
... adata
output parameter where the binary favicon data will be placed.
...And 2 more matches
XPCOM Interface Reference
cessibletextchangeeventnsiaccessibletreecachensiaccessiblevaluensiaccessiblewin32objectnsialertsservicensiannotationobservernsiannotationservicensiappshellnsiappshellservicensiappstartupnsiappstartup_mozilla_2_0nsiapplicationcachensiapplicationcachechannelnsiapplicationcachecontainernsiapplicationcachenamespacensiapplicationcacheservicensiapplicationupdateservicensiarraynsiasyncinputstreamnsiasync
outputstreamnsiasyncstreamcopiernsiasyncverifyredirectcallbacknsiauthinformationnsiauthmodulensiauthpromptnsiauthprompt2nsiauthpromptadapterfactorynsiauthpromptcallbacknsiauthpromptprovidernsiauthpromptwrappernsiautocompletecontrollernsiautocompleteinputnsiautocompleteitemnsiautocompletelistenernsiautocompleteobservernsiautocompleteresultnsiautocompletesearchnsibadcertlistener2nsibidikeyboardnsibinaryin...
...putstreamnsibinary
outputstreamnsiblocklistpromptnsiblocklistservicensiboxobjectnsibrowserboxobjectnsibrowserhistorynsibrowsersearchservicensicrlinfonsicrlmanagernsicachensicachedeviceinfonsicacheentrydescriptornsicacheentryinfonsicachelistenernsicachemetadatavisitornsicacheservicensicachesessionnsicachevisitornsicachingchannelnsicancelablensicategorymanagernsichannelnsichanneleventsinknsichannelpolicynsicharsetresolvernsichromeframemessagemanagernsichromeregistrynsiclassinfonsiclipboardnsiclipboardcommandsnsiclipboarddragdrophooklistnsiclipboarddragdrophooksnsiclipboardhelpernsiclipboardownernsicollectionnsicommandcontrollernsicommandlinensicommandlinehandlernsicommandlinerunnernsicomponentmanagernsicomponentregistrarnsicompositionstringsynthesizernsiconsolelistenernsiconsolemessagensiconsoleser...
...vicensicontainerboxobjectnsicontentframemessagemanagernsicontentprefnsicontentprefcallback2nsicontentprefobservernsicontentprefservicensicontentprefservice2nsicontentsecuritypolicynsicontentsniffernsicontentviewnsicontentviewmanagernsicontentviewernsicontrollernsicontrollersnsiconverterinputstreamnsiconverter
outputstreamnsicookiensicookie2nsicookieacceptdialognsicookieconsentnsicookiemanagernsicookiemanager2nsicookiepermissionnsicookiepromptservicensicookieservicensicookiestoragensicrashreporternsicryptohmacnsicryptohashnsicurrentcharsetlistenernsicyclecollectorlistenernsidbchangelistenernsidbfolderinfonsidnslistenernsidnsrecordnsidnsrequestnsidnsservicensidomcanvasrenderingcontext2dnsidomchromewindownsidomclientrectnsidomdesktopnotificationnsidomdesktopnotificationcenternsidomelementnsidomevent...
...And 2 more matches
Browser Console - Firefox Developer Tools
input/
output messages: commands send to the browser via the command line, and the result of executing them.
... components.utils.import("resource://gre/modules/console.jsm"); console.log("hello from firefox code"); //
output messages to the console learn more: console api reference console.jsm source code in the mozilla dxr hudservice there is also the hudservice which allows access to the browse console.
... here is an example on how to clear the contents of the browser console: components.utils.import("resource://devtools/shared/loader.jsm"); var hudservice = devtools.require("devtools/client/webconsole/hudservice"); var hud = hudservice.getbrowserconsole(); hud.jsterm.clear
output(true); if you would like to access the content document of the browser console this can be done with the hudservice.
...And 2 more matches
Migrating from Firebug - Firefox Developer Tools
the
output of the call tree is the one that comes nearest to the
output in firebug, but the performance panel provides much more information than just the javascript performance.
... this is the part where firebug and the devtools differ the most, because the
outputs are completely different.
... view javascript call performance what comes nearest to firebug's profiler
output is the call tree view in the performance panel.
...And 2 more matches
Web Console Helpers - Firefox Developer Tools
clear() clears the console
output area.
... inspect() given an object, generates rich
output for that object.
... once you select the object in the
output area, you can use the arrow keys to navigate the object.
...And 2 more matches
AnalyserNode - Web APIs
it is an audionode that passes the audio stream unchanged from the input to the
output, but allows you to take the generated data, process it, and create audio visualizations.
... an analysernode has exactly one input and one
output.
... the node works even if the
output is not connected.
...And 2 more matches
AudioNode.disconnect() - Web APIs
syntax audionode.disconnect(); audionode.disconnect(
output); audionode.disconnect(destination); audionode.disconnect(destination,
output); audionode.disconnect(destination,
output, input); return value undefined parameters there are several versions of the disconnect() method, which accept different combinations of parameters to control which nodes to disconnect from.
...if this value is an audionode, a single node is disconnected from, with any other, optional, parameters (
output and/or input) further limiting which inputs and/or
outputs should be disconnected.
...
output optional an index describing which
output from the current audionode is to be disconnected.
...And 2 more matches
Background Tasks API - Web APIs
this establishes a box (id "container") that's used to present the progress of an operation (because you never know how long decoding "quantum filament tachyon emissions" will take, after all) as well as a second main box (with the id "logbox"), which is used to display textual
output.
... updating the status display one thing we want to be able to do is update our document with log
output and progress information.
...it's a simple function that
outputs a bunch of stuff to the log for each task.
...And 2 more matches
ChannelMergerNode - Web APIs
the channelmergernode interface, often used in conjunction with its opposite, channelsplitternode, reunites different mono inputs into a single
output.
... each input is used to fill a channel of the
output.
... if channelmergernode has one single
output, but as many inputs as there are channels to merge; the number of inputs is defined as a parameter of its constructor and the call to audiocontext.createchannelmerger.
...And 2 more matches
ChannelSplitterNode - Web APIs
the channelsplitternode interface, often used in conjunction with its opposite, channelmergernode, separates the different channels of an audio source into a set of mono
outputs.
... if your channelsplitternode always has one single input, the amount of
outputs is defined by a parameter on its constructor and the call to audiocontext.createchannelsplitter().
...if there are fewer channels in the input than there are
outputs, supernumerary
outputs are silent.
...And 2 more matches
Console.error() - Web APIs
outputs an error message to the web console.
...objn a list of javascript objects to
output.
... the string representations of each of these objects are appended together in the order listed and
output.
...And 2 more matches
Console.info() - Web APIs
the console.info() method
outputs an informational message to the web console.
...objn a list of javascript objects to
output.
... the string representations of each of these objects are appended together in the order listed and
output.
...And 2 more matches
console.log() - Web APIs
the console method log()
outputs a message to the web console.
...objn a list of javascript objects to
output.
... the string representations of each of these objects are appended together in the order listed and
output.
...And 2 more matches
Console.warn() - Web APIs
outputs a warning message to the web console.
...objn a list of javascript objects to
output.
... the string representations of each of these objects are appended together in the order listed and
output.
...And 2 more matches
ConstantSourceNode - Web APIs
the constantsourcenode interface—part of the web audio api—represents an audio source (based upon audioscheduledsourcenode) whose
output is single unchanging value.
... a constantsourcenode has no inputs and exactly one monaural (one-channel)
output.
... the
output's value is always the same as the value of the offset parameter.
...And 2 more matches
MediaStreamAudioSourceNode - Web APIs
a mediastreamaudiosourcenode has no inputs and exactly one
output, and is created using the audiocontext.createmediastreamsource() method.
... the number of channels
output by the node matches the number of tracks found in the selected audio track.
... number of inputs 0 number of
outputs 1 channel count defined by the first audio mediastreamtrack passed to the audiocontext.createmediastreamsource() method that created it.
...And 2 more matches
Recording a media element - Web APIs
note that the autoplay attribute is used so that as soon as the stream starts to arrive from the camera, it immediately gets displayed, and the muted attribute is specified to ensure that the sound from the user's microphone isn't
output to their speakers, causing an ugly feedback loop.
... function log(msg) { logelement.innerhtml += msg + "\n"; } the log() function is used to
output text strings to a <div> so we can share information with the user.
... lines 6-7 starts the recording process by calling recorder.start(), and
outputs a message to the log with the updated state of the recorder and the number of seconds it will be recording.
...And 2 more matches
PublicKeyCredentialCreationOptions.extensions - Web APIs
if true, the client
outputs an array of strings containing the extensions which are supported by the authenticator.
...if true, the client
outputs an arraybuffer which contains a value uniquely identifying a user verification data record.
...if true, the client
outputs a coordinates object representing the geolocation of the authenticator.
...And 2 more matches
PublicKeyCredentialRequestOptions.extensions - Web APIs
the client
outputs a usvstring which is the text as it was displayed (line breaks may have been added).
...the client
outputs the hash of the content which was displayed (hashing with the same algorithm which is used for the signature).
...if true, the client
outputs an arraybuffer which contains a value uniquely identifying a user verification data record.
...And 2 more matches
RTCDataChannel: error event - Web APIs
error information is
output to the console using console.error().
... the message string is always
output, as is information about the source file's name, line number, and column number at which the error occurred.
... in addition, however, depending on the value of errordetail, additional information may be
output.
...And 2 more matches
Using the Screen Capture API - Web APIs
setup first, some constants are set up to reference the elements on the page to which we'll need access: the <video> into which the captured screen contents will be streamed, a box into which logged
output will be drawn, and the start and stop buttons that will turn on and off capture of screen imagery.
...options = { video: { cursor: "always" }, audio: false }; // set event listeners for the start and stop buttons startelem.addeventlistener("click", function(evt) { startcapture(); }, false); stopelem.addeventlistener("click", function(evt) { stopcapture(); }, false); logging content to make logging of errors and other issues easy, this example overrides certain console methods to
output their messages to the <pre> block whose id is log.
... if any of that fails, the catch() clause
outputs an error message to the log box.
...And 2 more matches
ScriptProcessorNode.bufferSize - Web APIs
the buffersize property of the scriptprocessornode interface returns an integer representing both the input and
output buffer size, in sample-frames.
...for each channel and each sample frame, the scriptnode.onaudioprocess function takes the associated audioprocessingevent and uses it to loop through each channel of the input buffer, and each sample in each channel, and add a small amount of white noise, before setting that result to be the
output sample in each case.
...processor-node github repo (also view the source code.) var myscript = document.queryselector('script'); var mypre = document.queryselector('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and
output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(a...
...And 2 more matches
SubtleCrypto.digest() - Web APIs
supported algorithms digest algorithms, also known as cryptographic hash functions, transform an arbitrarily large block of data into a fixed-size
output, usually much shorter than the input.
... sha-1 this algorithm is specified in fips 180-4, section 6.1, and produces an
output 160 bits long.
... sha-256 this algorithm is specified in fips 180-4, section 6.2, and produces an
output 256 bits long.
...And 2 more matches
Using DTMF with WebRTC - Web APIs
initialization when the page loads, we do some basic setup: we fetch references to the dial button and the log
output box elements, and we use addeventlistener() to add an event listener to the dial button so that clicking it calls the connectanddial() function to begin the connection process.
...if addicecandidate() fails, the catch() clause
outputs the error to our log box.
... if at any time an error occurs, the catch() clause
outputs an error message to the log.
...And 2 more matches
Controlling multiple parameters with ConstantSourceNode - Web APIs
since constantsourcenode's offset value is simply sent straight through to all of its
outputs, it acts as a splitter for that value, sending it to each connected parameter.
...the constantsourcenode can have as many
outputs as necessary; in this case, we've connected it to three nodes: two gainnodes and a stereopannernode.
...we connect its
output to the gain audioparam on both gainnode2 and gainnode3, and we start the constant node running by calling its start() method; now it's sending the value 0.5 to the two gain nodes' values, and any change to constantnode.offset will automatically set the gain of both gainnode2 and gainnode3 (affecting their audio inputs as expected).
...And 2 more matches
Generating HTML - Web APIs
since there is no html namespace, and using the xhtml namespace would force the xsl to create an xml document that would not behave like a html document, the xsl:
output in the xsl stylesheet will make sure the resulting document will be handled as html.
...the
output of the xsl stylesheet is set to html by using the xsl:
output element.
... by setting the
output to be html and not having a namespace on the resulting elements (colored in blue), those elements will be treated as html elements.
...And 2 more matches
Using CSS animations - CSS: Cascading Style Sheets
we'll modify the sliding text example to
output some information about each animation event when it occurs, so we can get a look at how they work.
...eateelement("li"); switch(event.type) { case "animationstart": l.innerhtml = "started: elapsed time is " + event.elapsedtime; break; case "animationend": l.innerhtml = "ended: elapsed time is " + event.elapsedtime; break; case "animationiteration": l.innerhtml = "new loop started at time " + event.elapsedtime; break; } document.getelementbyid("
output").appendchild(l); } this code, too, is very simple.
... the
output, when all is said and done, looks something like this: started: elapsed time is 0 new loop started at time 3.01200008392334 new loop started at time 6.00600004196167 ended: elapsed time is 9.234000205993652 note that the times are very close to, but not exactly, those expected given the timing established when the animation was configured.
...And 2 more matches
color-adjust - CSS: Cascading Style Sheets
the color-adjust css property sets what, if anything, the user agent may do to optimize the appearance of the element on the
output device.
... by default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the
output device.
... values economy the user agent is allowed to make adjustments to the element as it deems appropriate and prudent in order to optimize the
output for the device it's being rendered for.
...And 2 more matches
<details>: The Details disclosure element - HTML: Hypertext Markup Language
an input device as well as some form of
output device is recommended.</p> </details> in this situation, the browser will use a default summary string (usually "details").
... an input device as well as some form of
output device is recommended.</p> </details> the result from this html is this: creating an open disclosure box to start the <details> box in its open state, add the boolean open attribute: <details open> <summary>system requirements</summary> <p>requires a computer running an operating system.
... an input device as well as some form of
output device is recommended.</p> </details> this results in: customizing the appearance now let's apply some css to customize the appearance of the disclosure box.
...And 2 more matches
<xsl:attribute> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:attribute> element creates an attribute in the
output document, using any values that can be accessed from the stylesheet.
... the element must be defined before any other
output document element inside the
output document element for which it establishes attribute values.
... but it may be after or inside elements that won't be part of the
output (like <xsl:choose> or <xsl:apply-templates> etc.).
...And 2 more matches
<xsl:text> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:text> element writes literal text to the
output tree.
... syntax <xsl:text disable-
output-escaping="yes" | "no"> text </xsl:text> required attributes none.
... optional attributes disable-
output-escaping (netscape does not serialize the result of transformation - the "
output" below - so this attribute is essentially irrelevant in context.
...And 2 more matches
File object - Archive of obsolete content
pipe to programs generating
output on stdout) begin with the pipe symbol; writeable pipelines end with the pipe symbol.
... file.currentdir a file object that represents the standard
output (stdout).
...file.input, file.
output, file.error or a pipeline) methods file.open() opens the file, specifying file mode and type.
... examples example: hello, world file.
output.writeln("hello, world"); example: writing a new file var file = new file("myfile.txt"); file.open("write,create", "text"); file.writeln("the quick brown fox jumped over the lazy dogs"); file.close(); example: reading from a file var data; var file = new file("myfile.txt"); file.open("read", "text"); data = file.readln(); file.close(); example: sending mail through a pipeline var mail = new...
Debugging a XULRunner Application - Archive of obsolete content
xulrunner.exe /path/to/application.ini -console to
output text to the console, use dump("my text here\n");.
... to
output dump calls instead to a file, set browser.dom.window.dump.file to the file destination where the log should be created and restart the application.
... to
output messages to the javascript console there are two ways to
output messages to the js console: components.utils.reporterror(str) will
output str as an "error" (i.e.
... jsdump(str) (function defined below) will
output str as a "message" with a speech bubble icon next to it: function jsdump(str) { components.classes['@mozilla.org/consoleservice;1'] .getservice(components.interfaces.nsiconsoleservice) .logstringmessage(str); } for more information about the error console see the error console and browser console article.
Implementation Status - Archive of obsolete content
333782; 4.5.4 xforms-link-exception supported 4.5.5 xforms-
output-exception unsupported 4.5.6 xforms-submit-error supported 4.5.7 xforms-version-exception unsupported 4.6 event sequencing supported 4.6.1 for input, secret, textarea, range, or upload controls supported ...
... 4.6.2 for
output controls supported 4.6.3 for select or select1 controls partial 4.6.4 for trigger controls supported 4.6.5 for submit controls supported 4.6.6 sequence: selection without value change supported 4.6.7 sequence: value change with focus change supported 4.6.8 sequence: activating a trigger supported 4.6.9 sequence: submission supported 4.7 resolving id references in xforms unsupported ...
... 8.1 the xforms core form controls module supported 8.1.1 common requirements n/a 8.1.2 input supported 8.1.3 secret supported 8.1.4 textarea supported 8.1.5
output supported 8.1.6 upload supported 8.1.7 range partial 316355; 343523; 8.1.8 trigger supported 8.1.9 submit supported 8.1.10 select partial @selection does not work, selec...
... refresh partial is dispatching events instead of calling directly 332231; 10.13 reset supported 10.14 load partial no xforms-link-error generated if @src invalid 333782; 10.15 send supported 10.16 message partial
output inside message doesn't work correctly 366886; 10.17 conditional execution of xforms actions supported 10.18 iteration of xforms actions supported 11.
Images in HTML - Learn web development
if you get really stuck, press the show solution button to see an answer: playable code <h2>live
output</h2> <div class="
output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="min-height: 100px; width: 95%"> <img> </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" ...
...value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var
output = document.queryselector('.
output'); var code = textarea.value; var userentry = textarea.value; function updatecode() {
output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value =...
...if you get really stuck, press the show solution button to see an answer: playable code 2 <h2>live
output</h2> <div class="
output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="min-height: 100px; width: 95%"> </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value=...
..."show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var
output = document.queryselector('.
output'); var code = textarea.value; var userentry = textarea.value; function updatecode() {
output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'sh...
From object to iframe — other embedding technologies - Learn web development
insert it into the input box below, and see what the result is in the
output.
... insert it into the input box below, and see what the result is in the
output.
... playable code <h2>live
output</h2> <div class="
output" style="min-height: 250px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="width: 95%;min-height: 100px;"> </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } c...
...onst textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const
output = document.queryselector('.
output'); let code = textarea.value; let userentry = textarea.value; function updatecode() {
output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); const htmlsolution = ...
Handling text — strings in JavaScript - Learn web development
so, taking a simple example: let song = 'fight the youth'; would be turned into a template literal like so: song = `fight the youth`; if we want to concatenate strings, or include expression results inside them, traditional strings can be fiddly to write: let score = 9; let highestscore = 10; let
output = 'i like the song "' + song + '".
... i gave it a score of ' + (score/highestscore * 100) + '%.'; template literals simplify this enormously:
output = `i like the song "${ song }".
... another point to note is that if you want to split a traditional string over multiple lines, you need to include a newline character, \n:
output = 'i like the song "' + song + '".\ni gave it a score of ' + (score/highestscore * 100) + '%.'; template literals respect the line breaks in the source code, so newline characters are no longer needed.
... this would achieve the same result:
output = `i like the song "${ song }".
Server-side web frameworks - Learn web development
they provide tools and libraries that simplify common web development tasks, including routing urls to appropriate handlers, interacting with databases, supporting sessions and user authorization, formatting
output (e.g.
...every "view" function (a request handler) receives an httprequest object containing request information, and is required to return an httpresponse object with the formatted
output (in this case a string).
... # return httpresponse return httpresponse('
output string to return') route requests to the appropriate handler most sites will provide a number of different resources, accessible through distinct urls.
...these allow you to specify the structure of an
output document, using placeholders for data that will be added when a page is generated.
Getting started with Svelte - Learn web development
on the left side of the screen you'll see the code of your components, and on the right you'll see the running
output of your app.
... on the right side you have three tabs: the result tab shows your app
output, and provides a console at the bottom.
... the js
output tab lets you inspect the javascript code generated by svelte, and set compiler options.
... the css
output tab shows the css generated by svelte.
Accessibility/LiveRegionDevGuide
current utterances should be allowed to finish but the 'rude' messages should be
output as soon as possible.
...it was originally intended to give web developers a means to force a live region message to go to a separate
output device.
...however, the channel property is also significant for single
output applications that rely on speech
output only.
... in this case, 'main' channel messages are queued according to the 'live' property and 'alert' channel messages bypass the queue and are
output immediately.
Multiprocess on Windows
com metadata midl
outputs two different types of metadata: "fast format strings" (also known as oicf) and (optionally, if a library statement is included in the idl) type libraries (also known as typelib).
...it also will
output a file with the .tlb extension.
...if your interface
outputs an array of interfaces, the interceptor would only wrap the first element in the array, because it cannot distinguish between scalars and arrays.
...this receives the com interface which you want to wrap as its first parameter, and
outputs the wrapped object (with the same interface) as its second parameter.
Internationalized Domain Names (IDN) Support in Mozilla Browsers
the final step of the process is the affixing of the ace prefix to the
output string from the nameprep/stringprep and punycode processing.
... since the punycode contains only ascii characters, it is possible that an
output may, though unlikely, coincide with existing domain names.
... to avoid such a complication, rfc 3490 defines a special prefix "xn--" for the ace (punycode)
output.
... as an example, an
output string to be sent to a dns server for a japanese domain name, "http://ジェーピーニック.jp", will look like the following in ace form: http://xn--hckqz9bzb1cyrb.jp domain name registration after the technical standards were established by ietf, the last remaining issue was for domain name registrars to agree on an international guideline on the use of idn characters.
Release phase
the
output will look something like this: comparing with ssh://hg.mozilla.org/releases/l10n-central/x-testing searching for changes changeset: 0:7c543e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 2009 +0100 summary: added search bar strings make sure this
output is accurate before continuing.
... once you've made sure the outgoing
output is accurate, push this changeset to hg.mozilla.org by running the hg push command.
...the
output should look something like this: pushing to ssh://hg.mozilla.org/releases/l10n-central/x-testing searching for changes adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files congratulations!
...if you can't figure it out on your own, copy the
output of the above command, paste it on http://pastebin.mozilla.org and ask in #l10n on the irc.mozilla.org server.
BloatView
reading individual bloat logs full bloatview
output contains per-class statistics on allocations and refcounts, and provides gross numbers on the amount of memory being leaked broken down by class.
... here's a sample of the bloatview
output.
... perl tools/bloatview/bloatdiff.pl <previous-log> <current-log> this will give you
output of the form: bloat/leak delta report current file: dist/win32_d.obj/bin/bloatlogs/all-1999-10-22-133450.txt previous file: dist/win32_d.obj/bin/bloatlogs/all-1999-10-16-010302.txt -------------------------------------------------------------------------- class leaks delta bloat delta ----------------------------------------------------------------------...
... bloatview's
output file can also show you where the leaked objects are allocated.
Investigating leaks using DMD heap scan mode
the result of that grep will contain
output that looks something like this: cc-edges.15873.log:0x7f0897082c00 [rc=1285] nsglobalwindowinner # 2147483662 inner https://www.example.com/ * cc-edges.15873.log: the first part is the file name where it was found.
...it will eventually produce some
output.
... you'll want to save a copy of this
output for later.
... the
output will look something like this, after a message about loading progress: 0x7f0882fe3230 [fragmentorelement (xhtml) script https://www.example.com] --[[via hash] mlistenermanager]--> 0x7f0899b4e550 [eventlistenermanager] --[mlisteners event=onload listenertype=3 [i]]--> 0x7f0882ff8f80 [callbackobject] --[mincumbentglobal]--> 0x7f0897082c00 [nsglobalwindowinner # 2147483662 inner https://www.example.com] root 0x7f0882fe3230 is a ref counted object with 1 unknown edge(s).
NSS_3.12_release_notes.html
bug 354403: nsslist_createiterator returns pointer to a freed memory if the function fails to allocate a lock bug 399236: pkix wrapper must print debug
output into stderr bug 399300: pkix error results not freed after use.
...ug 403680: cert_pkixverifycert fails if crls are missing, implement cert_pi_revocationflags bug 427706: nss_3_12_rc1 crashes in passwordmgr tests bug 426245: assertion failure went undetected by tinderbox bug 158242: pk11_putcrl is very memory inefficient bug 287563: please make cert_comparenamewithconstraints a non-static function bug 301496: nss_shutdown failure in p7sign bug 324878: crlutil -l
outputs false crl names bug 337010: oom crash [[@ nsc_digestkey] dereferencing possibly null att bug 343231: certutil issues certs for invalid requests bug 353371: klocwork 91117 - null pointer dereference in cert_certchainfromcert bug 353374: klocwork 76494 - null ptr derefs in cert_formatname bug 353375: klocwork 76513 - null ptr deref in nsscertificatelist_docallback bug 353413: klocwork 76541 free u...
...ecmod_handle_string_arg called in loop bug 353904: klocwork null ptr deref in secasn1d.c bug 366390: correct misleading function names in fipstest bug 370536: memory leaks in pointer tracker code in debug builds only bug 372242: cert_comparerdn uses incorrect algorithm bug 379753: s/mime should support aes bug 381375: ocspclnt doesn't work on windows bug 398693: der_asciitotime produces incorrect
output for dates 1950-1970 bug 420212: empty cert dns handled badly, display as !invalid ava!
... bug 420979: vfychain ignores -b time option when -p option is present bug 403563: implement the tls session ticket extension (ste) bug 400917: want exported function that
outputs all host names for dns name matching bug 315643: test_buildchain_resourcelimits won't build bug 353745: klocwork null ptr dereference in pkcs12 decoder bug 338367: the gf2m_populate and gfp_populate should check the eccurve_map array index bounds before use bug 201139: ssltap should display plain text for null cipher suites bug 233806: support nist crl policy bug 279085: nss tools display public exponent as negative number bug 363480: ocspclnt needs option to take cert from specified file bug 265715: remove unused hsearch.c dbm code bug 337361: leaks in jar_parse_any (security/nss/lib/jar/jarver.c) bug 338453: leaks in...
sample2
); fprintf(stderr, "%-30s - db password file [optional]\n\n", "-f <dbpwdfile>"); fprintf(stderr, "%-30s - noise file name [optional]\n\n", "-z <noisefilename>"); fprintf(stderr, "%-30s - input file name\n\n", "-i <ipfilename>"); fprintf(stderr, "%-30s - header file name\n\n", "-b <headerfilename>"); fprintf(stderr, "%-30s - encrypt file name\n\n", "-e <encryptfilename>"); fprintf(stderr, "%-30s -
output file name\n\n", "-o <opfilename>"); fprintf(stderr, "%-30s - certificate serial number\n\n", "-m <serialnumber>"); fprintf(stderr, "%-30s - certificate nickname\n\n", "-n <nickname>"); fprintf(stderr, "%-30s - certificate trust\n\n", "-t <trustargs>"); fprintf(stderr, "%-30s - certificate issuer nickname\n\n", "-u <issuernickname>"); fprintf(stderr, "%-30s - certificate signing request \n\n", "-r...
...= pr_false; if (!headerfilename) { pr_fprintf(pr_stderr, "%s -d -d %s -b : header file name is not found\n", progname, dbdir); validationfailed = pr_true; } if (!encryptedfilename) { pr_fprintf(pr_stderr, "%s -d -d %s -b %s -e : encrypt file name is not found\n", progname, dbdir, headerfilename); validationfailed = pr_true; } if (!outfilename) { pr_fprintf(pr_stderr, "%s -d -d %s -b %s -e %s -o :
output file name is not found\n", progname, dbdir, headerfilename, encryptedfilename); validationfailed = pr_true; } if (validationfailed) { fprintf(stderr, "\nusage: %s %s \n\n", progname, "-d -d <dbdirpath> -b <headerfilename> -e <encryptfilename> -o <opfilename>\n"); exit(-1); } } /* * sign the contents of input file using private key and * return result as secitem */ secstatus signdata(const char *i...
... commandtype option2command(char c) { switch (c) { case 'g': return generate_csr; case 'a': return add_cert_to_db; case 'h': return save_cert_to_header; case 'e': return encrypt; case 'd': return decrypt; case 's': return sign; case 'v': return verify; default: return unknown; } } /* * this example illustrates basic encryption/decryption and macing * generates the rsa key pair as token object and
outputs public key as cert request.
...as in sample 5,
output is a pkcs#10 csr * 2.
NSS tools : crlutil
-a use ascii format or allow the use of ascii format for input and
output.
... -o
output-file specify the
output file name for new crl.
... bracket the
output-file string with quotation marks if it contains spaces.
... if this argument is not used the
output destination defaults to standard
output.
NSS tools : crlutil
-a use ascii format or allow the use of ascii format for input and
output.
... -o
output-file specify the
output file name for new crl.
... bracket the
output-file string with quotation marks if it contains spaces.
... if this argument is not used the
output destination defaults to standard
output.
JS_PutEscapedString
returns the length of the written
output, not including the nul.
... thus, a return value of size or more means that the
output was truncated.
... if buffer is null, just returns the length of the
output.
... if quote is not 0, it must be a single or double quote character that will quote the
output.
nsILoginManagerStorage
size_is(count)] out wstring hostnames); void getallencryptedlogins([optional] out unsigned long count, [retval, array, size_is(count)] out nsilogininfo logins); void getalllogins([optional] out unsigned long count, [retval, array, size_is(count)] out nsilogininfo logins); boolean getloginsavingenabled(in astring ahost); void init(); void initwithfile(in nsifile ainputfile, in nsifile a
outputfile); void modifylogin(in nsilogininfo oldlogin, in nsisupports newlogindata); void removealllogins(); void removelogin(in nsilogininfo alogin); void searchlogins(out unsigned long count, in nsipropertybag matchdata, [retval, array, size_is(count)] out nsilogininfo logins); void setloginsavingenabled(in astring ahost, in boolean isenabled); attributes attribute type description ...
...void initwithfile( in nsifile ainputfile, in nsifile a
outputfile ); parameters ainputfile the file from which to read stored logins.
... a
outputfile the file to which to write stored logins, if not null.
... if this is null, use the default
output file.
nsIMsgFolder
ue); void notifyitemadded(in nsisupports item); void notifyitemremoved(in nsisupports item); void notifyfolderevent(in nsiatom event); void listdescendents(in nsisupportsarray descendents); void shutdown(in boolean shutdownchildren); void setinvfeditsearchscope(in boolean asearchthisfolder, in boolean asetonsubfolders); void copydatato
outputstreamforappend(in nsiinputstream aistream, in long alength, in nsi
outputstream
outputstream); void copydatadone(); void setjunkscoreformessages(in nsisupportsarray amessages, in acstring ajunkscore); void applyretentionsettings(); boolean fetchmsgpreviewtext([array, size_is (anumkeys)] in nsmsgkey akeystofetch, in unsigned long anumkeys, in boolean alocalonly, ...
...in nsiurllistener aurllistener); void addkeywordstomessages(in nsisupportsarray amessages, in acstring akeywords); void removekeywordsfrommessages(in nsisupportsarray amessages, in acstring akeywords); autf8string getmsgtextfromstream(in nsimsgdbhdr amsghdr, in nsiinputstream astream, in long abytestoread, in long amax
outputlen, in boolean acompressquotes); attributes attribute type description supportsoffline boolean readonly offlinestore
outputstream nsi
outputstream readonly offlinestoreinputstream nsiinputstream readonly retentionsettings nsimsgretentionsettings downloadsettings nsimsgdownloadsettings sortorder long used for order in the folder pane, fol...
... void listdescendents(in nsisupportsarray descendents); shutdown() void shutdown(in boolean shutdownchildren); setinvfeditsearchscope() void setinvfeditsearchscope(in boolean asearchthisfolder, in boolean asetonsubfolders); copydatato
outputstreamforappend() void copydatato
outputstreamforappend(in nsiinputstream aistream, in long alength, in nsi
outputstream
outputstream); copydatadone() void copydatadone(); setjunkscoreformessages() void setjunkscoreformessages(in nsisupportsarray amessages, in acstring ajunkscore); a...
... autf8string getmsgtextfromstream(in nsimsgdbhdr amsghdr, in nsiinputstream astream, in long abytestoread, in long amax
outputlen, in boolean acompressquotes); ...
nsITransport
method overview void close(in nsresult areason); nsiinputstream openinputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); nsi
outputstream open
outputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); void seteventsink(in nsitransporteventsink asink, in nsieventtarget aeventtarget); constants open flags.
... return value open
outputstream() open an
output stream on this transport.
... nsi
outputstream open
outputstream( in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount ); parameters aflags optional transport specific flags.
...in addition, in non- blocking mode, the stream is guaranteed to support nsiasync
outputstream.
nsIXSLTProcessor
in domstring localname); void importstylesheet(in nsidomnode style); void removeparameter(in domstring namespaceuri, in domstring localname); void reset(); void setparameter(in domstring namespaceuri, in domstring localname, in nsivariant value); nsidomdocument transformtodocument(in nsidomnode source); nsidomdocumentfragment transformtofragment(in nsidomnode source, in nsidomdocument
output); methods clearparameters() removes all set parameters from this nsixsltprocessor.
...the created fragment will be owned by the specified
output document.
... nsidomdocumentfragment transformtofragment( in nsidomnode source, in nsidomdocument
output ); parameters source the node to be transformed.
...
output the document to own the returned document fragment.
nsIXULTemplateBuilder
for the next iteration, those children would be used to generate
output for their child nodes and so forth.
...the template builder then generates
output for each result based on the <rule> elements.
...since the reference point is different, different
output will typically be generated.
...more than one of these results may match one of the rules in their respective queries, however only the result for the earliest matching query in the template becomes the active match and generates
output.
Console messages - Firefox Developer Tools
interpreter input/
output commands sent to the browser using the web console's javascript interpreter, and the corresponding responses, are logged in the console messages.
... filtering by text to see only messages that contain a specific string, type in the text box labeled "filter
output".
... for example, if you entered the string img into the text box, you would have a list something like this: a small "x" icon appears at the right end of the text box when you have entered a string on which to filter the
output.
... filtering with regular expressions you can also use a valid regular expression to filter the console
output.
AudioBufferSourceNode - Web APIs
y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="666" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">audiobuffersourcenode</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} an audiobuffersourcenode has no inputs and exactly one
output, which has the same number of channels as the audiobuffer indicated by its buffer property.
... if there's no buffer set—that is, if buffer is null—the
output contains a single channel of silence (every sample is 0).
... number of inputs 0 number of
outputs 1 channel count defined by the associated audiobuffer constructor audiobuffersourcenode() creates and returns a new audiobuffersourcenode object.
...since no pitch correction is applied on the
output, this can be used to change the pitch of the sample.
AudioWorkletNode - Web APIs
once fired, the processor and consequently the node will
output silence throughout its lifetime.
... examples in this example we create a custom audioworkletnode that
outputs white noise.
... first, we need to define a custom audioworkletprocessor, which will
output white noise, and register it.
... // white-noise-processor.js class whitenoiseprocessor extends audioworkletprocessor { process (inputs,
outputs, parameters) { const
output =
outputs[0]
output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = math.random() * 2 - 1 } }) return true } } registerprocessor('white-noise-processor', whitenoiseprocessor) next, in our main script file we'll load the processor, create an instance of audioworkletnode passing it the name of the processor, and connect the node to an audio graph.
GainNode - Web APIs
it is an audionode audio-processing module that causes a given gain to be applied to the input data before its propagation to the
output.
... a gainnode always has exactly one input and one
output, both with the same number of channels.
... number of inputs 1 number of
outputs 1 channel count mode "max" channel count 2 (not used in the default count mode) channel interpretation "speakers" constructor gainnode() creates a new instance of a gainnode object.
...if you still hear something, make sure you haven't // connected your source into the
output in addition to using the gainnode.
HTMLMediaElement.setSinkId() - Web APIs
the htmlmediaelement.setsinkid() method sets the id of the audio device to use for
output and returns a promise.
... parameters sinkid the mediadeviceinfo.deviceid of the audio
output device.
... exceptions exception explanation domexception no permission to use the requested device examples const devices = await navigator.mediadevices.enumeratedevices(); const audiodevices = devices.filter(device => device.kind === 'audio
output'); const audio = document.createelement('audio'); await audio.setsinkid(audiodevices[0].deviceid); console.log('audio is being played on ' + audio.sinkid); specifications specification status comment audio
output devices apithe definition of 'sinkid' in that specification.
...older versions of this spec were called "media capture
output".
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
example in this example, we have a pair of functions: the first, networkteststart(), captures an initial report, and the second, networkteststop(), captures a second report, then uses the two reports to
output some information about the network conditions...
...it takes as input the rtcpeerconnection being tested, calls getstats() to get a new rtcstatsreport with current statistics, then computes the results it's looking for,
outputting those results as appropriate to the user by appending appropriate html to the contents of the <div> element whose class is stats-box.
... the remainder of the networkteststop() function constructs the html used to display the
output of the collected and computed results to the user, then append it to the element statsbox, which we're using to show the status updates to the user.
... the
output log, given the styles used by the example, looks like this: in the screenshot, we see a heading followed by the scrollable <div> we refer to as statsbox.
ScriptProcessorNode.onaudioprocess - Web APIs
for each channel and each sample frame, the scriptnode.onaudioprocess function takes the associated audioprocessingevent and uses it to loop through each channel of the input buffer, and each sample in each channel, and add a small amount of white noise, before setting that result to be the
output sample in each case.
...sor-node github repo (also view the source code.) var myscript = document.queryselector('script'); var mypre = document.queryselector('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and
output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(a...
...data, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingevent) { // the input buffer is the song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the
output buffer contains the samples that will be modified and played var
outputbuffer = audioprocessingevent.
outputbuffer; // loop through the
output channels (in this case there is only one) for (var channel = 0; channel <
outputbuffer.numberofchannels; channel++) { var inputdata = inputbuffer.getchanneldata(channel); var
outputdata =
outputbuffer.getchanneldata(channel); // loop thr...
...ough the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make
output equal to the same as the input
outputdata[sample] = inputdata[sample]; // add noise to each
output sample
outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } specifications specification status comment web audio apithe definition of 'onaudioprocess' in that specification.
SubtleCrypto.exportKey() - Web APIs
*/ async function exportcryptokey(key) { const exported = await window.crypto.subtle.exportkey( "raw", key ); const exportedkeybuffer = new uint8array(exported); const exportkey
output = document.queryselector(".exported-key"); exportkey
output.textcontent = `[${exportedkeybuffer}]`; } /* generate an encrypt/decrypt secret key, then set up an event listener on the "export" button.
...*/ async function exportcryptokey(key) { const exported = await window.crypto.subtle.exportkey( "pkcs8", key ); const exportedasstring = ab2str(exported); const exportedasbase64 = window.btoa(exportedasstring); const pemexported = `-----begin private key-----\n${exportedasbase64}\n-----end private key-----`; const exportkey
output = document.queryselector(".exported-key"); exportkey
output.textcontent = pemexported; } /* generate a sign/verify key pair, then set up an event listener on the "export" button.
...*/ async function exportcryptokey(key) { const exported = await window.crypto.subtle.exportkey( "spki", key ); const exportedasstring = ab2str(exported); const exportedasbase64 = window.btoa(exportedasstring); const pemexported = `-----begin public key-----\n${exportedasbase64}\n-----end public key-----`; const exportkey
output = document.queryselector(".exported-key"); exportkey
output.textcontent = pemexported; } /* generate an encrypt/decrypt key pair, then set up an event listener on the "export" button.
...*/ async function exportcryptokey(key) { const exported = await window.crypto.subtle.exportkey( "jwk", key ); const exportkey
output = document.queryselector(".exported-key"); exportkey
output.textcontent = json.stringify(exported, null, " "); } /* generate a sign/verify key pair, then set up an event listener on the "export" button.
Taking still photos with WebRTC - Web APIs
next, we have a <canvas> element into which the captured frames are stored, potentially manipulated in some way, and then converted into an
output image file.
... <canvas id="canvas"> </canvas> <div class="
output"> <img id="photo" alt="the screen capture will appear in this box."> </div> that's all of the relevant html.
... height the
output height of the image will be computed given the width and the aspect ratio of the stream.
...this function's job is to request access to the user's webcam, initialize the
output <img> to a default state, and to establish the event listeners needed to receive each frame of video from the camera and react when the button is clicked to capture an image.
Writing a WebSocket server in Java - Web APIs
here's an implementation split into parts: import java.io.ioexception; import java.io.inputstream; import java.io.
outputstream; import java.net.serversocket; import java.net.socket; import java.security.messagedigest; import java.security.nosuchalgorithmexception; import java.util.base64; import java.util.scanner; import java.util.regex.matcher; import java.util.regex.pattern; public class websocket { public static void main(string[] args) throws ioexception, nosuchalgorithmexception { serversocket server = new...
... java.net.socket get
outputstream() returns an
output stream for this socket.
...
outputstream methods: write(byte[] b, int off, int len) writes len bytes from the specified byte array starting at offset off to this
output stream.
... inputstream in = client.getinputstream();
outputstream out = client.get
outputstream(); scanner s = new scanner(in, "utf-8"); handshaking when a client connects to a server, it sends a get request to upgrade the connection to a websocket from a simple http request.
Movement, orientation, and motion: A WebXR example - Web APIs
this lets you compare any differences in rendering between the two modes, and lets you see
output from immersive mode even if you don't have a headset.
... the last four variables declared are storage for references to the <div> elements into which we'll
output the matrices when we want to show them to the user.
... logging errors a function called logglerror() is implemented to provide an easily customized way to
output logging information for errors that occur while executing webgl functions.
...then references are obtained to the four <div> blocks into which we'll
output the current contents of each of the key matrices for informational purposes while our scene is running.
color-gamut - CSS: Cascading Style Sheets
the color-gamut css media feature can be used to test the approximate range of colors that are supported by the user agent and the
output device.
... srgb the
output device can support approximately the srgb gamut or more.
... p3 the
output device can support approximately the gamut specified by the dci p3 color space or more.
... rec2020 the
output device can support approximately the gamut specified by the itu-r recommendation bt.2020 color space or more.
Cubic Bezier Generator - CSS: Cascading Style Sheets
ge="updatecanvas();return true;" type="text" maxlength=6 id="y1" value="0.33" class='field'> <label for="x2">x2 = </label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="x2" value="0.14" class='field'> <label for="y2">y2 = </label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="y2" value="0.53" class='field'> <br> <
output id="
output">log</
output> </form> </html> .field { width: 40px; } function updatecanvas() { var x1 = document.getelementbyid('x1').value; var y1 = document.getelementbyid('y1').value; var x2 = document.getelementbyid('x2').value; var y2 = document.getelementbyid('y2').value; drawbeziercurve(x1, y1, x2, y2); } const radius = 4; // place needed to draw th...
.../ 10, -3 * basic_scale_size + cx(0), cy(i) + 4); // limitation the constant 4 should be font size dependant } ctx.lineto(cx(0), ly(i)); } ctx.stroke(); ctx.closepath(); ctx.beginpath(); // draw the y axis label ctx.save(); ctx.rotate(-math.pi / 2); ctx.textalign = "left"; ctx.filltext("
output (value ratio)", -cy(0), -3 * basic_scale_size + cx(0)); ctx.restore(); // draw the x axis ctx.moveto(cx(0), cy(0)); ctx.lineto(cx(0), cy(1)); ctx.textalign = "center"; for (i = 0.1; i <= 1; i = i + 0.1) { ctx.moveto(lx(i), basic_scale_size + cy(0)); if ((i == 0.5) || (i > 0.9)) { ctx.moveto(lx(i), 2 * basic_s...
...ke(); ctx.closepath(); } else { alert('you need safari or firefox 1.5+ to see this demo.'); } } function mousedown(e) { var canvas = document.getelementbyid('bezier'); var x1 = cx(document.getelementbyid('x1').value); var y1 = cy(document.getelementbyid('y1').value); var x = e.pagex - canvas.offsetleft; var y = e.pagey - canvas.offsettop; var
output = document.getelementbyid('
output');
output.value = "(" + x + "," + y + ") should be (" + x1 + "," + y1 + ")"; if ((x1 + radius >= x) && (x1 - radius <= x) && (y1 + radius >= y) && (y1 - radius <= y)) { var
output = document.getelementbyid('
output');
output.value = "p1!"; dragsm = 1; } var x2 = cx(document.getelementbyid('x2').value); var y2 = cy(doc...
...ument.getelementbyid('y2').value); if ((x2 + radius >= x) && (x2 - radius <= x) && (y2 + radius >= y) && (y2 - radius <= y)) { var
output = document.getelementbyid('
output');
output.value = "p2!"; dragsm = 2; } // if we are starting a drag if (dragsm != 0) { canvas.onmousemove = mousemove; } } function mouseup(e) { var
output = document.getelementbyid('
output');
output.value = "mouse up!"; dragsm = 0; canvas.onmousemove = null; } function mousemove(e) { if (dragsm != 0) { var canvas = document.getelementbyid('bezier'); var x = e.pagex - canvas.offsetleft; var y = e.pagey - canvas.offsettop; var
output = document.getelementbyid('
output');
output.value = "drag!"; if (drag...
Operator precedence - JavaScript
code
output function echo(name, num) { console.log("evaluating the " + name + " side"); return num; } // notice the division operator (/) console.log(echo("left", 6) / echo("right", 2)); evaluating the left side evaluating the right side 3 function echo(name, num) { console.log("evaluating the " + name + " side"); return num; } // notice the ex...
...with only one operator or operators of different precedences, associativity doesn't affect the
output, as seen in the example above.
... in the example below, observe how associativity affects the
output when multiple of the same operator are used.
... code
output function echo(name, num) { console.log("evaluating the " + name + " side"); return num; } // notice the division operator (/) console.log(echo("left", 6) / echo("middle", 2) / echo("right", 3)); evaluating the left side evaluating the middle side evaluating the right side 1 function echo(name, num) { console.log("evaluating the " + name + " side"); return num; } // notice the exponentiation operator (**) console.log(echo("left", 2) ** echo("middle", 3) ** echo("right", 2)); evaluating the left side evaluating the middle side evaluating the right side 512 function echo(name, num) { console.log("evaluating the " + name + " side"); return num; } // notice the parenthe...
<xsl:element> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:element> element creates an element in the
output document.
... syntax <xsl:element name=name namespace=uri use-attribute-sets=list-of-names > template </xsl:element> required attributes name specifies the desired name of the
output element.
... optional attributes namespace specifies the namespace of the
output element.
... use-attribute-sets a whitespace‐separated list of attribute-set element names to be applied to the element element’s
output element.
<xsl:value-of> - XSLT: Extensible Stylesheet Language Transformations
syntax <xsl:value-of select=expression disable-
output-escaping="yes" | "no" /> required attributes select specifies the xpath expression to be evaluated and written to the
output tree.
... optional attributes disable-
output-escaping (netscape does not serialize the result of transformation - the "
output" below - so this attribute is essentially irrelevant in context.
... to
output html-entities, use numerical values instead, eg   for  ) specifies whether special characters are escaped when written to the
output.
...if "yes" is set, for example, the character > is
output as >, not as ">".
Compiling an Existing C Module to WebAssembly - WebAssembly
now you only need some html and javascript to load your new module: <script src="./a.out.js"></script> <script> module.onruntimeinitialized = async _ => { const api = { version: module.cwrap('version', 'number', []), }; console.log(api.version()); }; </script> and you will see the correct version number in the
output: note: libwebp returns the current version a.b.c as a hexadecimal number 0xabc.
...it also allocates an
output buffer for us that we need to free using webpfree() once we are done with the webp image.
... the result of the encoding operation is an
output buffer and its length.
... depending on the size of your image, you might run into an error where wasm can't grow the memory enough to accommodate both the input and the
output image: luckily, the solution to this problem is in the error message.
io/text-streams - Archive of obsolete content
textwriter(
outputstream, charset) creates a buffered
output stream that writes text to a backing stream using a given text encoding.
... parameters
outputstream : stream the backing stream, an nsi
outputstream.
... charset : string text will be written to
outputstream using the character encoding named by this value.
Unit Testing - Archive of obsolete content
if we run the add-on and click the button, we should see the following logging
output: info: agvsbg8= info: hello testing the base64 module navigate to the add-on's test directory and delete the test-index.js file.
... the first two functions call atob() and btoa() and use assert.ok() to check that the
output is as expected.
... obviously, you don't have to pass the --verbose option to jpm if you don't want to; doing so just makes the
output easier to read.
Setting Up a Development Environment - Archive of obsolete content
after setting up make, you should be able to open a command line window, run "make -ver", and get the installed version of make as
output.
...if everything went well, you should see an
output similar to this: creating xpi file.
...you can do this by opening the automator application, choosing run shell script and then entering the profile-loading script in the textbox: /applications/firefox.app/contents/macos/firefox-bin -no-remote -p myprofile > /dev/null & you can change "/dev/null" to a file location, in case you want to see dump
output from firefox, or other extensions.
MMgc - Archive of obsolete content
the report can be
output to the console or to a file, and can be configured to be displayed pre/post sweep or via api call.
...bject.cpp:29 abcparser.cpp:948 … class avmplus::string - 13.2% - 1602 kb 15675 items, avg 104b 65.6% - 1051 kb - 14397 items - stringobject.cpp:46 avmcore.cpp:2300 … 20.4% - 326 kb - 10439 items - avmcore.cpp:2300 abcparser.cpp:1077 … 6.5% - 103 kb - 3311 items - avmcore.cpp:2300 abcparser.cpp:1077 … other profiling tools the gcstats flag on the gc object controls verbose
output.
...
output looks like this: [mem] ------- gross stats ----- [mem] private 5877 (23.0m) 100% [mem] mmgc 5792 (22.6m) 98% [mem] unmanaged 13 (52k) 0% [mem] managed 2596 (10.1m) 44% [mem] free 3081 (12.0m) 52% [mem] jit 0 (0k) 0% [mem] other 85 (340k) 1% [mem] bytes (interal fragmentation) 2527 (9.9m) 96% [mem] managed bytes 2520 (9.8m) 97% [mem] unmanaged bytes 7 (28k) 53% [mem] -------- gross stats end ----- numbers are in pages (with m and k in parens).
Creating a Web based tone generator - Archive of obsolete content
<!doctype html> <html> <head> <title>javascript audio write example</title> </head> <body> <input type="text" size="4" id="freq" value="440"><label for="hz">hz</label> <button onclick="start()">play</button> <button onclick="stop()">stop</button> <script type="text/javascript"> function audiodatadestination(samplerate, readfn) { // initialize the audio
output.
... var audio = new audio(); audio.mozsetup(1, samplerate); var currentwriteposition = 0; var prebuffersize = samplerate / 2; // buffer 500ms var tail = null; // the function called with regular interval to populate // the audio
output buffer.
... } tail = null; } // check if we need add some data to the audio
output.
Sorting Results - Archive of obsolete content
for an xml datasource, generated content will be
output in the order corresponding to the results of the xpath query expression.
...sorting occurs when
output is first generated as well as when a result is added as a result of a datasource change.
...when sorting, the predicate specified in the sort attribute for the result is used to determine where in the content the generated
output should be inserted.
RFE to the Custom Controls - Archive of obsolete content
output that shows the dom if
output contains cdata section or text node and its data is any mozilla known language like xhtml/xul/svg then
output should parse and display it (see bug 316817).
...
output should show data in current locale format the bug 331585 address the issue.
... input that shows/modifies the dom like the request above for
output.
Mobile touch controls - Game development
r is moved on the screen (touchmove): document.addeventlistener("touchstart", touchhandler); document.addeventlistener("touchmove", touchhandler); the touchhandler function looks like this: function touchhandler(e) { if(e.touches) { playerx = e.touches[0].pagex - canvas.offsetleft - playerwidth / 2; playery = e.touches[0].pagey - canvas.offsettop - playerheight / 2;
output.innerhtml = "touch: "+ " x: " + playerx + ", y: " + playery; e.preventdefault(); } } if the touch occurs (touches object is not empty), then we will have all the info we need in that object.
... to see if it's working correctly we can
output the x and y positions using the
output element.
...hauling in phaser, if enabled, will work out of the box — you don't have to set the position of the sprite yourself manually, so you could leave the ondragstart() function empty, or place some debug
output to see if it's working correctly.
Styling links - Learn web development
;"><p>there are several browsers available, such as <a href="#">mozilla firefox</a>, <a href="#">google chrome</a>, and <a href="#">microsoft edge</a>.</p></textarea> <h2>css input</h2> <textarea id="code" class="css-input" style="width: 90%;height: 10em;padding: 10px;border: 1px solid #0095dd;">a { } a:link { } a:visited { } a:focus { } a:hover { } a:active { }</textarea> <h2>
output</h2> <div class="
output" style="width: 90%;height: 10em;padding: 10px;border: 1px solid #0095dd;"></div> <div class="controls"> <input id="reset" type="button" value="reset" style="margin: 10px 10px 0 0;"> <input id="solution" type="button" value="show solution" style="margin: 10px 0 0 10px;"> </div> </div> var htmlinput = document.queryselector(".html-input"); var cssinput = docu...
...ment.queryselector(".css-input"); var reset = document.getelementbyid("reset"); var htmlcode = htmlinput.value; var csscode = cssinput.value; var
output = document.queryselector(".
output"); var solution = document.getelementbyid("solution"); var styleelem = document.createelement('style'); var headelem = document.queryselector('head'); headelem.appendchild(styleelem); function draw
output() {
output.innerhtml = htmlinput.value; styleelem.textcontent = cssinput.value; } reset.addeventlistener("click", function() { htmlinput.value = htmlcode; cssinput.value = csscode; draw
output(); }); solution.addeventlistener("click", function() { htmlinput.value = htmlcode; cssinput.value = 'p {\n font-size: 1.2rem;\n font-family: sans-serif;\n line-height: 1.4;\n}\n\na {\n outline: none;\n...
... text-decoration: none;\n padding: 2px 1px 0;\n}\n\na:link {\n color: #265301;\n}\n\na:visited {\n color: #437a16;\n}\n\na:focus {\n border-bottom: 1px solid;\n background: #bae498;\n}\n\na:hover {\n border-bottom: 1px solid;\n background: #cdfeaa;\n}\n\na:active {\n background: #265301;\n color: #cdfeaa;\n}'; draw
output(); }); htmlinput.addeventlistener("input", draw
output); cssinput.addeventlistener("input", draw
output); window.addeventlistener("load", draw
output); including icons on links a common practice is to include icons on links to provide more of an indicator as to what kind of content the link points to.
Client-side form validation - Learn web development
the constraint validation api most browsers support the constraint validation api, which consists of a set of methods and properties available on the following form element dom interfaces: htmlbuttonelement (represents a <button> element) htmlfieldsetelement (represents a <fieldset> element) htmlinputelement (represents an <input> element) html
outputelement (represents an <
output> element) htmlselectelement (represents a <select> element) htmltextareaelement (represents a <textarea> element) the constraint validation api makes the following properties available on the above elements.
...function addevent(element, event, callback) { let previouseventcallback = element["on"+event]; element["on"+event] = function (e) { const
output = callback(e); // a callback that returns `false` stops the callback chain // and interrupts the execution of the event callback.
... if (
output === false) return false; if (typeof previouseventcallback === 'function') {
output = previouseventcallback(e); if(
output === false) return false; } } }; // now we can rebuild our validation constraint // because we do not rely on css pseudo-class, we have to // explicitly set the valid/invalid class on our email field addevent(window, "load", function () { // here, we test if the field is empty (remember, the field is not required) // if it is not, we check if its content is a well-formed e-mail address.
Test your skills: HTML5 controls - Learn web development
create a corresponding
output element to put the current value of the slider into.
... give it a class of invite-
output, and semantically associate it with the input.
... if you do this correctly, the javascript included on the page will automatically update the
output value when the slider is moved.
Adding vector graphics to the Web - Learn web development
ur vector graphic,) and <mask> (apply a mask over the top of your image.) as a simple example, the following code creates a circle and a rectangle: <svg version="1.1" baseprofile="full" width="300" height="200" xmlns="http://www.w3.org/2000/svg"> <rect width="100%" height="100%" fill="black" /> <circle cx="150" cy="100" r="90" fill="blue" /> </svg> this creates the following
output: from the example above, you may get the impression that svg is easy to handcode.
... playable code <h2>live
output</h2> <div class="
output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="width: 95%;min-height: 200px;"> <svg width="100%" height="100%"> <rect width="100%" height="100%" fill="red" /> <circle cx="100%" cy="100%" r="150" fill="blue...
...n" value="show solution" disabled> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const
output = document.queryselector('.
output'); let code = textarea.value; let userentry = textarea.value; function updatecode() {
output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { ...
Introduction to events - Learn web development
the example
output is as follows: it's not just web pages another thing worth mentioning at this point is that events are not unique to javascript — most programming languages have some kind of event model, and the way the model works often differs from javascript's way.
...we then select all of them using document.queryselectorall(), then loop through each one, adding an onclick handler to each that makes it so that a random color is applied to each one when selected: const divs = document.queryselectorall('div'); for (let i = 0; i < divs.length; i++) { divs[i].onclick = function(e) { e.target.style.backgroundcolor = bgchange(); } } the
output is as follows (try clicking around on it — have fun): most event handlers you'll encounter have a standard set of properties and functions (methods) available on the event object; see the event object reference for a full list.
...the
output is as follows: note: for the full source code, see preventdefault-validation.html (also see it running live here.) event bubbling and capture the final subject to cover here is something that you won't come across often, but it can be a real pain if you don't understand it.
Test your skills: variables - Learn web development
note: in the examples below, if there is an error in your code it will be
outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
...the results panel should be
outputting the name chris, and a statement about how old chris will be in 20 years' time.
... how can you fix the problem and correct the
output?
Properly configuring server MIME types - Learn web development
for perl cgi, you should have the line print "content-type: text/html\n\n"; before any other
output lines.
... for php, you should have the line header('content-type: text/html'); before any other
output lines.
... for asp, you should have the line response.contenttype = "text/html"; before any other
output lines.
Ember app structure and componentization - Learn web development
the rendered
output should now look like this: it doesn't take too much effort to get our html looking like a fully-featured to-do list app.
.../ul> </section> <footer class="footer"> <span class="todo-count"> <strong>0</strong> todos left </span> <ul class="filters"> <li> <a href="#">all</a> <a href="#">active</a> <a href="#">completed</a> </li> </ul> <button type="button" class="clear-completed"> clear completed </button> </footer> </section> the rendered
output should now be as follows: this looks pretty complete, but remember that this is only a static prototype.
... enter the following command into your terminal: ember generate component header these will generate some new files, as shown in the resulting terminal
output: installing component create app/components/header.hbs skip app/components/header.js tip to add a class, run `ember generate component-class header` installing component-test create tests/integration/components/header-test.js header.hbs is the template file where we’ll include the html structure for just that component.
TypeScript support in Svelte - Learn web development
let's start by running the validate script in watch mode inside your project root: npm run validate -- --watch this should
output something like the following: svelte-check "--watch" loading svelte-check in workspace: ./svelte-todo-typescript getting svelte diagnostics...
...you'll see some warnings in the
output of the validate script: $ npm run validate -- --watch > svelte-check "--watch" ./svelte-todo-typescript getting svelte diagnostics...
...if you want to also check the .ts files you can run npm run validate && npx tsc --noemit, which tells the typescript compiler to check for errors without generating the .js
output files.
Deployment and next steps - Learn web development
if we have a look at the rollup.config.js file, we can see that the svelte compiler is just a rollup plugin: import svelte from 'rollup-plugin-svelte'; [...] import { terser } from 'rollup-plugin-terser'; const production = !process.env.rollup_watch; export default { input: 'src/main.js',
output: { sourcemap: true, format: 'iife', name: 'app', file: 'public/build/bundle.js' }, plugins: [ svelte({ // enable run-time checks when not in production dev: !production, // we'll extract any component css out into // a separate file - better for performance css: css => { css.write('public/build/bundle.css'); } }), later on...
..../ auto-detected project settings (svelte): - build command: `npm run build` or `rollup -c` -
output directory: public - development command: sirv public --single --dev --port $port ?
...clicking on it will let you inspect the
output of the job.
Handling common JavaScript problems - Learn web development
online the jshint homepage provides an online linter, which allows you to enter your javascript code on the left and provides an
output on the right, including metrics, warnings, and errors.
... try inserting the following line just below line 31 (bolded above): console.log('response value: ' + superheroes); refresh the page in the browser, and you will get an
output in the console of "response value:", plus the same error message we saw before the console.log()
output shows that the superheroes object doesn't appear to contain anything.
... the easiest way to give babel a try is to use the online version, which allows you to enter your source code on the left, and
outputs a transpiled version on the right.
Debugging on Windows
you can also redirect the console
output to a file (by adding "> filename.txt" for example, without the quotes).
...} >debug.evaluatestatement ((nsgenericelement*)0x03f0e710)->list((file*)0x10311dc0, 1) <void> >debug.evaluatestatement {,,msvcr80d}fclose((file*)0x10311dc0) 0x00000000 note that you may not see the debugging
output until you flush or close the file handle.
... for example, to print curent javascript stack to stdout, evaluate this in quickwatch window: {,,xul}dumpjsstack() note: visual c++ will show you something in the quick watch window, but not the stack, you have to look in the os console for the
output.
HTML parser threading
additionally, each nshtml5parser has an associated nshtml5treeopexecutor that turns the
output (tree operations; discussed later) of the portable parser core into actions performed on the gecko dom.
...once a unicode decoder has been set up, dodataavailable passes the byte data to the decoder whose
output is accumulated into a linked list of nshtml5owningutf16buffer objects.
...the tokenizer calls into the tree builder which
outputs nshtml5treeoperation objects (tree ops) into a queue.
QA phase
enter the following command to perform the configuration: $ ./mach configure once your command-line finishes spitting out the config command's
output, navigate to the newly created directory: $ cd ../firefox-build/browser/locales now you're ready to build!
... enter the following command: $ hg log -l 1 you should see an
output similar to the one below: changeset: 0:7c543e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 2009 +0100 summary: added search bar strings now compare the local repository on your machine with the remote hg repository by entering this command: $ hg outgoing http://hg.mozilla.org/l10n-central/x-testing the hg outgoing command compares...
...you can expect to see
output like this: comparing with http://hg.mozilla.org/l10n-central/x-testing searching for changes changeset: 0:7c543e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 2009 +0100 summary: added search bar strings let's now push this changeset.
SVN for Localizers
translate the content in those files, save them and check for differences by entering this command from the command-line: svn diff this command produces
output with every change made to each file.
... it's a bit hard to read, but you can also create a diff file (aka a diff patch) use svn diff > /path/to/
output/file.diff to save the
output to a file.
... note that path/to/
output is meant to indicate the directory on your computer where you wish to store the diff file.
MathML Accessibility in Mozilla
the table gives the
output in mode "utterance" and description spoken last.
... a base 0 subscript scripted + 1 numerator a base 1 subscript scripted + 1 numerator a base 2 subscript scripted + 1 numerator a base 3 subscript scripted + 1 numerator a base 3 subscript scripted + 1 numerator a base 4 subscript scripted denominator fraction denominator fraction denominator fraction denominator fraction torture test 8: ( n k / 2 ) no
output ( fraction start, n over k / 2, end of fraction, ) see webkit's bug 146454 left paren fraction without bar, start.
...right paren ( open-fence n numerator k / 2 denominator fraction without bar ) close-fence torture test 9: ( p 2 ) x 2 y p - 2 - 1 1 - x 1 1 - x 2 no
output ( fraction start, p over 2, end of fraction, ), x squared y, superscript p - 2, - fraction start, 1 over 1 - x, end of fraction, fraction start, 1 over 1 - x, squared, end of fraction see webkit's bug 146454 left paren fraction without bar, start.
Mozilla Web Developer FAQ
mechanisms that ensure well-formed
output include serializing from a document tree object model (eg.
... dom) and xslt transformations that do not disable
output escaping.
... when xhtml
output has been retrofitted to a content management system that was not designed for xml from the ground up, the system usually ends up discriminating gecko users by serving tag soup labeled as xml to gecko (leading to a parse error) and serving the same soup labeled as text/html to ie (not leading to a parse error).
Profiling with the Firefox Profiler
*/ ); ' -f ./run.js -e ' var profileobj = profiler.getprofiledata(); print(json.stringify(profileobj)); ' | tail -n 1 > run.cleo the xpcshell
output all benchmark information and on its last line it
output the result of the profiling, you can filter it with tail -n 1 and redirect it to a file to prevent printing it in your shell.
... the expected size of the
output is around 100 of mb.
... on b2g, each line of a layer dump in adb logcat
output is prefixed with something like i/gecko (30593):.
powermetrics
the following is example
output from such an invocation: *** sampled system activity (fri sep 4 17:15:14 2015 +1000) (5009.63ms elapsed) *** *** running tasks *** name id cpu ms/s user% deadlines (<2 ms, 2-5 ms) wakeups (intr, pkg idle) gpu ms/s com.apple.terminal 293 447.66 274.83 120.35 221.74 firefox ...
...the following is sample
output.
... 186.90 66.68 0.00 com.apple.webkit.plugin.64 67373 55.55 74.38 0.74 0.00 9.51 3.13 0.02 com.apple.terminal 109 6.22 0.40 0.23 0.00 terminal 208 6.25 92.99 0.00 0.00 0.33 0.20 0.00 the rapl
output is first, then the powermetrics
output.
PR_GetSpecialFD
gets the file descriptor that represents the standard input,
output, or error stream.
... syntax #include <prio.h> prfiledesc* pr_getspecialfd(prspecialfd id); parameter the function has the following parameter: id a pointer to an enumerator of type prspecialfd, indicating the type of i/o stream desired: pr_standardinput, pr_standard
output, or pr_standarderror.
... description type prspecialfd is defined as follows: typedef enum prspecialfd{ pr_standardinput, pr_standard
output, pr_standarderror } prspecialfd; #define pr_stdin pr_getspecialfd(pr_standardinput) #define pr_stdout pr_getspecialfd(pr_standard
output) #define pr_stderr pr_getspecialfd(pr_standarderror) file descriptors returned by pr_getspecialfd are owned by the runtime and should not be closed by the caller.
PR_dtoa
ndigits the number of digits desired in the
output string.
... decpt a pointer to a memory location where the runtime will store the offset, relative to the beginning of the
output string, of the conversion's decimal point.
... results the principle
output is the null-terminated string stored in buf.
NSS Sample Code Sample_2_Initialization of NSS
directory path\n\n", "-d <dbdirpath>"); fprintf(stderr, "%-15s specify a plaintext password\n\n", "-p <plainpasswc>"); fprintf(stderr, "%-15s specify a password file\n\n", "-f <plainpasswc>"); exit(-1); } /* initialize the slot password */ char *initslotpassword(pk11slotinfo *slot, prbool retry, void *arg) { file *input; file *
output; char *p0 = null; char *p1 = null; secupwdata *pwdata = (secupwdata *) arg; if (pwdata->source == pw_fromfile) { return filepasswd(slot, retry, pwdata->data); } if (pwdata->source == pw_plaintext) { return pl_strdup(pwdata->data); } /* open terminal */ input = fopen("/dev/tty", "r"); if (input == null) { ...
... pr_fprintf(pr_stderr, "error opening input terminal for read\n"); return null; } /* we have no password, so initialize database with one */ pr_fprintf(pr_stderr, "enter a password which will be used to encrypt your keys.\n" "the password should be at least 8 characters long,\n" "and should contain at least one non-alphabetic character.\n\n");
output = fopen("/dev/tty", "w"); if (
output == null) { pr_fprintf(pr_stderr, "error opening
output terminal for write\n"); return null; } for (;;) { if (p0) port_free(p0); p0 = getpassword(input,
output, "enter new password: ", checkpassword); if (p1) port_free(p1); p1 = getpassword(input, outpu...
...try again.\n"); } /* clear out the duplicate password string */ if (p1) { port_memset(p1, 0, port_strlen(p1)); port_free(p1); } fclose(input); fclose(
output); return p0; } /* change the password */ secstatus changepw(pk11slotinfo *slot, char *oldpass, char *newpass, char *oldpwfile, char *newpwfile) { secstatus rv; secupwdata pwdata; secupwdata newpwdata; char *oldpw = null; char *newpw = null; if (oldpass) { pwdata.source = pw_plaintext; pwdata.data = oldpass; } else if (...
Initialize NSS database - sample 2
me); fprintf(stderr, "%-15s specify a db directory path\n\n", "-d "); fprintf(stderr, "%-15s specify a plaintext password\n\n", "-p "); fprintf(stderr, "%-15s specify a password file\n\n", "-f "); exit(-1); } /* * initslotpassword */ char * initslotpassword(pk11slotinfo *slot, prbool retry, void *arg) { file *input; file *
output; char *p0 = null; char *p1 = null; secupwdata *pwdata = (secupwdata *) arg; if (pwdata->source == pw_fromfile) { return filepasswd(slot, retry, pwdata->data); } if (pwdata->source == pw_plaintext) { return pl_strdup(pwdata->data); } /* open terminal */ input = fopen("/dev/tty", "r"); if (input == null) { ...
... pr_fprintf(pr_stderr, "error opening input terminal for read\n"); return null; } /* we have no password, so initialize database with one */ pr_fprintf(pr_stderr, "enter a password which will be used to encrypt your keys.\n" "the password should be at least 8 characters long,\n" "and should contain at least one non-alphabetic character.\n\n");
output = fopen("/dev/tty", "w"); if (
output == null) { pr_fprintf(pr_stderr, "error opening
output terminal for write\n"); return null; } for (;;) { if (p0) port_free(p0); p0 = getpassword(input,
output, "enter new password: ", checkpassword); if (p1) port_free(p1); p1 = getpassword(input, outpu...
...try again.\n"); } /* clear out the duplicate password string */ if (p1) { port_memset(p1, 0, port_strlen(p1)); port_free(p1); } fclose(input); fclose(
output); return p0; } /* * changepw */ secstatus changepw(pk11slotinfo *slot, char *oldpass, char *newpass, char *oldpwfile, char *newpwfile) { secstatus rv; secupwdata pwdata; secupwdata newpwdata; char *oldpw = null; char *newpw = null; if (oldpass) { pwdata.source = pw_plaintext; pwdata.data = oldpass; } else if (oldpwfile) { ...
Utilities for nss samples
unsigned int len); /* * getdigit */ extern int getdigit(char c); /* * hextobuf */ extern int hextobuf(unsigned char *instring, secitem *outbuf, prbool ishexdata); /* * filetoitem */ extern secstatus filetoitem(secitem *dst, prfiledesc *src); /* * checkpassword */ extern prbool checkpassword(char *cp); /* * getpassword */ extern char * getpassword(file *input, file *
output, char *prompt, prbool (*ok)(char *)); /* * filepasswd extracts the password from a text file * * storing passwords is often used with server environments * where prompting the user for a password or requiring it * to be entered in the commnd line is not a feasible option.
... { int len; char *end; len = port_strlen(cp); if (len < 8) { return pr_false; } end = cp + len; while (cp < end) { unsigned char ch = *cp++; if (!((ch >= 'a') && (ch <= 'z')) && !((ch >= 'a') && (ch <= 'z'))) { return pr_true; } } return pr_false; } /* * getpassword */ char* getpassword(file *input, file *
output, char *prompt, prbool (*ok)(char *)) { char phrase[200] = {'\0'}; int infd = fileno(input); int istty = isatty(infd); for (;;) { /* prompt for password */ if (istty) { fprintf(
output, "%s", prompt); fflush (
output); echooff(infd); } fgets(phrase, sizeof(phrase), input); if...
... (istty) { fprintf(
output, "\n"); echoon(infd); } /* stomp on newline */ phrase[port_strlen(phrase)-1] = 0; /* validate password */ if (!(*ok)(phrase)) { if (!istty) return 0; fprintf(
output, "password must be at least 8 characters long with one or more\n"); fprintf(
output, "non-alphabetic characters\n"); continue; } return (char*) port_strdup(phrase); } } /* * filepasswd extracts the password from a text file * * storing passwords is often used with server environments * where prompting the user for a password or requiring it * to be entered in the commnd line is not a feasible option.
Scripting Java
if we just view the method object by itself we can see the various overloaded forms of the method: js> f.listfiles function listfiles() {/* java.io.file[] listfiles() java.io.file[] listfiles(java.io.filenamefilter) java.io.file[] listfiles(java.io.filefilter) */} this
output shows that the file class defines three overloaded methods listfiles: one that takes no arguments, another with a filenamefilter argument, and a third with a filefilter argument.
...rn "g(string,int)"; } public string g(int i, string s) { return "g(int,string)"; } public static void main(string[] args) { overload o = new overload(); object[] a = new object[] { new integer(3), "hi", overload.class }; for (int i = 0; i != a.length; ++i) system.out.println(o.f(a[i])); } } when we compile and execute the program, it produces the
output f(object) f(object) f(object) however, if we write a similar script var o = new packages.overload(); var a = [ 3, "hi", packages.overload ]; for (var i = 0; i != a.length; ++i) print(o.f(a[i])); and execute it, we get the
output f(int) f(string) f(object) because rhino selects an overloaded method at runtime, it calls the more specific type that matches the argument.
... js> t = new java.lang.thread(r) thread[thread-2,5,main] js> t.start() js> running the final js prompt and the
output from the new thread may appear in either order, depending on thread scheduling.
64-bit Compatibility
add add qiadd piand and qiand pilsh lsh qilsh pirsh rsh qirsh pursh ush qursh pcmov cmov qcmov pior or qior pxor xor qxor addp iaddp qaddp peq - puge eq - uge qeq - quge pcall icall qcall the 32-bit versions have the following inputs and
outputs.
... 32-bit op inputs
output ld i32, i32 i32 ldc i32, i32 i32 add i32, i32 i32 and i32, i32 i32 lsh i32, i32 i32 rsh i32, i32 i32 ush i32 cmov i32, i32, i32 i32 or i32, i32 i32 xor i32, i32 i32 iaddp i32, i32 i32 eg - uge i32, i32 i32 icall n/a i32 the 64-bit versions have the following inputs and
outputs.
... 64-bit op inputs
output ldq i64, i32 i64 ldcq i64, i32 i64 qiadd i64, i64 i64 qiand i64, i64 i64 qilsh i64, i32 i64 qirsh i64, i32 i64 qursh i64, i32 i64 qcmov i32, i64, i64 i32 qior i64, i64 i64 qixor i64, i64 i64 qiaddp i64, i64 i64 qeq - quge i64, i64 i32 qcall n/a i64 extending or truncating native integers sometimes it is necessary to reduce a native integer to a 32-bit integer (for example, array or string lengths in tracemonkey) or extend a 32-bit integer to a native integer.
Profiling XPCShell
to use it, you need to enable it in your mozconfig: ac_add_options --enable-xpctools now you can profile an entire script by setting the environment variable <tt>mozilla_js_profiler_
output</tt> to a filename where you want the
output file.
... for example, on linux or macosx you do: export mozilla_js_profiler_
output=/tmp/profile.txt now, run the script using xpcshell.
... after running has finished, the
output file will contain a profile.
nsIAsyncStreamCopier
inherits from: nsirequest last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void asynccopy(in nsirequestobserver aobserver, in nsisupports aobservercontext); void init(in nsiinputstream asource, in nsi
outputstream asink, in nsieventtarget atarget, in boolean asourcebuffered, in boolean asinkbuffered, in unsigned long achunksize, in boolean aclosesource, in boolean aclosesink); methods asynccopy() starts the copy operation.
...void init( in nsiinputstream asource, in nsi
outputstream asink, in nsieventtarget atarget, in boolean asourcebuffered, in boolean asinkbuffered, in unsigned long achunksize, in boolean aclosesource, in boolean aclosesink ); parameters asource contains the data to be copied.
... see also nsiinputstream nsi
outputstream ...
nsIEditor
e parent, in long aposition); void splitnode(in nsidomnode existingrightnode, in long offset, out nsidomnode newleftnode); void joinnodes(in nsidomnode leftnode, in nsidomnode rightnode, in nsidomnode parent); void deletenode(in nsidomnode child); void marknodedirty(in nsidomnode node); direction controller void switchtextdirection();
output methods astring
outputtostring(in astring formattype, in unsigned long flags); example: // flags are declared in base/public/nsidocumentencoder.idl //
outputselectiononly = 1,
outputformatted = 2, //
outputraw = 4,
outputbodyonly = 8, //
outputpreformatted = 16,
outputwrap = 32, //
outputformatflowed = 64,
outputabsolutelinks = 258, //...
...
outputencodew3centities = 256,
outputcrlinebreak = 512, //
outputlflinebreak = 1024,
outputnoscriptcontent = 2048, //
outputnoframescontent = 4096,
outputnoformattinginpre = 8192, //
outputencodebasicentities=16384,
outputencodelatin1entities=32768, //
outputencodehtmlentities=65536,
outputpersistnbsp=131072 editorapi.
outputtostring('text/html', 2); editorapi.
outputtostring('text/plain', 4); //
output the body tag, body children and the html end tag (</html>).
...editorapi.
outputtostring('text/html', 8); // xml: all in xml with _moz_dirty="" in new tags, html tags are in upper case // application/xhtml+xml format do the same editorapi.
outputtostring('text/xml', 2); // the body is not recognized, everything is printed void
outputtostream(in nsi
outputstream astream, in astring formattype, in acstring charsetoverride, in unsigned long flags); listener methods void addeditorobserver(in nsieditorobserver observer);obsolete since gecko 18 void seteditorobserver(in editactionlistener observer); void removeeditorobserver(in nsieditorobserver observer obsolete since gecko 18); void addeditactionlistener(in nsieditactionlistener listener); void removeedi...
nsIHttpUpgradeListener
method overview void ontransportavailable(in nsisockettransport atransport, in nsiasyncinputstream asocketin, in nsiasync
outputstream asocketout); methods ontransportavailable() called when an http protocol upgrade attempt is completed, passing in the information needed by the protocol handler to take over the channel that is no longer being used by http.
...void ontransportavailable( in nsisockettransport atransport, in nsiasyncinputstream asocketin, in nsiasync
outputstream asocketout ); parameters atransport the nsisockettransport describing the socket connection between the browser and the server; this socket can now be used for the new protocol instead of http.
... asocketout the nsiasync
outputstream object representing the out stream for sending data to the server over the socket.
nsIMsgDatabase
nsimsgdbhdr getmsghdrforkey(in nsmsgkey key); nsimsgdbhdr getmsghdrformessageid(in string messageid); boolean containskey(in nsmsgkey key); nsimsgdbhdr createnewhdr(in nsmsgkey key); void addnewhdrtodb(in nsimsgdbhdr newhdr, in boolean notify); nsimsgdbhdr copyhdrfromexistinghdr(in nsmsgkey key, in nsimsgdbhdr existinghdr, in boolean addhdrtodb); void listallkeys(in nsmsgkeyarrayref
outputkeys); native code only!
... defaultviewflags nsmsgviewflagstypevalue readonly: defaultsorttype nsmsgviewsorttypevalue readonly: defaultsortorder nsmsgviewsortordervalue readonly: msghdrcachesize unsigned long folderstream nsi
outputstream summaryvalid boolean methods open() opens a database folder.
... nsimsgdbhdr createnewhdr(in nsmsgkey key); addnewhdrtodb() void addnewhdrtodb(in nsimsgdbhdr newhdr, in boolean notify); copyhdrfromexistinghdr() nsimsgdbhdr copyhdrfromexistinghdr(in nsmsgkey key, in nsimsgdbhdr existinghdr, in boolean addhdrtodb); listallkeys() [noscript] void listallkeys(in nsmsgkeyarrayref
outputkeys); enumeratemessages() nsisimpleenumerator enumeratemessages(); enumeratethreads() nsisimpleenumerator enumeratethreads(); synccounts() count the total and unread msgs, and adjust global count if needed.
nsIMsgFilterList
headers readonly attribute acstring nsimsgfilterlist::arbitraryheaders shoulddownloadallheaders readonly attribute boolean nsimsgfilterlist::shoulddownloadallheaders filtercount readonly attribute unsigned long nsimsgfilterlist::filtercount loggingenabled attribute boolean nsimsgfilterlist::loggingenabled defaultfile attribute nsilocalfile nsimsgfilterlist::defaultfile logstream attribute nsi
outputstream nsimsgfilterlist::logstream logurl readonly attribute acstring nsimsgfilterlist::logurl methods getfilterat() nsimsgfilter nsimsgfilterlist::getfilterat (in unsigned long filterindex ) getfilternamed() nsimsgfilter nsimsgfilterlist::getfilternamed (in astring filtername) setfilterat() nsimsgfilter nsimsgfilterlist::setfilterat ( in unsigned long filterindex, in nsims...
...nsertfilterat() void nsimsgfilterlist::insertfilterat ( in unsigned long filterindex, in nsimsgfilter filter ) movefilter() void nsimsgfilterlist::movefilter ( in nsimsgfilter filter, in nsmsgfiltermotionvalue motion ) createfilter() nsimsgfilter nsimsgfilterlist::createfilter ( in astring name ) savetofile() void nsimsgfilterlist::savetofile ( in nsi
outputstream stream ) parsecondition() void nsimsgfilterlist::parsecondition ( in nsimsgfilter afilter, in string condition ) savetodefaultfile() void nsimsgfilterlist::savetodefaultfile ( ) applyfilterstohdr() void nsimsgfilterlist::applyfilterstohdr ( in nsmsgfiltertypetype filtertype, in nsimsgdbhdr msghdr, in nsimsgfolder folder, in nsimsg...
...database db, in string headers, in unsigned long headersize, in nsimsgfilterhitnotify listener, in nsimsgwindow msgwindow, in nsilocalfile amessagefile ) writeinattr() void nsimsgfilterlist::writeintattr ( in nsmsgfilterfileattribvalue attrib, in long value, in nsi
outputstream stream ) writestrattr() void nsimsgfilterlist::writestrattr ( in nsmsgfilterfileattribvalue attrib, in string value, in nsi
outputstream stream ) writewstrattr() void nsimsgfilterlist::writewstrattr ( in nsmsgfilterfileattribvalue attrib, in string value, in nsi
outputstream stream ) matcho...
nsIXULTemplateResult
the template builder will reprocess the template using this result as the reference point and generate
output content that is expected to be inserted as children of the
output generated for this result.
...hasbeenremoved() indicate that the
output for a result has been removed and that the result is no longer being used by the builder.
...rulematched() indicate that a particular rule of a query has matched and that
output will be generated for it.
pyxpidl
generating c++ headers to generate c++ headers, use the header.py utility: sdkdir/sdk/bin/header.py --cachedir=<path> -o <
outputfilename.h> <filename.idl> generating typelibs generating typelib files is done using the typelib.py utility: sdkdir/sdk/bin/typelib.py --cachedir=<path> -o <
outputfilename.xpt> <filename.idl> comparing pyxpidl to xpidl this table provides a mapping of old xpidl options to pyxpidl.
...-w turn on warnings n/a (this is now the default and can't be turned off) -v verbose mode (nyi) n/a (feature removed) -t creates a typelib of a specific version number n/a (feature removed, and probably never actually worked) -i add an entry to start of include path for #include "nsifoo.idl" -i (unchanged) -o specify the base name for
output (-o /tmp/nsifoo for example) -o
outputfile (this isn't just the base name, but needs to include the extension; for example -o /tmp/nsifoo.idl) -e specify an explicit
output file name (-e /tmp/nsifoo.idl for example) n/a (this is subsumed by -o now) -d write dependencies (requires -e) -d (unchanged) -m specify
output mode n/a (feature removed; use he...
...ader.py or typelib.py specifically) it's worth noting that the old
output mode options for generating documentation and java interfaces (-m doc and -m java) have no equivalents in pyxpidl.
Xray vision
); components.utils.evalinsandbox(sandboxscript, sandbox); // date objects are xrayed console.log(sandbox.date.getfullyear()); // -> 2014 // but you can waive xray vision console.log(components.utils.waivexrays(sandbox.date).getfullyear()); // -> 1000 to test out examples like this, you can use the scratchpad in browser context for the code snippet, and the browser console to see the expected
output.
... to test out examples like this, you can use the scratchpad in browser context for the code snippet, and the browser console to see the expected
output.
...get: function() { return "wait, is this really a getter?"; }' + '});'; var sandbox = components.utils.sandbox("https://example.org/"); components.utils.evalinsandbox(sandboxscript, sandbox); // 1) trying to access properties in the prototype that have been redefined // (non-own properties) will show the original 'native' version // note that functions are not included in the
output console.log("1) property redefined in the prototype:"); console.log(sandbox.me.tosource()); // -> "({firstname:"joe", address:{street:"main street"}, lastname:"smith"})" // 2) trying to access properties on the object that shadow properties // on the prototype will show the original 'native' version console.log("2) property that shadows the prototype:"); console.log(sandbox.me.constructor); // -...
Mail composition back end
it is a simple interface that takes a consumer
output stream for the quoted data.
... the message will be
output in html form and it is up to the caller to handle plain text conversion.
... ns_imethod quotemessage( const prunichar *msguri, - the uri of the message to be quoted nsi
outputstream *outstream) = 0; - the consumer
output stream for the quoted data sample programs the mozilla/mailnews/compose/tests/ directory contains sample test programs for all of the above described interfaces.
AudioContext.createJavaScriptNode() - Web APIs
syntax var jsnode = audioctx.createjavascriptnode(buffersize, numinputchannels, num
outputchannels); parameters buffersize the buffer size must be in units of sample frames, i.e., one of: 256, 512, 1024, 2048, 4096, 8192, or 16384.
... num
outputchannels the number of
output channels in the audio stream.
... example the following script illustrates the use of createjavascriptnode(): var sinewave = function(context) { var that = this; this.x = 0; // initial sample number this.context = context; this.node = context.createjavascriptnode(1024, 1, 1); this.node.onaudioprocess = function(e) { that.process(e) }; } sinewave.prototype.process = function(e) { var data = e.
outputbuffer.getchanneldata(0); for (var i = 0; i < data.length; ++i) { data[i] = math.sin(this.x++); } } sinewave.prototype.play = function() { this.node.connect(this.context.destination); } sinewave.prototype.pause = function() { this.node.disconnect(); } see also generating tones with the web audio api exploring the html5 web audio: visualizing sound ...
AudioDestinationNode - Web APIs
audiodestinationnode has no
output (as it is the
output, no more audionode can be linked after it in the audio graph) and one input.
... number of inputs 1 number of
outputs 0 channel count mode "explicit" channel count 2 channel interpretation "speakers" properties inherits properties from its parent, audionode.
... example there is no complex set up for using an audiodestinationnode — by default, this simply represents the
output of the user's system (e.g.
AudioParamDescriptor - Web APIs
there we've created a simple node which
outputs white noise.
... here, additionally, we'll create a custom gain parameter, so we can directly change volume of the
output (although you could use gainnode to achieve this as well).
... // white-noise-processor.js class whitenoiseprocessor extends audioworkletprocessor { static get parameterdescriptors () { return [{ name: 'customgain', defaultvalue: 1, minvalue: 0, maxvalue: 1, automationrate: 'a-rate' }] } process (inputs,
outputs, parameters) { const
output =
outputs[0]
output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = (math.random() * 2 - 1) * (parameters['customgain'].length > 1 ?
AudioWorkletGlobalScope - Web APIs
examples in this example we
output all global properties into the console in the constructor of a custom audioworkletprocessor.
... // test-processor.js class testprocessor extends audioworkletprocessor { constructor () { super() // current sample-frame and time at the moment of instantiation // to see values change, you can put these two lines in process method console.log(currentframe) console.log(currenttime) } // the process method is required - simply
output silence, // which the
outputs are already filled with process (inputs,
outputs, parameters) { return true } } // the sample rate is not going to change ever, // because it's a read-only property of a baseaudiocontext // and is set only during its instantiation console.log(samplerate) // you can declare any variables and use them in your processors // for example it may be an arraybuff...
...we should see the
output of console.log calls in the console: const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('test-processor.js') const testnode = new audioworkletnode(audiocontext, 'test-processor') testnode.connect(audiocontext.destination) specifications specification status comment web audio apithe definition of 'audioworkletglobalscope' in that specification.
AudioWorkletNode.parameters - Web APIs
there we've created a simple node which
outputs white noise.
... here, additionally, we'll create a custom gain parameter, so we can directly change volume of the
output (although you could use gainnode to achieve this as well).
... // white-noise-processor.js class whitenoiseprocessor extends audioworkletprocessor { static get parameterdescriptors () { return [{ name: 'customgain', defaultvalue: 1, minvalue: 0, maxvalue: 1, automationrate: 'a-rate' }] } process (inputs,
outputs, parameters) { const
output =
outputs[0]
output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = (math.random() * 2 - 1) * (parameters['customgain'].length > 1 ?
AudioWorkletNode.port - Web APIs
examples to demonstrate bidirectional communication capabilities, we'll create an audioworkletprocessor, which will
output silence and respond to ping requests from its audioworkletnode.
... // ping-pong-processor.js class pingpongprocessor extends audioworkletprocessor { constructor (...args) { super(...args) this.port.onmessage = (e) => { console.log(e.data) this.port.postmessage('pong') } } process (inputs,
outputs, parameters) { return true } } registerprocessor('ping-pong-processor', pingpongprocessor) now in our main scripts file we'll load the processor, create an instance of audioworkletnode passing the name of the processor, and connect the node to an audio graph.
...'ping-pong-processor.js') const pingpongnode = new audioworkletnode(audiocontext, 'ping-pong-processor') // send the message containing 'ping' string // to the audioworkletprocessor from the audioworkletnode every second setinterval(() => pingpongnode.port.postmessage('ping'), 1000) pingpongnode.port.onmessage = (e) => console.log(e.data) pingpongnode.connect(audiocontext.destination) this will
output "ping" and "pong" strings to the console every second.
AudioWorkletProcessor.parameterDescriptors (static getter) - Web APIs
there we've created a simple node which
outputs white noise.
... here, additionally, we'll create a custom gain parameter, so we can directly change volume of the
output (although you could use gainnode to achieve this as well).
... // white-noise-processor.js class whitenoiseprocessor extends audioworkletprocessor { static get parameterdescriptors () { return [{ name: 'customgain', defaultvalue: 1, minvalue: 0, maxvalue: 1, automationrate: 'a-rate' }] } process (inputs,
outputs, parameters) { const
output =
outputs[0]
output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = (math.random() * 2 - 1) * (parameters['customgain'].length > 1 ?
AudioWorkletProcessor.port - Web APIs
examples to demonstrate bidirectional communication capabilities, we'll create an audioworkletprocessor, which will
output silence and respond to ping requests from its audioworkletnode.
... // ping-pong-processor.js class pingpongprocessor extends audioworkletprocessor { constructor (...args) { super(...args) this.port.onmessage = (e) => { console.log(e.data) this.port.postmessage('pong') } } process (inputs,
outputs, parameters) { return true } } registerprocessor('ping-pong-processor', pingpongprocessor) now in our main scripts file we'll load the processor, create an instance of audioworkletnode passing the name of the processor, and connect the node to an audio graph.
...'ping-pong-processor.js') const pingpongnode = new audioworkletnode(audiocontext, 'ping-pong-processor') // send the message containing 'ping' string // to the audioworkletprocessor from the audioworkletnode every second setinterval(() => pingpongnode.port.postmessage('ping'), 1000) pingpongnode.port.onmessage = (e) => console.log(e.data) pingpongnode.connect(audiocontext.destination) this will
output "ping" and "pong" strings to the console every second.
ChannelSplitterNode.ChannelSplitterNode() - Web APIs
the channelsplitternode() constructor of the web audio api creates a new channelsplitternode object instance, representing a node that splits the input into a separate
output for each of the source node's audio channels.
... options optional a channelsplitteroptions dictionary object defining the properties you want the channelsplitternode to have (it also inherits the options defined in the audionodeoptions dictionary): numberof
outputs: a number defining the number of inputs the channelsplitternode should have.
... example var ac = new audiocontext(); var options = { numberof
outputs : 2 } var mysplitter = new channelsplitternode(ac, options); specifications specification status comment web audio apithe definition of 'channelsplitternode' in that specification.
Using channel messaging - Web APIs
var input = document.getelementbyid('message-input'); var
output = document.getelementbyid('message-
output'); var button = document.queryselector('button'); var iframe = document.queryselector('iframe'); var channel = new messagechannel(); var port1 = channel.port1; // wait for the iframe to load iframe.addeventlistener("load", onload); function onload() { // listen for button clicks button.addeventlistener('click', onclick); // listen for messages o...
...n port1 port1.onmessage = onmessage; // transfer port2 to the iframe iframe.contentwindow.postmessage('init', '*', [channel.port2]); } // post a message on port1 when the button is clicked function onclick(e) { e.preventdefault(); port1.postmessage(input.value); } // handle messages received on port1 function onmessage(e) {
output.innerhtml = e.data; input.value = ''; } we start off by creating a new message channel by using the messagechannel() constructor.
... // handle messages received on port1 function onmessage(e) {
output.innerhtml = e.data; input.value = ''; } when a message is received back from the iframe confirming that the original message was received successfully, this simply
outputs the confirmation to a paragraph and empties the text input ready for the next message to be sent.
console.count() - Web APIs
if supplied, count()
outputs the number of times it has been called with that label.
... examples for example, given code like this: let user = ""; function greet() { console.count(); return "hi " + user; } user = "bob"; greet(); user = "alice"; greet(); greet(); console.count(); console
output will look something like this: "default: 1" "default: 2" "default: 3" "default: 4" the label is displayed as default because no explicit label was supplied.
... if we pass the user variable as the label argument to the first invocation of count(), and the string "alice" to the second: let user = ""; function greet() { console.count(user); return "hi " + user; } user = "bob"; greet(); user = "alice"; greet(); greet(); console.count("alice"); we will see
output like this: "bob: 1" "alice: 1" "alice: 2" "alice: 3" we're now maintaining separate counts based only on the value of label.
DOMTokenList - Web APIs
such a set is returned by element.classlist, htmllinkelement.rellist, htmlanchorelement.rellist, htmlareaelement.rellist, htmliframeelement.sandbox, or html
outputelement.htmlfor.
... first, the html: <p class="a b c"></p> now the javascript: let para = document.queryselector("p"); let classes = para.classlist; para.classlist.add("d"); para.textcontent = `paragraph classlist is "${classes}"`; the
output looks like this: trimming of whitespace and removal of duplicates methods that modify the domtokenlist (such as domtokenlist.add()) automatically trim any excess whitespace and remove duplicate values from the list.
... for example: <span class=" d d e f"></span> let span = document.queryselector("span"); let classes = span.classlist; span.classlist.add("x"); span.textcontent = `span classlist is "${classes}"`; the
output looks like this: specifications specification status comment domthe definition of 'domtokenlist' in that specification.
DelayNode - Web APIs
the delaynode interface represents a delay-line; an audionode audio-processing module that causes a delay between the arrival of an input data and its propagation to the
output.
... a delaynode always has exactly one input and one
output, both with the same amount of channels.
... number of inputs 1 number of
outputs 1 channel count mode "max" channel count 2 (not used in the default count mode) channel interpretation "speakers" constructor delaynode() creates a new instance of an delaynode object instance.
Examples of web and XML development using the DOM - Web APIs
example shows the use of the height and width properties alongside images of varying dimensions: <!doctype html> <html lang="en"> <head> <title>width/height example</title> <script> function init() { var arrimages = new array(3); arrimages[0] = document.getelementbyid("image1"); arrimages[1] = document.getelementbyid("image2"); arrimages[2] = document.getelementbyid("image3"); var obj
output = document.getelementbyid("
output"); var strhtml = "<ul>"; for (var i = 0; i < arrimages.length; i++) { strhtml += "<li>image" + (i+1) + ": height=" + arrimages[i].height + ", width=" + arrimages[i].width + ", style.height=" + arrimages[i].style.height + ", style.width=" + arrimages[i].style.width + "<\/li>"; } strhtml += "...
...<\/ul>"; obj
output.innerhtml = strhtml; } </script> </head> <body onload="init();"> <p>image 1: no height, width, or style <img id="image1" src="https://udn.realityripple.com/samples/d2/8ba7141ed1.gif"> </p> <p>image 2: height="50", width="500", but no style <img id="image2" src="https://udn.realityripple.com/samples/d2/8ba7141ed1.gif" height="50" width="500"> </p> <p>image 3: no height, width, but style="height: 50px; width: 500px;" <img id="image3" src="https://udn.realityripple.com/samples/d2/8ba7141ed1.gif" style="height: 50px; width: 500px;"> </p> <div id="
output"> </div> </body> </html> example 2: image attributes <!doctype html> <html lang="en"> <head> <title>modifying an image border</title> <script> function setborderwidth(width) { document...
... = document.stylesheets; for(var i = 0; i < ss.length; i++) { for(var j = 0; j < ss[i].cssrules.length; j++) { dump( ss[i].cssrules[j].selectortext + "\n" ); } } for a document with a single stylesheet in which the following three rules are defined: body { background-color: darkblue; } p { font-face: arial; font-size: 10pt; margin-left: .125in; } #lumpy { display: none; } this script
outputs the following: body p #lumpy example 5: event propagation this example demonstrates how events fire and are handled in the dom in a very simple way.
DynamicsCompressorNode - Web APIs
dynamicscompressornode is an audionode that has exactly one input and one
output; it is created using the audiocontext.createdynamicscompressor() method.
... number of inputs 1 number of
outputs 1 channel count mode "clamped-max" channel count 2 channel interpretation "speakers" constructor dynamicscompressornode() creates a new instance of an dynamicscompressornode object.
... dynamicscompressornode.ratio read only is a k-rate audioparam representing the amount of change, in db, needed in the input for a 1 db change in the
output.
Using files from web applications - Web APIs
selected files: <span id="filenum">0</span>; total size: <span id="filesize">0</span> </div> <div><input type="submit" value="send file"></div> </form> <script> function updatesize() { let nbytes = 0, ofiles = this.files, nfiles = ofiles.length; for (let nfileid = 0; nfileid < nfiles; nfileid++) { nbytes += ofiles[nfileid].size; } let s
output = nbytes + " bytes"; // optional code for multiples approximation const amultiples = ["kib", "mib", "gib", "tib", "pib", "eib", "zib", "yib"]; for (nmultiple = 0, napprox = nbytes / 1024; napprox > 1; napprox /= 1024, nmultiple++) { s
output = napprox.tofixed(3) + " " + amultiples[nmultiple] + " (" + nbytes + " bytes)"; } // end of optional code document.getelementbyi...
...d("filenum").innerhtml = nfiles; document.getelementbyid("filesize").innerhtml = s
output; } document.getelementbyid("uploadinput").addeventlistener("change", updatesize, false); </script> </body> </html> using hidden file input elements using the click() method you can hide the admittedly ugly file <input> element and present your own interface for opening the file picker and displaying which file or files the user has selected.
... function handlefiles(files) { for (let i = 0; i < files.length; i++) { const file = files[i]; if (!file.type.startswith('image/')){ continue } const img = document.createelement("img"); img.classlist.add("obj"); img.file = file; preview.appendchild(img); // assuming that "preview" is the div
output where the content will be displayed.
HTMLImageElement.naturalHeight - Web APIs
html <div class="box"> <img src="/files/16797/clock-demo-400px.png" class="image"> </div> <div class="
output"> </div> the html features a 400x398 pixel image which is placed inside a <div>.
... css .box { width: 200px; height: 200px; } .image { width: 100%; } .
output { padding-top: 2em; } the main thing of note in the css above is that the style used for the container the image will be drawn in is 200px wide, and the image will be drawn to fill its width (100%).
... javascript let
output = document.queryselector(".
output"); let image = document.queryselector("img"); window.addeventlistener("load", event => {
output.innerhtml += `natural size: ${image.naturalwidth} x ` + `${image.naturalheight} pixels<br>`;
output.innerhtml += `displayed size: ${image.width} x ` + `${image.height} pixels`; }); the javascript code simply dumps the natural and as-displayed sizes into the <div> with the class
output.
HTMLImageElement.naturalWidth - Web APIs
html <div class="box"> <img src="/files/16797/clock-demo-400px.png" class="image"> </div> <div class="
output"> </div> the html features a 400x398 pixel image which is placed inside a <div>.
... css .box { width: 200px; height: 200px; } .image { width: 100%; } .
output { padding-top: 2em; } the main thing of note in the css above is that the style used for the container the image will be drawn in is 200px wide, and the image will be drawn to fill its width (100%).
... javascript let
output = document.queryselector(".
output"); let image = document.queryselector("img"); window.addeventlistener("load", event => {
output.innerhtml += `natural size: ${image.naturalwidth} x ` + `${image.naturalheight} pixels<br>`;
output.innerhtml += `displayed size: ${image.width} x ` + `${image.height} pixels`; }); the javascript code simply dumps the natural and as-displayed sizes into the <div> with the class
output.
HTMLMediaElement.defaultMuted - Web APIs
the htmlmediaelement.defaultmuted property reflects the muted html attribute, which indicates whether the media element's audio
output should be muted by default.
...to mute and unmute the audio
output, use the muted property.
...a value of true means that the audio
output will be muted by default.
HTMLMediaElement.sinkId - Web APIs
the htmlmediaelement.sinkid read-only property returns a domstring that is the unique id of the audio device delivering
output.
... syntax var sinkid = htmlmediaelement.sinkid specifications specification status comment audio
output devices apithe definition of 'sinkid' in that specification.
...older versions of this spec were called "media capture
output".
HTMLMediaElement - Web APIs
htmlmediaelement.defaultmuted a boolean that reflects the muted html attribute, which indicates whether the media element's audio
output should be muted by default.
... htmlmediaelement.sinkid read only returns a domstring that is the unique id of the audio device delivering
output, or an empty string if it is using the user agent default.
... htmlmediaelement.setsinkid() sets the id of the audio device to use for
output and returns a promise.
HTMLSelectElement.selectedOptions - Web APIs
<label for="foods">what do you want to eat?</label><br> <select id="foods" name="foods" size="7" multiple> <option value="1">burrito</option> <option value="2">cheeseburger</option> <option value="3">double bacon burger supreme</option> <option value="4">pepperoni pizza</option> <option value="5">taco</option> </select> <br> <button name="order" id="order"> order now </button> <p id="
output"> </p> the <select> element is set to allow multiple items to be selected, and it is 7 rows tall.
... javascript the javascript code that establishes the event handler for the button, as well as the event handler itself, looks like this: let orderbutton = document.getelementbyid("order"); let itemlist = document.getelementbyid("foods"); let
outputbox = document.getelementbyid("
output"); orderbutton.addeventlistener("click", function() { let collection = itemlist.selectedoptions; let
output = ""; for (let i=0; i<collection.length; i++) { if (
output === "") {
output = "your order for the following items has been placed: "; }
output += collection[i].label; if (i === (collection.length - 2) && (collection.length < 3)) {
output += ...
..." and "; } else if (i < (collection.length - 2)) {
output += ", "; } else if (i === (collection.length - 2)) {
output += ", and "; } } if (
output === "") {
output = "you didn't order anything!"; }
outputbox.innerhtml =
output; }, false); this script sets up a click event listener on the "order now" button.
IIRFilterNode - Web APIs
number of inputs 1 number of
outputs 1 channel count mode "max" channel count same as on the input channel interpretation "speakers" typically, it's best to use the biquadfilternode interface to implement higher-order filters.
... iirfilternodes have a tail-time reference; they continue to
output non-silent audio with zero input.
... as an iir filter, the non-zero input continues forever, but this can be limited after some finite time in practice, when the
output has approached zero closely enough.
MIDIAccess - Web APIs
the midiaccess interface of the web midi api provides methods for listing midi input and
output devices, and obtaining access to those devices.
... midiaccess.
outputs read only returns an instance of midi
outputmap which provides access to any available midi
output ports.
... examples navigator.requestmidiaccess() .then(function(access) { // get lists of available midi controllers const inputs = access.inputs.values(); const
outputs = access.
outputs.values(); access.onstatechange = function(e) { // print information about the (dis)connected midi controller console.log(e.port.name, e.port.manufacturer, e.port.state); }; }); specifications specification status comment web midi api working draft initial definition.
MediaDevices.enumerateDevices() - Web APIs
the mediadevices method enumeratedevices() requests a list of the available media input and
output devices, such as microphones, cameras, headsets, and so forth.
...each object in the array describes one of the available media input and
output devices.
...it simply
outputs a list of the device ids, with their labels if available.
MediaElementAudioSourceNode - Web APIs
a mediaelementsourcenode has no inputs and exactly one
output, and is created using the audiocontext.createmediaelementsource() method.
... the amount of channels in the
output equals the number of channels of the audio referenced by the htmlmediaelement used in the creation of the node, or is 1 if the htmlmediaelement has no audio.
... number of inputs 0 number of
outputs 1 channel count defined by the media in the htmlmediaelement passed to the audiocontext.createmediaelementsource method that created it.
MediaStreamTrack.enabled - Web APIs
when enabled, a track's data is
output from the source to the destination; otherwise, empty frames are
output.
... the value of enabled, in essence, represents what a typical user would consider the muting state for a track, whereas the muted property indicates a state in which the track is temporarily unable to
output data, such as a scenario in which frames have been lost in transit.
... syntax const enabledflag = track.enabled track.enabled = [true | false] value when true, enabled indicates that the track is permitted to render its actual media to the
output.
MediaStreamTrackAudioSourceNode - Web APIs
a mediastreamtrackaudiosourcenode has no inputs and exactly one
output, and is created using the audiocontext.createmediastreamtracksource() method.
... number of inputs 0 number of
outputs 1 channel count defined by the first audio mediastreamtrack passed to the audiocontext.createmediastreamtracksource() method that created it.
... var pre = document.queryselector('pre'); var video = document.queryselector('video'); var myscript = document.queryselector('script'); var range = document.queryselector('input'); // getusermedia block - grab stream // put it into a mediastreamaudiosourcenode // also
output the visuals into a video element if (navigator.mediadevices) { console.log('getusermedia supported.'); navigator.mediadevices.getusermedia ({audio: true, video: true}) .then(function(stream) { video.srcobject = stream; video.onloadedmetadata = function(e) { video.play(); video.muted = true; }; // create a mediastreamaudiosource...
Capabilities, constraints, and settings - Web APIs
logelement a <div> into which any error messages or other log-type
output will be written.
...if either call to json.parse() throws an exception, handleerror() is called to
output the error message to the log.
... if an error occurs applying either set of constraints, handleerror() is used to
output a message into the log.
RTCIceCandidateStats.deleted - Web APIs
only candidates which have not been deleted are included in the
output.
... window.setinterval(function() { mypeerconnection.getstats(null).then(stats => { let stats
output = ""; stats.foreach(report => { if ((stats.type === "local-candidate" || stats.type === "remote.candidate") && !stats.deleted) { stats
output += `<h2>report: ${report.type}</h3>\n<strong>id:</strong> ${report.id}<br>\n` + `<strong>timestamp:</strong> ${report.timestamp}<br>\n`; // now the statistics for this report; we intentially drop the ones we // sorted to the top above object.keys(report).foreach(statname => { if (statname !== "id" && statname !== "timestamp" && statname !== "type") { stats
output += `<strong>${statname}:</strong> ${report[statname]}<br>\n`; } }); } }); ...
... document.queryselector(".stats-box").innerhtml = stats
output; }); }, 1000); specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatestats.deleted' in that specification.
RTCIceCandidateStats.networkType - Web APIs
example this example sets up a periodic function using setinterval() that
outputs statistics reports for candidates that use or would use a cellular data network to a log view.
... window.setinterval(function() { mypeerconnection.getstats(null).then(stats => { let stats
output = ""; stats.foreach(report => { if ((stats.type === "local-candidate" || stats.type === "remote.candidate") && stats.networktype === "cellular") { stats
output += `<h2>report: ${report.type}</h3>\n<strong>id:</strong> ${report.id}<br>\n` + `<strong>timestamp:</strong> ${report.timestamp}<br>\n`; // now the statistics for this report; we intentially drop the ones we // sorted to the top above object.keys(report).foreach(statname => { if (statname !== "id" && statname !== "timestamp" && statname !== "type") { stats
output += `<strong>${statname}:</strong> ${report[statname]}<br>\n`; } }); ...
... } }); document.queryselector(".stats-box").innerhtml = stats
output; }); }, 1000); ...
RTCPeerConnection.getStats() - Web APIs
no
output is expected from the function.
... window.setinterval(function() { mypeerconnection.getstats(null).then(stats => { let stats
output = ""; stats.foreach(report => { stats
output += `<h2>report: ${report.type}</h3>\n<strong>id:</strong> ${report.id}<br>\n` + `<strong>timestamp:</strong> ${report.timestamp}<br>\n`; // now the statistics for this report; we intentially drop the ones we // sorted to the top above object.keys(report).foreach(statname => { if (statname !== "...
...id" && statname !== "timestamp" && statname !== "type") { stats
output += `<strong>${statname}:</strong> ${report[statname]}<br>\n`; } }); }); document.queryselector(".stats-box").innerhtml = stats
output; }); }, 1000); this works by calling getstats(), then, when the promise is resolved, iterates over the rtcstats objects on the returned rtcstatsreport.
Selection.setBaseAndExtent() - Web APIs
we also have a button that when pressed invokes a function that runs the setbaseandextent() method with the specified offsets, and copies the selection into the
output paragraph at the very bottom of the html.
...o"><span>car</span><span>bike</span><span>boat</span><span>plane</span></p> </div> <div> <p> <label for="aoffset">anchor offset</label> <input id="aoffset" name="aoffset" type="number" value="0"> </p> <p> <label for="foffset">focus offset</label> <input id="foffset" name="foffset" type="number" value="0"> </p> <p><button>capture selection</button></p> </div> <p><strong>
output</strong>: <span class="
output"></span></p> the javascript looks like so: var one = document.queryselector('.one'); var two = document.queryselector('.two'); var aoffset = document.getelementbyid('aoffset'); var foffset = document.getelementbyid('foffset'); var button = document.queryselector('button'); var
output = document.queryselector('.
output'); var selection; button.onclick = function...
...() { try { selection = document.getselection(); selection.setbaseandextent(one, aoffset.value, two, foffset.value); var text = selection.tostring();
output.textcontent = text; } catch(e) {
output.textcontent = e.message; } } play with the live example below, setting different offset values to see how this affects the selection.
Multi-touch interaction - Web APIs
<div id="target1"> tap, hold or swipe me 1</div> <div id="target2"> tap, hold or swipe me 2</div> <div id="target3"> tap, hold or swipe me 3</div> <div id="target4"> tap, hold or swipe me 4</div> <!-- ui for logging/bebugging --> <button id="log" onclick="enablelog(event);">start/stop event logging</button> <button id="clearlog" onclick="clearlog(event);">clear the log</button> <p></p> <
output></
output> miscellaneous functions these functions support the application but aren't directly involved with the event flow.
...false : true; } function log(name, ev, printtargetids) { var o = document.getelementsbytagname('
output')[0]; var s = name + ": touches = " + ev.touches.length + " ; targettouches = " + ev.targettouches.length + " ; changedtouches = " + ev.changedtouches.length; o.innerhtml += s + " "; if (printtargetids) { s = ""; for (var i=0; i < ev.targettouches.length; i++) { s += "...
... id = " + ev.targettouches[i].identifier + " "; } o.innerhtml += s; } } function clearlog(event) { var o = document.getelementsbytagname('
output')[0]; o.innerhtml = ""; } related topics and resources pointer events ...
WebGL2RenderingContext.drawBuffers() - Web APIs
possible values are: gl.none: fragment shader
output is not written into any color buffer.
... gl.back: fragment shader
output is written into the back color buffer.
... gl.color_attachment{0-15}: fragment shader
output is written in the nth color attachment of the current framebuffer.
WebGLRenderingContext.makeXRCompatible() - Web APIs
javascript the code that handles starting up graphics, switching to vr mode, and so forth looks like this: const
outputcanvas = document.queryselector(".
output-canvas"); const gl =
outputcanvas.getcontext("webgl"); let xrsession = null; let usingxr = false; let currentscene = "scene1"; let glstartbutton; let xrstartbutton; window.addeventlistener("load", (event) => { loadsceneresources(currentscene); glstartbutton.addeventlistener("click", handlestartbuttonclick); xrstartbutton.addeventlistener("click", ha...
...ndlestartbuttonclick); });
outputcanvas.addeventlistener("webglcontextlost", (event) => { /* the context has been lost but can be restored */ event.canceled = true; }); /* when the gl context is reconnected, reload the resources for the current scene.
... */
outputcanvas.addeventlistener("webglcontextrestored", (event) => { loadsceneresources(currentscene); }); async function onstartedxrsession(xrsession) { try { await gl.makexrcompatible(); } catch(err) { switch(err) { case aborterror: showsimplemessagebox("unable to transfer the game to your xr headset.", "cancel"); break; case invalidstateerror: showsimplemessagebox("you don't appear to have a compatible xr headset available.", "cancel"); break; default: handlefatalerror(err); break; } xrsession.end(); } } async function handlestartbuttonclick(event) { if (event.target.classlist.contains("use-webxr") && navigator.xr) { try { xrsession = await navigator.xr.requestsession("immersive-vr"); ...
Writing a WebSocket server in C# - Web APIs
(byte)(bytes[offset + i] ^ masks[i % 4]); string text = encoding.utf8.getstring(decoded); console.writeline("{0}", text); } else console.writeline("mask bit not set"); console.writeline(); } } } } client.html <!doctype html> <style> textarea { vertical-align: bottom; } #
output { overflow: auto; } #
output > p { overflow-wrap: break-word; } #
output span { color: blue; } #
output span.error { color: red; } </style> <h2>websocket test</h2> <textarea cols=60 rows=6></textarea> <button>send</button> <div id=
output></div> <script> // http://www.websocket.org/echo.html var button = document.queryselector("button"),
output = document.queryselector("#...
...
output"), textarea = document.queryselector("textarea"), // wsuri = "ws://echo.websocket.org/", wsuri = "ws://127.0.0.1/", websocket = new websocket(wsuri); button.addeventlistener("click", onclickbutton); websocket.onopen = function (e) { writetoscreen("connected"); dosend("websocket rocks"); }; websocket.onclose = function (e) { writetoscreen("disconnected"); }; websocket.onmessage = function (e) { writetoscreen("<span>response: " + e.data + "</span>"); }; websocket.onerror = function (e) { writetoscreen("<span class=error>error:</span> " + e.data); }; function dosend(message) { writetoscreen("sent: " + message); websocket.send(message); } function writ...
...etoscreen(message) {
output.insertadjacenthtml("afterbegin", "<p>" + message + "</p>"); } function onclickbutton() { var text = textarea.value; text && dosend(text); textarea.value = ""; textarea.focus(); } </script> related writing websocket servers ...
WebXR Device API - Web APIs
the webxr device api implements the core of the webxr feature set, managing the selection of
output devices, render the 3d scene to the chosen device at the appropriate frame rate, and manage motion vectors created using input controllers.
... to accomplish these things, the webxr device api provides the following key capabilities: find compatible vr or ar
output devices render a 3d scene to the device at an appropriate frame rate (optionally) mirror the
output to a 2d display create vectors representing the movements of input controls at the most basic level, a scene is presented in 3d by computing the perspective to apply to the scene in order to render it from the viewpoint of each of the user's eyes by computing the position of each eye and rende...
... xrrenderstate provides a set of configurable properties which change how the imagery
output by an xrsession is composited.
Using IIR filters - Web APIs
// arrays for our frequency response const totalarrayitems = 30; let myfrequencyarray = new float32array(totalarrayitems); let magresponse
output = new float32array(totalarrayitems); let phaseresponse
output = new float32array(totalarrayitems); let's fill our first array with frequency values we want data to be returned on: myfrequencyarray = myfrequencyarray.map(function(item, index) { return math.pow(1.4, index); }); we could go for a linear approach, but it's far better when working with frequencies to take a log approach, so le...
... now let's get our response data: iirfilter.getfrequencyresponse(myfrequencyarray, magresponse
output, phaseresponse
output); we can use this data to draw a filter frequency plot.
...cing+fontsize); canvasctx.filltext('g', spacing-fontsize, (height-spacing+fontsize)/2); canvasctx.filltext('0', spacing-fontsize, height-spacing+fontsize); canvasctx.filltext('hz', width/2, height-spacing+fontsize); canvasctx.filltext('20k', width-spacing, height-spacing+fontsize); // loop over our magnitude response data and plot our filter canvasctx.beginpath(); for(let i = 0; i < magresponse
output.length; i++) { if (i === 0) { canvasctx.moveto(spacing, height-(magresponse
output[i]*100)-spacing ); } else { canvasctx.lineto((width/totalarrayitems)*i, height-(magresponse
output[i]*100)-spacing ); } } canvasctx.stroke(); summary that's it for our iirfilter demo.
self.createImageBitmap() - Web APIs
resizewidth: a long integer that indicates the
output width.
... resizeheight: a long integer that indicates the
output height.
... resizequality: specifies the algorithm to be used for resizing the input to match the
output dimensions.
XSLT Basic Example - Web APIs
an xslt stylesheet starts with the xsl:stylesheet element, which contains all the templates used to create the final
output.
...the template that matches the root node
outputs the article's title and then says to process all templates (via apply-templates) that match author nodes which are children of the authors node.
...bar</author> </authors> <body>this is my article text.</body> </article> xsl stylesheet (example.xsl) : <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:
output method="text"/> <xsl:template match="/"> article - <xsl:value-of select="/article/title"/> authors: <xsl:apply-templates select="/article/authors/author"/> </xsl:template> <xsl:template match="author"> - <xsl:value-of select="." /> </xsl:template> </xsl:stylesheet> browser
output : article - my article authors: - mr.
XSL Transformations in Mozilla FAQ - Web APIs
it (afaict) serializes and parses the
output to generate what it actually renders.
... can i do disable-
output-escaping?
...disabling
output escaping requires us to add a parsing step to our
output generation, which we don't.
update - CSS: Cascading Style Sheets
the update css media feature can be used to test how frequently (if at all) the
output device is able to modify the appearance of content.
... slow the layout may change dynamically according to the usual rules of css, but the
output device is not able to render or display changes quickly enough for them to be perceived as a smooth animation.
... fast the layout may change dynamically according to the usual rules of css, and the
output device is not unusually constrained in speed, so regularly-updating things like css animations can be used.
<filter-function> - CSS: Cascading Style Sheets
d="filter-select"> <option selected>blur</option> <option>brightness</option> <option>contrast</option> <option>drop-shadow</option> <option>grayscale</option> <option>hue-rotate</option> <option>invert</option> <option>opacity</option> <option>saturate</option> <option>sepia</option> </select> </li> <li> <input type="range"><
output></
output> </li> <li> <p>current value: <code></code></p> </li> </ul> css div { width: 300px; height: 300px; background: url(https://media.prod.mdn.mozit.cloud/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png) no-repeat center; } li { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; } input { width: 60% } outp...
...ut { width: 5%; text-align: center; } select { width: 40%; margin-left: 2px; } javascript const selectelem = document.queryselector('select'); const divelem = document.queryselector('div'); const slider = document.queryselector('input'); const
output = document.queryselector('
output'); const curvalue = document.queryselector('p code'); selectelem.addeventlistener('change', () => { setslider(selectelem.value); setdiv(selectelem.value); }); slider.addeventlistener('input', () => { setdiv(selectelem.value); }); function setslider(filter) { if(filter === 'blur') { slider.value = 0; slider.min = 0; slider.max = 30; slider.step = 1; slider.setattribute('data-unit', 'px'); } else if(filter === 'brightness' || filter === 'contrast' || filter === 'saturate') { ...
...r === 'drop-shadow') { divelem.style.filter = `${selectelem.value}(${math.round(slider.value)}${slider.getattribute('data-unit')} ${math.round(slider.value)}${slider.getattribute('data-unit')} ${math.round(math.abs(slider.value/2))}${slider.getattribute('data-unit')})`; } else { divelem.style.filter = `${selectelem.value}(${slider.value}${slider.getattribute('data-unit')}`; } update
output(); updatecurvalue(); } function update
output() {
output.textcontent = slider.value; } function updatecurvalue() { curvalue.textcontent = `filter: ${divelem.style.filter}`; } setslider(selectelem.value); setdiv(selectelem.value); result specifications specification status filter effects module level 1the definition of 'filter-function' in that specification.
HTML5 - Developer guides
device access: allowing for the usage of various input and
output devices.
... forms improvements a look at the constraint validation api, several new attributes, new values for the <input> attribute type and the new <
output> element.
... new semantic elements beside sections, media and forms elements, there are numerous new elements, like <mark>, <figure>, <figcaption>, <data>, <time>, <
output>, <progress>, or <meter> and <main>, increasing the number of valid html5 elements.
HTML attribute reference - HTML: Hypertext Markup Language
for <label>, <
output> describes elements which belongs to this one.
... form <button>, <fieldset>, <input>, <keygen>, <label>, <meter>, <object>, <
output>, <progress>, <select>, <textarea> indicates the form that is the owner of the element.
... name <button>, <form>, <fieldset>, <iframe>, <input>, <keygen>, <object>, <
output>, <select>, <textarea>, <map>, <meta>, <param> name of the element.
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
<kbd> may be nested in various combinations with the <samp> (sample
output) element to represent various forms of input or
output based on visual cues.
... result the
output looks like this without a style sheet applied: with custom styles we can make more sense of this by adding some css: css we add a new style for <kbd> elements, key, which we can apply when rendering keyboard keys: kbd.key { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } html then we update the html to use this class on the keys in the
output to be presented: <p...
... <p>if a syntax error occurs, the tool will
output the initial command you typed for your review:</p> <blockquote> <samp><kbd>custom-git ad my-new-file.cpp</kbd></samp> </blockquote> representing onscreen input options nesting a <samp> element inside a <kbd> element represents input which is based on text presented by the system, such as the names of menus and menu items, or the names of buttons displayed on the screen.
<ol>: The Ordered List element - HTML: Hypertext Markup Language
examples simple example <ol> <li>fee</li> <li>fi</li> <li>fo</li> <li>fum</li> </ol> the above html will
output: using roman numeral type <ol type="i"> <li>introduction</li> <li>list of greivances</li> <li>conclusion</li> </ol> the above html will
output: using the start attribute <p>finishing places of contestants not in the winners’ circle:</p> <ol start="4"> <li>speedwalk stu</li> <li>saunterin’ sam</li> <li>slowpoke rodriguez</li> </ol> the above html will
output: nestin...
...--> <ol> <li>second item first subitem</li> <li>second item second subitem</li> <li>second item third subitem</li> </ol> </li> <!-- here's the closing </li> tag --> <li>third item</li> </ol> the above html will
output: unordered list inside ordered list <ol> <li>first item</li> <li>second item <!-- closing </li> tag not here!
... --> <ul> <li>second item first subitem</li> <li>second item second subitem</li> <li>second item third subitem</li> </ul> </li> <!-- here's the closing </li> tag --> <li>third item</li> </ol> the above html will
output: specifications specification status comment html living standardthe definition of '<ol>' in that specification.
<sub>: The Subscript element - HTML: Hypertext Markup Language
this is a common use case for <sub>: <p>according to the computations by nakamura, johnson, and mason<sub>1</sub> this will result in the complete annihilation of both particles.</p> the resulting
output looks like this: variable subscripts in mathematics, families of variables related to the same concept (such as distances along the same axis) are represented using the same variable name with a subscript following.
...<var>x<sub>n</sub></var>.</p> the resulting
output: chemical formulas when writing a chemical formula, such as h20, the number of atoms of a given element within the described molecule is represented using a subscripted number; in the case of water, the subscripted "2" indicates that there are two atoms of hydrogen in the molecule.
... another example: <p>almost every developer's favorite molecule is c<sub>8</sub>h<sub>10</sub>n<sub>4</sub>o<sub>2</sub>, which is commonly known as "caffeine."</p> the
output: specifications specification status comment html living standardthe definition of '<sub> and <sup>' in that specification.
<ul>: The Unordered List element - HTML: Hypertext Markup Language
examples simple example <ul> <li>first item</li> <li>second item</li> <li>third item</li> </ul> the above html will
output: nesting a list <ul> <li>first item</li> <li>second item <!-- look, the closing </li> tag is not placed here!
... <li>second item second subitem second sub-subitem</li> <li>second item second subitem third sub-subitem</li> </ul> </li> <!-- closing </li> tag for the li that contains the third unordered list --> <li>second item third subitem</li> </ul> <!-- here is the closing </li> tag --> </li> <li>third item</li> </ul> the above html will
output: ordered list inside unordered list <ul> <li>first item</li> <li>second item <!-- look, the closing </li> tag is not placed here!
... --> <ol> <li>second item first subitem</li> <li>second item second subitem</li> <li>second item third subitem</li> </ol> <!-- here is the closing </li> tag --> </li> <li>third item</li> </ul> the above html will
output: specifications specification status comment html living standardthe definition of '<ul>' in that specification.
Control flow and error handling - JavaScript
for example: var x = 1; { var x = 2; } console.log(x); //
outputs 2 this
outputs 2 because the var x statement within the block is in the same scope as the var x statement before the block.
... (in c or java, the equivalent code would have
outputted 1.) since ecmascript2015, the let and const variable declarations are block-scoped.
... // while f() executes, the `finally` block returns false, // which overwrites the `throw` inside the above `catch` console.log('caught outer "bogus"'); } //
output // caught inner "bogus" // false nesting try...catch statements you can nest one or more try...catch statements.
Working with objects - JavaScript
// animal properties and method encapsulation var animal = { type: 'invertebrates', // default value of properties displaytype: function() { // method which will display type of animal console.log(this.type); } }; // create new animal type called animal1 var animal1 = object.create(animal); animal1.displaytype(); //
output:invertebrates // create new animal type called fishes var fish = object.create(animal); fish.type = 'fishes'; fish.displaytype(); //
output:fishes inheritance all objects in javascript inherit from at least one other object.
...delete myobj.a; console.log ('a' in myobj); //
output: "false" you can also use delete to delete a global variable if the var keyword was not used to declare the variable: g = 17; delete g; comparing objects in javascript, objects are a reference type.
...me: 'apple'}; fruit == fruitbear; // return false fruit === fruitbear; // return false // two variables, a single object var fruit = {name: 'apple'}; var fruitbear = fruit; // assign fruit object reference to fruitbear // here fruit and fruitbear are pointing to same object fruit == fruitbear; // return true fruit === fruitbear; // return true fruit.name = 'grape'; console.log(fruitbear); //
output: { name: "grape" }, instead of { name: "apple" } for more information about comparison operators, see comparison operators.
Array.prototype.reduce() - JavaScript
the reduce() method executes a reducer function (that you provide) on each element of the array, resulting in single
output value.
... it is almost always safer to provide an initialvalue, because there can be up to four possible
output types without initialvalue, as shown in the following example: let maxcallback = ( acc, cur ) => math.max( acc.x, cur.x ); let maxcallback2 = ( max, cur ) => math.max( max, cur ); // reduce without initialvalue [ { x: 2 }, { x: 22 }, { x: 42 } ].reduce( maxcallback ); // nan [ { x: 2 }, { x: 22 } ].reduce( maxcallback ); // 22 [ { x: 2 } ].reduce( maxcallback );...
...the code below will produce the same
output as the code in the block above: [0, 1, 2, 3, 4].reduce( (accumulator, currentvalue, currentindex, array) => accumulator + currentvalue ) if you were to provide an initialvalue as the second argument to reduce(), the result would look like this: [0, 1, 2, 3, 4].reduce((accumulator, currentvalue, currentindex, array) => { return accumulator + currentvalue }, 10) callback iteratio...
JSON.stringify() - JavaScript
space optional a string or number object that's used to insert white space into the
output json string for readability purposes.
... if you return a function, symbol, or undefined, the property is not included in the
output.
...before this change json.stringify would
output lone surrogates if the input contained any lone surrogates; such strings could not be encoded in valid utf-8 or utf-16: json.stringify("\ud800"); // '"�"' but with this change json.stringify represents lone surrogates using json escape sequences that can be encoded in valid utf-8 or utf-16: json.stringify("\ud800"); // '"\\ud800"' this change should be backwards-compatible as long as you pa...
Reflect.construct() - JavaScript
function oneclass() { console.log('oneclass') console.log(new.target) } function otherclass() { console.log('otherclass') console.log(new.target) } let obj1 = reflect.construct(oneclass, args) //
output: // oneclass // function oneclass { ...
... } let obj2 = reflect.construct(oneclass, args, otherclass) //
output: // oneclass // function otherclass { ...
... } let obj3 = object.create(otherclass.prototype); oneclass.apply(obj3, args) //
output: // oneclass // undefined examples using reflect.construct() let d = reflect.construct(date, [1776, 6, 4]) d instanceof date // true d.getfullyear() // 1776 specifications specification ecmascript (ecma-262)the definition of 'reflect.construct' in that specification.
for...in - JavaScript
it may be most practically used for debugging purposes, being an easy way to check the properties of an object (by
outputting to the console or otherwise).
... var obj = {a: 1, b: 2, c: 3}; for (const prop in obj) { console.log(`obj.${prop} = ${obj[prop]}`); } //
output: // "obj.a = 1" // "obj.b = 2" // "obj.c = 3" iterating own properties the following function illustrates the use of hasownproperty(): the inherited properties are not displayed.
... var triangle = {a: 1, b: 2, c: 3}; function coloredtriangle() { this.color = 'red'; } coloredtriangle.prototype = triangle; var obj = new coloredtriangle(); for (const prop in obj) { if (obj.hasownproperty(prop)) { console.log(`obj.${prop} = ${obj[prop]}`); } } //
output: // "obj.color = red" specifications specification ecmascript (ecma-262)the definition of 'for...in statement' in that specification.
try...catch - JavaScript
openmyfile(); try { // tie up a resource writemyfile(thedata); } finally { closemyfile(); // always close the resource } examples nested try-blocks first, let's see what happens with this: try { try { throw new error('oops'); } finally { console.log('finally'); } } catch (ex) { console.error('outer', ex.message); } //
output: // "finally" // "outer" "oops" now, if we already caught the exception in the inner try-block by adding a catch-block try { try { throw new error('oops'); } catch (ex) { console.error('inner', ex.message); } finally { console.log('finally'); } } catch (ex) { console.error('outer', ex.message); } //
output: // "inner" "oops" // "finally" and now, let's rethrow the ...
... try { try { throw new error('oops'); } catch (ex) { console.error('inner', ex.message); throw ex; } finally { console.log('finally'); } } catch (ex) { console.error('outer', ex.message); } //
output: // "inner" "oops" // "finally" // "outer" "oops" any given exception will be caught only once by the nearest enclosing catch-block unless it is rethrown.
...this includes exceptions thrown inside of the catch-block: (function() { try { try { throw new error('oops'); } catch (ex) { console.error('inner', ex.message); throw ex; } finally { console.log('finally'); return; } } catch (ex) { console.error('outer', ex.message); } })(); //
output: // "inner" "oops" // "finally" the outer "oops" is not thrown because of the return in the finally-block.
JavaScript typed arrays - JavaScript
for example, given the code above, we can continue like this: let int16view = new int16array(buffer); for (let i = 0; i < int16view.length; i++) { console.log('entry ' + i + ': ' + int16view[i]); } here we create a 16-bit integer view that shares the same buffer as the existing 32-bit view and we
output all the values in the buffer as 16-bit integers.
... now we get the
output 0, 0, 2, 0, 4, 0, 6, 0.
...consider this: int16view[0] = 32; console.log('entry 0 in the 32-bit array is now ' + int32view[0]); the
output from this is "entry 0 in the 32-bit array is now 32".
Performance fundamentals - Web Performance
in return, they perceive
outputs through sight, touch, and hearing.
... performance is the quality of system
outputs in response to user inputs.
... responsiveness responsiveness simply means how fast the system provides
outputs (possibly multiple ones) in response to user inputs.
SVG documentation index - SVG: Scalable Vector Graphics
if no value is provided, the
output will only be available for re-use as the implicit input into the next filter primitive if that filter primitive provides no value for its in attribute.
... 325 <feimage> element, svg, svg filter the <feimage> svg filter primitive fetches image data from an external source and provides the pixel data as
output (meaning if the external source is an svg image, it is rasterized.) 326 <femerge> element, reference, svg, svg filter the <femerge> svg element allows filter effects to be applied concurrently instead of sequentially.
... this is achieved by other filters storing their
output via the result attribute and then accessing it in a <femergenode> child.
<xsl:namespace-alias> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:namespace-alias> element is a rarely used device that maps a namespace in the stylesheet to a different namespace in the
output tree.
...to prevent a normally xsl:-prefixed literal result element (which should simply be copied as-is to the result tree) from being misunderstood by the processor, it is assigned a temporary namespace which is appropriately re-converted back to the xslt namespace in the
output tree.
... result-prefix specifies the desired namespace for the
output tree.
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
use the {{listsubpages}} macro once the bcd for <xsl:fallback>, <xsl:import>, <xsl:namespace-alias>, <xsl:number>, <xsl:
output>, <xsl:stylesheet>, <xsl:text> and <xsl:value-of> is fully migrated.
... <xsl:apply-imports><xsl:apply-templates><xsl:attribute-set><xsl:attribute><xsl:call-template><xsl:choose><xsl:comment><xsl:copy-of><xsl:copy><xsl:decimal-format><xsl:element><xsl:fallback><xsl:for-each><xsl:if><xsl:import><xsl:include><xsl:key><xsl:message><xsl:namespace-alias><xsl:number><xsl:otherwise><xsl:
output><xsl:param><xsl:preserve-space><xsl:processing-instruction><xsl:sort><xsl:strip-space><xsl:stylesheet><xsl:template><xsl:text><xsl:transform><xsl:value-of><xsl:variable><xsl:when><xsl:with-param> <xsl:apply-imports> <xsl:apply-templates> <xsl:attribute> <xsl:attribute-set> <xsl:call-template> <xsl:choose> <xsl:comment> <xsl:copy> <xsl:copy-of> <xsl:decimal-format> <xsl:element> <xsl:fallback> (not supported) <xsl:for-each> <xsl:if> <xsl:import> (mostly supported) <x...
...sl:include> <xsl:key> <xsl:message> <xsl:namespace-alias> (not supported) <xsl:number> (partially supported) <xsl:otherwise> <xsl:
output> (partially supported) <xsl:param> <xsl:preserve-space> <xsl:processing-instruction> <xsl:sort> <xsl:strip-space> <xsl:stylesheet> (partially supported) <xsl:template> <xsl:text> (partially supported) <xsl:transform> <xsl:value-of> (partially supported) <xsl:variable> <xsl:when> <xsl:with-param> ...
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
transformtodocument xsltprocessor.transformtodocument() takes one argument, the source node to transform, and returns a new document with the results of the transformation: var newdocument = processor.transformtodocument(domtobetransformed); the resultant object depends on the
output method of the stylesheet: html - htmldocument xml - xmldocument text - xmldocument with a single root element <transformiix:result> with the text as a child transformtofragment you can also use xsltprocessor.transformtofragment() which will return a documentfragment node.
... var ownerdocument = document.implementation.createdocument("", "test", null); var newfragment = processor.transformtofragment(domtobetransformed, ownerdocument); xsltprocessor.transformtofragment() will only produce html dom objects if the owner document is itself an htmldocument, or if the
output method of the stylesheet is html.
...if you want to override this, you can set the
output method normally in the standard way.
Converting WebAssembly text format to wasm - WebAssembly
next, execute the wat2wasm program, passing it the path to the input file, followed by an -o parameter, followed by the path to the
output file: wat2wasm simple.wat -o simple.wasm this will convert the wasm into a file called simple.wasm, which contains the .wasm assembly code.
... viewing the assembly
output because the
output file is assembly-based, it can’t be viewed in a normal text editor.
...try this: wat2wasm simple.wat -v this will give you an
output in your terminal in the following way: ...
ui/sidebar - Archive of obsolete content
you should see console
output like: console.log: add-on: add-on script got the message console.log: add-on: sidebar script got the reply using ready the ready event is emitted when the dom for the sidebar's content is ready.
...you should see console
output like: console.log: add-on: sidebar script got the message console.log: add-on: add-on script got the reply globals constructors sidebar(options) creates a sidebar.
jpm - Archive of obsolete content
specify --stop-on-error to stop running tests after the first failure: jpm test --stop-on-error --tbpl print test
output in treeherder format --times number run tests number of times: jpm test --times 2 -v --verbose verbose operation.
...this means that if you want to see the
output from console.log() messages, you have to tweak a setting.
Creating annotations - Archive of obsolete content
you should see the highlight appearing when you move the mouse over certain elements: click on the highlight and you should see something like this in the console
output: info: show info: http://blog.mozilla.com/addons/2011/02/04/overview-amo-review-process/, post-2249,when you submit a new add-on, you will have to choose between 2 review tracks: full review and preliminary review.
...you should see a panel with a text area for a note: enter the note and press the return key: you should see console
output like this: info: http://blog.mozilla.com/addons/2011/02/04/overview-amo-review-process/, post-2249,when you submit a new add-on, you will have to choose between 2 review tracks: full review and preliminary review.
Getting started (cfx) - Archive of obsolete content
navigate to it, type cfx init, and hit enter: mkdir my-addon cd my-addon cfx init you'll see some
output like this: * lib directory created * data directory created * test directory created * doc directory created * readme.md written * package.json written * test/test-main.js written * lib/main.js written * doc/main.md written your sample add-on is now ready for testing: try "cfx test" and then "cfx run".
...this means that if you want to see
output from console.log() messages, you'll have to tweak a setting.
Logging - Archive of obsolete content
the following add-on logs the html content of every tab the user loads, by calling console.log() inside a content script: require("sdk/tabs").on("ready", function(tab) { tab.attach({ contentscript: "console.log(document.body.innerhtml);" }); }); console
output if you are running your add-on from the command line (for example, executing jpm run or jpm test) then the console's messages appear in the command shell you used.
... but note that by default, calls to console.log() will not result in any
output in the error console for any installed add-ons: this includes add-ons installed using the add-on builder or using tools like the extension auto-installer.
StringView - Archive of obsolete content
47 : 65; }; /* base64 string to array encoding */ stringview.bytestobase64 = function (abytes) { var eqlen = (3 - (abytes.length % 3)) % 3, sb64enc = ""; for (var nmod3, nlen = abytes.length, nuint24 = 0, nidx = 0; nidx < nlen; nidx++) { nmod3 = nidx % 3; /* uncomment the following line in order to split the
output in lines 76-character long: */ /* if (nidx > 0 && (nidx * 4 / 3) % 76 === 0) { sb64enc += "\r\n"; } */ nuint24 |= abytes[nidx] << (16 >>> nmod3 & 24); if (nmod3 === 2 || abytes.length - nidx === 1) { sb64enc += string.fromcharcode(stringview.uint6tob64(nuint24 >>> 18 & 63), stringview.uint6tob64(nuint24 >>> 12 & 63), stringview.uint6tob64(nuint24 >>> 6 & 63), stringview.
... advanced examples edit an ascii part contained within a binary file let's compile this c program: #include <stdio.h> int main () { printf("hello world!\n"); return 0; } in a 64-bit machine it will result in an
output like the following first alert.
Connecting to Remote Content - Archive of obsolete content
using xslt xslt (extensible stylesheet language transformations) is another tool used to manipulate xml documents and transform them into other forms of text
output, such as html, xul, and so on.
... we can not cover all transformations to various
output formats, so we'll just look into converting an xml document to xul.
Local Storage - Archive of obsolete content
let appender; logfile.append("log.txt"); // loggers are hierarchical, lowering this log level will affect all //
output.
...g on the kind of message being logged: this._logger.fatal("this is a fatal message."); this._logger.error("this is an error message."); this._logger.warn("this is a warning message."); this._logger.info("this is an info message."); this._logger.config("this is a config message."); this._logger.debug("this is a debug message."); this._logger.trace("this is a trace message."); you can filter the
output of the global logger or any specific logger instance by setting the level property.
Creating a dynamic status bar extension - Archive of obsolete content
function inforeceived() { var samplepanel = document.getelementbyid('stockwatcher'); var
output = httprequest.responsetext; if (
output.length) { // remove whitespace from the end of the string; // this gets rid of the end-of-line characters
output =
output.replace(/\w*$/, ''); // build the tooltip string var fieldarray =
output.split(','); // assert that fieldarray[0] == 'goog' samplepanel.label = 'goog: ' + fieldarray[1]; samplepanel.tooltiptext = 'chg: ...
...we then fetch the result returned by the web server into the variable
output from the xmlhttprequest.responsetext property.
Using XML Data Islands in Mozilla - Archive of obsolete content
<head> <title>xml data block demo</title> <script> function rundemo() { var doc = document.getelementbyid("purchase-order").contentdocument; var lineitems = doc.getelementsbytagnamens("http://example.mozilla.org/purchaseorderml", "lineitem"); var firstprice = lineitems[0].getelementsbytagnamens("http://example.mozilla.org/purchaseorderml", "price")[0].textcontent; document.getelementbyid("
output-box").textcontent = "the purchase order contains " + lineitems.length + " line items.
... the price of the first line item is " + firstprice + "."; } </script> </head> <body onload="rundemo()";> <object id="purchase-order" data="purchase_order.xml" type="text/xml" style="display: none;"></object> <div id="
output-box">demo did not run</div> </body> </html> ...
Dehydra Function Reference - Archive of obsolete content
builtin functions the following functions are provided by dehydra and may be called by the user: print(msg) print a string to stdout (or stderr if the compiler is piping
output).
... msg is a string to
output to customize the location info printed set this._loc before calling print() include(file [, namespace]) include a javascript file into a namespace.
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
if that is the case, dispatchcontent tries to convert the data to some other content type by looking for a stream converter (implementing nsistreamconverter) that takes our content type as input and
outputs the magic type "*/*" (which just means we'll take anything it can give us).
...this creates a new nsdocumentopeninfo object and sets it as the
output streamlistener of the converter.
Nanojit - Archive of obsolete content
from an operational point of view, it is creating a function, which takes an integer input, and adds it to two, and
outputs the result.
...(typedef js_fastcall int32_t (*addtwofn)(int32_t); ) then, printf is hardcoded to call it with a parameter 5, and on linking with nanojit library, the following program will display 2+5=7 now, what i need to do is generate
output for this: start two = int 2 twoplustwo = add two, two ret twoplustwo this adds two and two in the most hardcoded way possible.
Actionscript Acceptance Tests - Archive of obsolete content
in this example the .as test runs out of memory and so the expected exitcode is: 128 testname.out file that specifies expected
output.
... when this file is defined, the
output from the testcase is matched line by line to the .out file and any difference is considered a failure.
Running Tamarin acceptance tests - Archive of obsolete content
reason: inconsistencies in different debug
output, need to implement regex matching of diffs 2527 running abcasm/branchtocommon.abs 2530 running abcasm/arithmetic.abs 2529 running abcasm/bkpt.abs 2528 running abcasm/bkptline.abs 2526 running abcasm/bug_476556.abs 2524 running abcasm/bug_491056.abs ...
...c:/python26/python.exe ./runtests.py --threads=3 other flags of interest (for a list of all flags, run runtests.py with -h/--help) --nohtml : will suppress the creation of an html
output file --rebuildtests : will only rebuild test .abc's, will not attempt to run them.
TraceVis - Archive of obsolete content
if tracemonkey is built with tracevis, and run with tracevis enabled, then tracemonkey will
output a log of all its activity transitions.
...the blog post linked above has examples of this
output and how to analyze it.
Using Breakpoints in Venkman - Archive of obsolete content
once you've created a script that will be executed when the associated breakpoint is hit, you can select a number of different options from the future breakpoint properties dialog that determine how venkman will deal with the
output of the associated script.
...meta comments are specially formatted comments that pull in the script named after the comment and specify how to treat the
output of that script.
Reading from Files - Archive of obsolete content
while(stream.available())
output += stream.readstring(10); the close method is used at the end to close the stream when you are finished reading from it.
...while(stream.available())
output += stream.readstring(20); although this can be a suitable means of reading binary data, usually you will want to retrieve the data with some additional methods that are more useful.
How to implement a custom XUL query processor component - Archive of obsolete content
rulematched: function(aquery, arulenode) { }, // the
output for a result has been removed and the result is no longer being used by the builder hasbeenremoved: function() { } }; // basic wrapper for nsisimpleenumerator function templateresultset(aarrayofdata) { this._index = 0; this._array = aarrayofdata; } templateresultset.prototype = { queryinterface: xpcomutils.generateqi([components.interfaces.nsisimpleenumerator]), hasmoreelements: fun...
... have data return this._data; }, initializeforbuilding: function(adatasource, abuilder, arootnode) { // perform any initialization that can be delayed until the content builder // is ready for us to start }, done: function() { // called when the builder is destroyed to clean up state }, compilequery: function(abuilder, aquery, arefvariable, amembervariable) { //
outputs a query object.
Result Generation - Archive of obsolete content
« previousnext » rdf in this section, we'll look at generating template
output using rdf datasources.
...you could navigate to b, c and d and generate three blocks of
output by following the arrows forward.
Archived Mozilla and build documentation - Archive of obsolete content
if tracemonkey is built with tracevis, and run with tracevis enabled, then tracemonkey will
output a log of all its activity transitions.
...when you have only a few uncommitted patches, you can get by using cvs diff, and just editing the
output to remove other patches before submitting.
Debug - Archive of obsolete content
the debug object is an instrinsic global object that sends
output to a debugger.
...in windows 8.x store apps, the write and writeln functions of the debug object display strings in the visual studio
output window at run time.
XForms Custom Controls Examples - Archive of obsolete content
output showing images <binding id="
output-image" extends="chrome://xforms/content/xforms.xml#xformswidget-base"> <content> <html:div> <html:img anonid="content"/> </html:div> </content> <implementation implements="nsixformsuiwidget"> <method name="refresh"> <body> var img = document.getanonymouselementbyattribute(this, "anonid", "content"); img.setattribute("src", this.stringvalue); return true; </body> </method> </implementation> </binding>
output showing xhtml <binding id="
output-xhtml" extends="chrome://xforms/content/xforms-xhtml.xml#xformswidget-...
...
output"> <content> <children includes="label"/> <xhtml:div class="xf-value" anonid="content"></xhtml:div> <children/> </content> <implementation implements="nsixformsuiwidget"> <field name="_domparser">null</field> <property name="domparser" readonly="true"> <getter> if (!this._domparser) this._domparser = new domparser(); return this._domparser; </getter> </property> <method name="refresh"> <body> // get new value, parse, and import it.
Using XForms and PHP - Archive of obsolete content
?> but remember this (quote from php documentation): remember that header() must be called before any actual
output is sent, either by normal html tags, blank lines in a file, or from php.
... it is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are
output before header() is called.
XUL Parser in Python - Archive of obsolete content
ys.argv[1]: for attr in a.keys(): if strip(attr) == sys.argv[1]: el_list[name][strip(attr)] = strip(a[attr]) and writing thevalues to the html results file instead of thekeys: for item in elements: w.write('<tr><td class="head">' + item + '</td></tr>\n') for a in el_list[item].values(): w.write('<tr><td class="at">' + a + '</td>') with these modifications, the script creates an
output more like a periodic table of xul elements.
... please feel free to suggest changes, change the format of the results
output, or adapt this script in any way you want.
Unconventional controls - Game development
first, we add a <script> tag with the url pointing at this file, and add <div id="
output"></div> just before the closing </body> tag for
outputting diagnostic information.
...r verticaldegree = 0; var degreethreshold = 30; var grabstrength = 0; right after that we use the leap's loop method to get the information held in the hand variable on every frame: leap.loop({ hand: function(hand) { horizontaldegree = math.round(hand.roll() * todegrees); verticaldegree = math.round(hand.pitch() * todegrees); grabstrength = hand.grabstrength;
output.innerhtml = 'leap motion: <br />' + ' roll: ' + horizontaldegree + '° <br />' + ' pitch: ' + verticaldegree + '° <br />' + ' strength: ' + grabstrength + ''; } }); the code above is calculating and assigning the horizontaldegree, verticaldegree and grabstrength values that we will use later on, and
outputting it in html so we can see the actual values.
Random Number Generator - MDN Web Docs Glossary: Definitions of Web-related terms
a prng (pseudorandom number generator) is an algorithm that
outputs numbers in a complex, seemingly unpredictable pattern.
...these include: that it's computationally unfeasible for an attacker (without knowledge of the seed) to predict its
output that if an attacker can work out its current state, this should not enable the attacker to work out previously emitted numbers.
CSS values and units - Learn web development
centimeters 1cm = 96px/2.54 mm millimeters 1mm = 1/10th of 1cm q quarter-millimeters 1q = 1/40th of 1cm in inches 1in = 2.54cm = 96px pc picas 1pc = 1/6th of 1in pt points 1pt = 1/72th of 1in px pixels 1px = 1/96th of 1in most of these values are more useful when used for print, rather than screen
output.
... in this example, try changing the alpha channel values to see how it affects the color
output.
How CSS works - Learn web development
the span nodes are also parents, with text nodes as their children: p ├─ "let's use:" ├─ span | └─ "cascading" ├─ span | └─ "style" └─ span └─ "sheets" this is how a browser interprets the previous html snippet —it renders the above dom tree and then
outputs it in the browser like so: p {margin:0;} applying css to the dom let's say we added some css to our document, to style it.
... the updated
output is as follows: in our debugging css article in the next module we will be using browser devtools to debug css problems, and will learn more about how the browser interprets css.
Fundamental text and font styling - Learn web development
pen sans light',helvetica,arial,sans-serif;"> <h2>html input</h2> <textarea id="code" class="html-input" style="width: 90%;height: 10em;padding: 10px;border: 1px solid #0095dd;"> <p>some sample text for your delight</p> </textarea> <h2>css input</h2> <textarea id="code" class="css-input" style="width: 90%;height: 10em;padding: 10px;border: 1px solid #0095dd;"> p { } </textarea> <h2>
output</h2> <div class="
output" style="width: 90%;height: 10em;padding: 10px;border: 1px solid #0095dd;"></div> <div class="controls"> <input id="reset" type="button" value="reset" style="margin: 10px 10px 0 0;"> </div> </div> const htmlinput = document.queryselector(".html-input"); const cssinput = document.queryselector(".css-input"); const reset = document.getelementbyid("reset"); let htm...
...lcode = htmlinput.value; let csscode = cssinput.value; const
output = document.queryselector(".
output"); const styleelem = document.createelement('style'); const headelem = document.queryselector('head'); headelem.appendchild(styleelem); function draw
output() {
output.innerhtml = htmlinput.value; styleelem.textcontent = cssinput.value; } reset.addeventlistener("click", function() { htmlinput.value = htmlcode; cssinput.value = csscode; draw
output(); }); htmlinput.addeventlistener("input", draw
output); cssinput.addeventlistener("input", draw
output); window.addeventlistener("load", draw
output); test your skills!
Styling web forms - Learn web development
multi-line <textarea>s buttons (both <input> and <button>s) <label> <
output> the bad some elements are more difficult to style, requiring more complex css or some more specific tricks: checkboxes and radio buttons <input type="search"> we describe how to handle these more specific features in the article advanced form styling.
...if the fontsquirrel
output was different to what we described above, you can find the correct @font-face blocks inside your downloaded webfont kit, in the stylesheet.css file (you'll need to replace the below @font-face blocks with them, and update the paths to the font files): @font-face { font-family: 'handwriting'; src: url('fonts/journal-webfont.woff2') format('woff2'), url('fonts/journal-webfont.woff...
CSS basics - Learn web development
first, find the
output from google fonts that you previously saved from what will your website look like?.
... html { font-size: 10px; /* px means "pixels": the base font size is now 10 pixels high */ font-family: "open sans", sans-serif; /* this should be the rest of the
output you got from google fonts */ } note: anything in css between /* and */ is a css comment.
HTML table basics - Learn web development
because tables are not the right tool for layout, and the markup is more complex than with css layout techniques, the screenreaders'
output will be confusing to their users.
... the initial markup looks like this: <table> <tr> <th>animals</th> </tr> <tr> <th>hippopotamus</th> </tr> <tr> <th>horse</th> <td>mare</td> </tr> <tr> <td>stallion</td> </tr> <tr> <th>crocodile</th> </tr> <tr> <th>chicken</th> <td>hen</td> </tr> <tr> <td>rooster</td> </tr> </table> but the
output doesn't give us quite what we want: animals hippopotamus horse mare stallion crocodile chicken hen rooster we need a way to get "animals", "hippopotamus", and "crocodile" to span across two columns, and "horse" and "chicken" to span downwards over two rows.
Handling common HTML and CSS problems - Learn web development
the following example shows date and time inputs: <form> <div> <label for="date">enter a date:</label> <input id="date" type="date"> </div> <div> <label for="time">enter a time:</label> <input id="time" type="time"> </div> </form> the
output of this code is as follows: hidden example label { float: left; width: 30%; text-align: right; } input { float: right; width: 65%; } label, input { margin-bottom: 20px; } div { clear: both; margin: 10px; } body { width: 400px; margin: 0 auto; } <form> ...
... for example, in the firefox dev tools, you get this kind of
output at the bottom of the dom inspector: if for example you were trying to use this selector, you'd be able to see that it wouldn't select the input element as desired: form > #date (the date form input isn't directly inside the <form>; you'd be better off using a general descendant selector instead of a child selector).
Introducing a complete toolchain - Learn web development
here is an example eslint
output: ./my-project/src/index.js 2:8 error 'react' is defined but never used no-unused-vars 22:20 error 'body' is defined but never used no-unused-vars 96:19 error 'b' is defined but never used no-unused-vars ✖ 3 problems (3 errors, 0 warnings) note: we'll install eslint in the next section; don't worry about this for now.
... to start parcel off in the background, go to your terminal and run the following command: npx parcel src/index.html you should see an
output like this (once the dependencies have been installed): server running at http://localhost:1234 ✨ built in 129ms.
Creating a Login Manager storage module
to see some debugging
output in the console set signon.debug to true using about:config.
... " + message); }, // logs function name and arguments for debugging stub: function(arguments) { var args = []; for (let i = 0; i < arguments.length; i++) args.push(arguments[i]) this.log("called " + arguments.callee.name + "(" + args.join(",") + ")"); }, init: function slms_init() { this.stub(arguments); }, initwithfile: function slms_initwithfile(ainputfile, a
outputfile) { this.stub(arguments); }, addlogin: function slms_addlogin(login) { this.stub(arguments); }, removelogin: function slms_removelogin(login) { this.stub(arguments); }, modifylogin: function slms_modifylogin(oldlogin, newlogin) { this.stub(arguments); }, getalllogins: function slms_getalllogins(count) { this.stub(arguments); }, removealllogins: function ...
Debugging OpenGL
if an opengl error occurred when executing the call, an error message is
output.
... if you need more verbose debug
output, you can enable the verbose debug mode by defining the environment variable moz_gl_debug_verbose.
How to get a stacktrace with WinDbg
you should now see a "command" text window with debug
output at the top and an input box at the bottom.
... .logopen /t c:\temp\firefox-debug.log .childdbg 1 .tlist sxn gp lm if you see firefox.exe listed in the
output from .tlist more than once, then you are already running the application and need to close the running instance first before you start debugging, otherwise you won't get useful results.
gettext
for english, the above code will produce the following
output: 1 user likes this.
...$num = 4; printf(n___("%d user likes this.", "%d users like this.", $num, 'another unique context string'), $num); ?> this code produces the following
output: a simple string.
Mozilla Style System Documentation
the
output of css selector matching as defined by the css specification is an ordered list of rules, where the order determines which declarations override other declarations.
...in mozilla, nscssdeclaration objects correspond to css declaration-blocks.) due to the high similarity of these lists between elements in the content tree, mozilla stores the
output of the selector matching process in a lexicographic tree, the rule tree.
Leak Gauge
if there are no leaks,
output will look like the following.
... results of processing log leak.log : summary: leaked 0 out of 11 dom windows leaked 0 out of 44 documents leaked 0 out of 3 docshells leaked content nodes in 0 out of 0 documents if there are leaks,
output will look like the following.
Refcount tracing and balancing
if you set this environment variable to the name of a file, the log will be
output to that file.
... the scripts
output looks like the following.
dtrace
sudo dtrace -n 'mach_kernel::wakeup { @[ustack()] = count(); }' -p $firefox_pid > $
output_file let's break that down further.
...dtrace will then print to the
output file a number of stack traces, along with a wakeup count for each one.
perf
the
output will look like the following.
... performance counter stats for 'system wide': 51.58 joules power/energy-pkg/ [100.00%] 14.80 joules power/energy-cores/ [100.00%] 9.93 joules power/energy-gpu/ [100.00%] 27.38 joules power/energy-ram/ [100.00%] 5.003049064 seconds time elapsed it's not clear from the
output, but the following relationship holds.
Leak And Bloat Tests
results printed on tinderbox
output, these consist of: mail rlk reference count leaks mail lk total bytes malloc'ed and not free'd mail mh maximum heap size mail a allocations - number of calls to malloc and friends.
...todo: add more information on processing
output.
NSPR Poll Method
for pr_recv, you should pass pr_poll_read as the in_flags argument to the poll method for pr_send, you should pass pr_poll_write as the in_flags argument to the poll method out_flags [
output argument] if an i/o layer is ready to satisfy the i/o request defined by in_flags without involving the underlying network transport, its poll method sets the corresponding event in *out_flags on return.
...declare two print16 variables to receive the return value and the out_flags
output argument of the poll method.
NSPR LOG FILE
if nspr_log_file is not in the environment, then log
output is written to stdout or stderr, depending on the platform.
...this value causes logging
output to be written using the windows function
outputdebugstring(), which writes to the debugger window.
PR_GetHostByAddr
buf a pointer to a buffer, allocated by the caller, that is filled in with host data on
output.
...on
output, this structure is filled in by the runtime if the function returns pr_success.
PR_GetHostByName
buf a pointer to a buffer, allocated by the caller, that is filled in with host data on
output.
...on
output, this structure is filled in by the runtime if the function returns pr_success.
Building NSS
test
output is stored in tests_results/security/$host.$number/.
... the file results.html summarizes the results,
output.log captures all the test
output.
NSS Sample Code Sample_1_Hashing
% 16 == limit)) { newline(out); column = level; limit = i % 16; } } if (column != level) { newline(out); } } /* * prints a usage message and exits */ static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ >
output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algtotal; htype++) { fprintf(stderr, hash_names[htype].hashname); if (htype == (hash_algtotal - 2)) fprintf(stderr, " or "); else if (htype != (hash_algtotal - 1)) fprin...
...tf(stderr, ", "); } fprintf(stderr, " (case ignored))\n"); fprintf(stderr, "%-20s define an input file to use (default is stdin)\n", "< input"); fprintf(stderr, "%-20s define an
output file to use (default is stdout)\n", ">
output"); exit(-1); } /* * check for the missing arguments */ static void printmsgandexit(const char *progname, char opt) { fprintf(stderr, "%s: option -%c requires an argument\n", progname, opt); usage(progname); } #define require_arg(opt,value) if (!(value)) printmsgandexit(progname, opt) /* * digests a file according to the specified algorithm.
NSS Sample Code Utilities_1
{ int len; char *end; len = port_strlen(cp); if (len < 8) { return pr_false; } end = cp + len; while (cp < end) { unsigned char ch = *cp++; if (!((ch >= 'a') && (ch <= 'z')) && !((ch >= 'a') && (ch <= 'z'))) { return pr_true; } } return pr_false; } /* * getpassword */ char* getpassword(file *input, file *
output, char *prompt, prbool (*ok)(char *)) { char phrase[200] = {'\0'}; int infd = fileno(input); int istty = isatty(infd); for (;;) { /* prompt for password */ if (istty) { fprintf(
output, "%s", prompt); fflush (
output); echooff(infd); } fgets(phrase, sizeof(phrase), input); if...
... (istty) { fprintf(
output, "\n"); echoon(infd); } /* stomp on newline */ phrase[port_strlen(phrase)-1] = 0; /* validate password */ if (!(*ok)(phrase)) { if (!istty) return 0; fprintf(
output, "password must be at least 8 characters long with one or more\n"); fprintf(
output, "non-alphabetic characters\n"); continue; } return (char*) port_strdup(phrase); } } /* * filepasswd extracts the password from a text file * * storing passwords is often used with server environments * where prompting the user for a password or requiring it * to be entered in the command line is not a feasible option.
Hashing - sample 1
% 16 == limit)) { newline(out); column = level; limit = i % 16; } } if (column != level) { newline(out); } } /* * prints a usage message and exits */ static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ >
output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algtotal; htype++) { fprintf(stderr, hash_names[htype].hashname); if (htype == (hash_algtotal - 2)) fprintf(stderr, " or "); else if (htype != (hash_algtotal - 1)) fprin...
...tf(stderr, ", "); } fprintf(stderr, " (case ignored))\n"); fprintf(stderr, "%-20s define an input file to use (default is stdin)\n", "< input"); fprintf(stderr, "%-20s define an
output file to use (default is stdout)\n", ">
output"); exit(-1); } /* * check for the missing arguments */ static void printmsgandexit(const char *progname, char opt) { fprintf(stderr, "%s: option -%c requires an argument\n", progname, opt); usage(progname); } #define require_arg(opt,value) if (!(value)) printmsgandexit(progname, opt) /* * digests a file according to the specified algorithm.
sample1
) { newline(out); column = level; limit = i % 16; } } if (column != level) { newline(out); } } /* prints a usage message and exits */ static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ >
output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algtotal; htype++) { fprintf(stderr, hash_names[htype].hashname); if (htype == (hash_algtotal - 2)) fprintf(stderr, " or "); else if (htype != (hash_algtotal - 1)) ...
... fprintf(stderr, ", "); } fprintf(stderr, " (case ignored))\n"); fprintf(stderr, "%-20s define an input file to use (default is stdin)\n", "< input"); fprintf(stderr, "%-20s define an
output file to use (default is stdout)\n", ">
output"); exit(-1); } /* check for the missing arguments */ static void printmsgandexit(const char *progname, char opt) { fprintf(stderr, "%s: option -%c requires an argument\n", progname, opt); usage(progname); } #define require_arg(opt,value) if (!(value)) printmsgandexit(progname, opt) /* digests a file according to the specified algorithm.
NSS sources building testing
once the build is done, you can find the build
output below directory dist/?, where ?
...inside the directory you'll find text file
output.log, which contains a detailed report of all tests being executed.
nss tech note1
this is where the decoder stores its
output.
... sec_asn1decodeitem will make a copy of the input data into the decoded target as needed, while sec_quickderdecodeitem will generate
output with pointers into the input.
NSS Tools sslstrength
the letter in the first column of the
output is used to identify the cipher preferences in the ciphers= command.
...you can tell if you stepped-up, because the
output will says 'using export policy', and you'll find the secret key size was 128-bits.
Build instructions
cd nss gmake nss_build_all the
output of the build will be in the dist directory alongside the nspr and nss directories.
... cd mozilla/security/nss gmake nss_build_all the
output of the build will be in mozilla/dist subdirectory.
NSS environment variables
3.12.3 nss_
output_file string (filename)
output file path name for the pkcs #11 module logger.
... 3.12.8 nsdistmode string on operating systems other than windows, this controls whether copies, absolute symlinks, or relative symlinks of the
output files should be published to mozilla/dist.
NSS tools : pk12util
enter new password: re-enter password: enter password for pkcs12 file: pk12util: pkcs12 import successful exporting keys and certificates using the pk12util command to export certificates and keys requires both the name of the certificate to extract from the database (-n) and the pkcs#12-formatted
output file to write to.
... pk12util -l p12file [-h tokenname] [-r] [-d [sql:]directory] [-p dbprefix] [-k slotpasswordfile|-k slotpassword] [-w p12filepasswordfile|-w p12filepassword] for example, this prints the default ascii
output: # pk12util -l certs.p12 enter password for pkcs12 file: key(shrouded): friendly name: thawte freemail member's thawte consulting (pty) ltd.
NSS Tools sslstrength
the letter in the first column of the
output is used to identify the cipher preferences in the ciphers= command.
...you can tell if you stepped-up, because the
output will says 'using export policy', and you'll find the secret key size was 128-bits.
NSS tools : pk12util
enter new password: re-enter password: enter password for pkcs12 file: pk12util: pkcs12 import successful exporting keys and certificates using the pk12util command to export certificates and keys requires both the name of the certificate to extract from the database (-n) and the pkcs#12-formatted
output file to write to.
... pk12util -l p12file [-h tokenname] [-r] [-d [sql:]directory] [-p dbprefix] [-k slotpasswordfile|-k slotpassword] [-w p12filepasswordfile|-w p12filepassword] for example, this prints the default ascii
output: # pk12util -l certs.p12 enter password for pkcs12 file: key(shrouded): friendly name: thawte freemail member's thawte consulting (pty) ltd.
Necko walkthrough
nshttpconnection::activate this connection is passed the transaction nshttpconnection::on
outputstreamready nshttpconnection::onsocketwritable tries to write the request data from the current transaction (mtransaction) tells the transaction to now wait (`resumerecv) nshttpconnection::resumerecv nshttptransaction::readsegments readrequestsegment is passed to mrequeststream->readsegments - this function pointer is called and used to read the request bytes, which in turn ...
... nshttpconnection::oninputstreamready nshttpconnection::onsocketreadable nshttptransaction::writesegments nshttpconnection::onwritesegment passes bytes from msocketin->read to the transaction's pipe nspipe
outputstream::writesegments nspipe::advancewritecursor nspipeinputstream::oninputreadable so now the response is hitting the other end of the pipe, saying it has bytes to read nspipeevents::notifyinputready puts the callback object into an nspipeevents object.
Rhino JavaScript compiler
-o
outputfile writes the class file to
outputfile, which should end in .class and must be a writable filename.
... -d
outputdirectory writes the class file to
outputdirectory.
SpiderMonkey Build Documentation
$ ./js-config --cflags # example
output: -i/usr/local/include/js -i/usr/include/nspr when invoked with the --libs option, js-config prints the flags that you should pass to the c compiler when linking an executable or shared library that uses spidermonkey.
... $ ./js-config --libs # example
output: -l/usr/local/lib -lmozjs -l/usr/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl -ldl -lm -lm -ldl testing spidermonkey run ${builddir}/dist/bin/js y.js and check if appropriate
output is printed.
Creating JavaScript jstest reftests
a different approach is to use the expectexitcode(exitcode) function which
outputs a string: --- note: in this testcase, we expect exit code <exitcode> --- that tells the post-processing scripts jsdriver.pl or post-process-logs.pl that the test passes if the shell or browser terminates with that exit code.
... a modification will soon be made to the javascript tests to allow an arbitrary string to be
output which will be used to post process the test logs to better determine if a test has passed regardless of its exit code.
Introduction to the JavaScript shell
for example, if you enter the javascript function below: function test() { var i = 3; print(i+2); } then run the command dis(test);, you get this
output: main: 00000: uint16 3 00003: setvar 0 00006: pop 00007: name "print" 00010: pushobj 00011: getvar 0 00014: uint16 2 00017: add 00018: call 1 00021: pop 00022: stop source notes: 0: 0 [ 0] newline 1: 3 [ 3] decl offset 0 2: 7 [ 4] newline 3: 18 [ 11] xdelta 4: 18 [ 0] pcbase offset 11 dissrc([function]) disassembles the javascript bytecod...
... if your program includes a function, dostuff(), like this: function dostuff(input) { print("enter a number: "); var n1 = readline(); print("enter another one: "); var n2 = readline(); print("you entered " + n1 + " and " + n2 + "\n"); } calling dissrc(dostuff) function would give this
output: ;------------------------- 10: print("enter a number: "); 00000: 10 name "print" 00003: 10 pushobj 00004: 10 string "enter a number: " 00007: 10 call 1 00010: 10 pop ;------------------------- 11: var n1 = readline(); 00011: 11 name "readline" 00014: 11 pushobj 00015: 11 call 0 00018: 11 setvar 0 00021: 11 pop ;------------------------- 12: print("...
Running Automated JavaScript Tests
for a smoke test or if you are not changing language-level functionality, you may wish to use jstests.py path_to_js_shell --exclude=test262 other options allow you to show the test command lines being run, command
output and return codes, run tests named in a given file, exclude tests named in a given file, hide the progress bar, change the timeout, run skipped tests, print
output in tinderbox format, run a test in the debugger, or run tests in valgrind.
...see the full list in the -h / --help
output.
compare-locales
options to get a brief list of available options, use the --help flag: $ compare-locales --help the
output the
output of compare-locales shows the missing and obsolete strings in a pseudo-diff format.
... the
output closes with a summary, giving the total counts of missing and obsolete strings and words, and some statistics on how many strings are changed or not, excluding access- and commandkeys.
XForms Accessibility
output serves to show instance data that the element is bound to (see the spec, the docs).
...every form control other than the
output element must contain a label element.
nsIRegistry
try { st.first(); do { var data = st.currentitem(); if( data instanceof ci.nsiregistrynode ) print("nsiregistrynode: " + data.nameutf8 + " (" + data.key + ")"); st.next(); } while( components.lastresult == 0 ); } catch(e) {} now, the
output is something like: profiles (344) profiles/default (530) profiles/foo (1046) profiles/bar (1518) the number inside the parenthesis is the "key." you can use this key with the rest of the nsiregistry api (see mxr).
...js> rs.getstringutf8(530, "directory") // 530: key corresponding with profiles/default the
output is something like: /home/lion/.mozilla/default/awp83kud.slt boo-yah!
imgIDecoder
implementer's note: this method is defined by this interface in order to let the
output stream efficiently copy the data from the input stream into its internal buffer (if any).
... if this method was provided as an external facility, a separate char * buffer would need to be used in order to call the
output stream's other write() method.
mozITXTToHTMLConv
methods scantxt() scans the specified text, applying the requested conversions and
outputting html.
... loglinestart on
output, this parameter is set to indicate the offset into the string of the first non-cite character.
nsIAsyncInputStream
note: this method exists in part to support pipes, which have both an input end and an
output end.
... if the input end of a pipe is closed, then writes to the
output end of the pipe will fail.
nsIAuthModule
aouttokenlength the length of the
output token buffer.
...aouttokenlength the length of the
output token buffer.
nsIBinaryInputStream
xpcom/io/nsibinaryinputstream.idlscriptable this interface allows consumption of primitive data types from a "binary stream" containing untagged, big-endian binary data, that is as produced by an implementation of nsibinary
outputstream.
... see also nsibinary
outputstream nsiinputstream nsi
outputstream ...
nsIDOMSerializer
to create an instance, use: var domserializer = components.classes["@mozilla.org/xmlextras/xmlserializer;1"] .createinstance(components.interfaces.nsidomserializer); method overview void serializetostream(in nsidomnode root, in nsi
outputstream stream, in autf8string charset); astring serializetostring(in nsidomnode root); methods serializetostream() the subtree rooted by the specified element is serialized to a byte stream using the character set specified.
... void serializetostream( in nsidomnode root, in nsi
outputstream stream, in autf8string charset ); parameters root the root of the subtree to be serialized.
nsIJSON
void encodetostream(in nsi
outputstream stream, in string charset, in boolean writebom, in jsobject value); jsval legacydecode(in astring str); deprecated since gecko 2.0 jsval legacydecodefromstream(in astring str); deprecated since gecko 2.0 jsval legacydecodetojsval(in astring str, in jscontext cx); native code only!
... void encodetostream( in nsi
outputstream stream, in string charset, in boolean writebom in jsobject value ); parameters stream the nsi
outputstream to which to write the json string.
nsIPluginHost
it will *always malloc()*
output buffer (caller is responsible to free it) if input buffer starts with lf, which comes from 4.x spec http://developer.netscape.com/docs/manuals/communicator/plugin/pgfn2.htm#1007754 "if no custom headers are required, simply add a blank line ('\n') to the beginning of the file or buffer.", it skips that '\n' and considers rest of the input buffer as data.
... if "content-length" string and end of headers is found it substitutes single lf with crlf in the headers, so the end of headers always will be crlfcrlf (single cr in headers, if any, remain untouched) else it puts "content-length: "+size_of_data+crlfcrlf at the beginning of the
output buffer and memcpy data to the
output buffer.
nsIStackFrame
example to
output the stack at a particular location: var s = components.stack; while(s) { console.log(s.name); s = s.caller; } methods tostring() a generic formatter - make it suitable to print, and so forth.
...return value a string suitable for
output.
nsIStreamConverter
you can supply the service with a stream of type x and it will convert it to your desired
output type and return a converted (blocking) stream to you.
...it will then convert that data from type x to your desired
output type and return converted data to you via the nsistreamlistener you passed in by calling its nsistreamlistener.ondataavailable() method.
nsITraceableChannel
/////// start - do not edit var {classes: cc, interfaces: ci, results: cr, constructor: cc, utils: cu} = components; cu.import('resource://gre/modules/services.jsm'); var binaryinputstream = cc('@mozilla.org/binaryinputstream;1', 'nsibinaryinputstream', 'setinputstream'); var binary
outputstream = cc('@mozilla.org/binary
outputstream;1', 'nsibinary
outputstream', 'set
outputstream'); var storagestream = cc('@mozilla.org/storagestream;1', 'nsistoragestream', 'init'); function tracinglistener() { this.receivedchunks = []; // array for incoming data.
...isedone = this.deferreddone.promise; } tracinglistener.prototype = { ondataavailable: function(arequest, acontext, ainputstream, aoffset, acount) { var istream = new binaryinputstream(ainputstream) // binaryainputstream var sstream = new storagestream(8192, acount, null); // storagestream // not sure why its 8192 but thats how eveyrone is doing it, we should ask why var ostream = new binary
outputstream(sstream.get
outputstream(0)); // binary
outputstream // copy received data as they come.
nsIXULTemplateQueryProcessor
the reference point is important when generating
output recursively, as the query will be the same for each iteration, however, the reference point will differ.
...the initializeforbuilding(), compilequery() and addbinding() methods may not be called after generateresults() has been called until the builder indicates that the generated
output is being removed by calling the done() method.
Using COM from js-ctypes
; void* setnotifycallbackfunction; void* setnotifycallbackinterface; void* setnotifywin32event; void* waitfornotifyevent; void* getnotifyeventhandle; /* end inherit from ispnotifysource */ /* start inherit from ispeventsource */ void* setinterest; void* getevents; void* getinfo; /* end inherit from ispeventsource */ /* start ispvoice */ void* set
output; void* get
outputobjecttoken; void* get
outputstream; void* pause; void* resume; void* setvoice; void* getvoice; hresult (__stdcall *speak)(struct myispvoice*, lpcwstr pwcs, dword dwflags, ulong* pulstreamnumber); void* speakstream; void* getstatus; void* skip; void* setpriority; void* getpriority; void* setalertboun...
...win32event': ctypes.voidptr_t }, { 'waitfornotifyevent': ctypes.voidptr_t }, { 'getnotifyeventhandle': ctypes.voidptr_t }, // end inherit from ispnotifysource // start inherit from ispeventsource { 'setinterest': ctypes.voidptr_t }, { 'getevents': ctypes.voidptr_t }, { 'getinfo': ctypes.voidptr_t }, // end inherit from ispeventsource // start ispvoice { 'set
output': ctypes.voidptr_t }, { 'get
outputobjecttoken': ctypes.voidptr_t }, { 'get
outputstream': ctypes.voidptr_t }, { 'pause': ctypes.voidptr_t }, { 'resume': ctypes.voidptr_t }, { 'setvoice': ctypes.voidptr_t }, { 'getvoice': ctypes.voidptr_t }, { 'speak': ctypes.functiontype(callback_abi, hresult, // return [ ispvoice.ptr, ...
Streams - Plugins
the plug-in can set the
output parameter type to one of these transmission modes: np_normal: (default): the plug-in can process the data progressively as it arrives from the network or file system through a series of calls to npp_writeready and npp_write.
...the browser creates a new npstream object and returns it to the plug-in as an
output parameter.
Deprecated tools - Firefox Developer Tools
the results are displayed in the console
output, to the right of the input, providing immediate feedback.
... unlike in scratchpad, errors are properly displayed in the
output with an expandable stacktrace, making it easier to debug the code you're currently writing.
All keyboard shortcuts - Firefox Developer Tools
onsole ctrl + shift + k cmd + opt + k ctrl + shift + k search in the message display pane ctrl + f cmd + f ctrl + f open the object inspector pane ctrl + click ctrl + click ctrl + click clear the object inspector pane esc esc esc focus on the command line ctrl + shift + k cmd + opt + k ctrl + shift + k clear
output ctrl + shift + l ctrl + l from firefox 67: cmd + k ctrl + shift + l command line interpreter these shortcuts apply when you're in the command line interpreter.
... command windows macos linux scroll to start of console
output (only if the command line is empty) home home home scroll to end of console
output (only if the command line is empty) end end end page up through console
output page up page up page up page down through console
output page down page down page down go backward through command history up arrow up arrow up arrow go forward through command history down arrow down arrow down arrow initiate reverse search through command history/step backwards through matching commands f9 ctrl + r f9 step forward through matching command history (after initiating reverse search) shift + f9 ctrl + s...
Call Tree - Firefox Developer Tools
in this article, we'll use the
output of a simple program as an example.
... the screenshot below shows the
output of a program that compares three sorting algorithms - bubble sort, selection sort, and quicksort.
Settings - Firefox Developer Tools
it makes visible the command line and one or two lines of the console
output.
...there's just one of these: enable persistent logs a setting to control whether or not the web console and network monitor clear their
output when you navigate to a new page.
Web console keyboard shortcuts - Firefox Developer Tools
onsole ctrl + shift + k cmd + opt + k ctrl + shift + k search in the message display pane ctrl + f cmd + f ctrl + f open the object inspector pane ctrl + click ctrl + click ctrl + click clear the object inspector pane esc esc esc focus on the command line ctrl + shift + k cmd + opt + k ctrl + shift + k clear
output ctrl + shift + l ctrl + l from firefox 67: cmd + k ctrl + shift + l command line interpreter these shortcuts apply when you're in the command line interpreter.
... command windows macos linux scroll to start of console
output (only if the command line is empty) home home home scroll to end of console
output (only if the command line is empty) end end end page up through console
output page up page up page up page down through console
output page down page down page down go backward through command history up arrow up arrow up arrow go forward through command history down arrow down arrow down arrow initiate reverse search through command history/step backwards through matching commands f9 ctrl + r f9 step forward through matching command history (after initiating reverse search) shift + f9 ctrl + s...
Attr - Web APIs
dde4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">attr</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: starting in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), a number of deprecated properties and methods
output warning messages to the console.
... gecko
outputs a deprecation note starting from gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4).
AudioContext - Web APIs
audiocontext.
outputlatency read only returns an estimation of the
output latency of the current audio context.
... audiocontext.get
outputtimestamp() returns a new audiotimestamp object containing two audio timestamp values relating to the current audio context.
AudioContextOptions.sampleRate - Web APIs
this value should typically be between 8,000 hz and 96,000 hz; the default will vary depending on the
output device, but the sample rate 44,100 hz is the most common.
... if the samplerate property is not included in the options, or the options are not specified when creating the audio context, the new context's
output device's preferred sample rate is used by default.
AudioContextOptions - Web APIs
if not specified, the preferred sample rate for the context's
output device is used by default.
... constants standard values for latencyhint the latencyhint property can be number specifying a preferred maximum latency in seconds or a string from the audiocontextlatencycategory enumerated string, which selects a standard value for a given type of audio usage: value description "balanced" the user agent should balance audio
output latency and power consumption when selecting a latency value.
AudioParam.value - Web APIs
consider this example: const source = new audiobuffersourcenode(...); const rate = 5.3; source.playbackrate.value = rate; console.log(source.playbackrate.value === rate); the log
output will be false, because the playback rate parameter, rate, was converted to the 32-bit floating-point number closest to 5.3, which yields 5.300000190734863.
... one solution is to use the math.fround() method, which returns the single-precision value equivalent to the 64-bit javascript value specified—when setting value, like this: const source = new audiobuffersourcenode(...); const rate = math.fround(5.3); source.playbackrate.value = rate; console.log(source.playbackrate.value === rate); in this case, the log
output will be true.
AudioWorkletGlobalScope.registerProcessor - Web APIs
examples in this example we create a custom audioworkletnode that
outputs silence.
... // test-processor.js class testprocessor extends audioworkletprocessor { process (inputs,
outputs, parameters) { return true } } registerprocessor('test-processor', testprocessor) next, in our main script file we'll load the processor, create an instance of audioworkletnode — passing it the processor name that we used when calling registerprocessor — and connect it to an audio graph.
BaseAudioContext.createGain() - Web APIs
syntax var gainnode = audiocontext.creategain(); return value a gainnode which takes as input one or more audio sources and
outputs audio whose volume has been adjusted in gain (volume) to a level specified by the node's gainnode.gain a-rate parameter.
...if you still hear something, make sure you haven't // connected your source into the
output in addition to using the gainnode.
BaseAudioContext - Web APIs
baseaudiocontext.createconstantsource() creates a constantsourcenode object, which is an audio source that continuously
outputs a monaural (one-channel) sound signal whose samples all have the same value.
... baseaudiocontext.createperiodicwave() creates a periodicwave, used to define a periodic waveform that can be used to determine the
output of an oscillatornode.
BiquadFilterNode - Web APIs
a biquadfilternode always has exactly one input and one
output.
... number of inputs 1 number of
outputs 1 channel count mode "max" channel count 2 (not used in the default count mode) channel interpretation "speakers" constructor biquadfilternode() creates a new instance of a biquadfilternode object.
CSS Painting API - Web APIs
it has an
output bitmap that is the size of the object it is rendering to.
... paintsize returns the read-only values of the
output bitmap's width and height.
Using the CSS Typed Object Model - Web APIs
textnode( propval )); row.appendchild( cssvalue ); // and the type of unit const cssunit = document.createelement( 'td' ); cssunit.appendchild( document.createtextnode( allcomputedstyles.get( ofinterest[i] ).unit )); row.appendchild( cssunit ); //add the row to the table stylestable.appendchild( row ); } for those of you using a non-supporting browser, the above
output should looks something like this: property value unit padding-top 0 px margin-bottom 16 px font-size 16 px font-stretch 100 percent animation-duration 0 s animation-iteration-count 1 number width auto undefined height auto undefined you'll note the <le...
...we'll take a look at that their types are by employing short javascript snippets
outputting to console.log(): :root { --maincolor: hsl(198, 43%, 42%); --black: hsl(0, 0%, 16%); --white: hsl(0,0%,97%); --unit: 1.2rem; } button { --maincolor: hsl(198, 100%, 66%); display: inline-block; padding: var(--unit) calc(var(--unit)*2); width: calc(30% + 20px); background: no-repeat 5% center url(https://mdn.mozillademos.org/files/16793/magicwand.png) var(--maincolor); ...
Basic animations - Web APIs
}); } </script> <style> #cw { position: fixed; z-index: -1; } body { margin: 0; padding: 0; background-color: rgba(0,0,0,0.05); } </style> </head> <body> <canvas id="cw"></canvas> </body> </html>
output snake game <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>nokia 1100:snake..member berries</title> </head> <body> <div class="keypress hide"> <div class="up" onclick="emit(38)">↑</div> ...
...ode + "(" + e.which + ")"), document.dispatchevent(e) }; var o, s, h = innerheight, w = innerwidth, fw = 60, fa = []; window.onkeydown = function (t) { var e = t.key; (e.search("arrow") > -1 || "1" == e) && (d = t.key), "i" != e && "i" != e || (console.log("inc"), fw -= 10), "d" != e && "d" != e || (console.log("dec"), fw += 10) }, init();
output other examples a basic ray-caster a good example of how to do animations using keyboard controls.
Console.countReset() - Web APIs
examples for example, given code like this: let user = ""; function greet() { console.count(); return "hi " + user; } user = "bob"; greet(); user = "alice"; greet(); greet(); console.count(); console.countreset(); console
output will look something like this: "default: 1" "default: 2" "default: 3" "default: 4" "default: 0" note that the call to console.counterreset() resets the value of the default counter to zero.
... if we pass the user variable as the label argument with the string "bob" to the first invocation of count(), and the string "alice" to the second: let user = ""; function greet() { console.count(user); return "hi " + user; } user = "bob"; greet(); user = "alice"; greet(); greet(); console.countreset("bob"); console.count("alice"); we will see
output like this: "bob: 1" "alice: 1" "alice: 2" "bob: 0" "alice: 3" resetting the value of the counter "bob" only changes the value of that counter.
Console.dir() - Web APIs
the
output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects.
... syntax console.dir(object); parameters object a javascript object whose properties should be
output.
Console.dirxml() - Web APIs
the
output is presented as a hierarchical listing of expandable nodes that let you see the contents of child nodes.
... syntax console.dirxml(object); parameters object a javascript object whose properties should be
output.
Console.group() - Web APIs
using groups in the console requires gecko 9.0(firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) you can use nested groups to help organize your
output by visually associating related messages.
...for example, given this code: console.log("this is the outer level"); console.group(); console.log("level 2"); console.group(); console.log("level 3"); console.warn("more of level 3"); console.groupend(); console.log("back to level 2"); console.groupend(); console.log("back to the outer level"); the
output looks like this: see using groups in the console in the documentation of console for more details.
Console.time() - Web APIs
when you call console.timeend() with the same name, the browser will
output the time, in milliseconds, that elapsed since the timer was started.
...this will identify the timer; use the same name when calling console.timeend() to stop the timer and get the time
output to the console.
console.trace() - Web APIs
the console interface's trace() method
outputs a stack trace to the web console.
... syntax console.trace( [...any, ...data ]); parameters ...any, ...data optional zero or more objects to be
output to console along with the trace.
ConvolverNode - Web APIs
a convolvernode always has exactly one input and one
output.
... number of inputs 1 number of
outputs 1 channel count mode "clamped-max" channel count 1, 2, or 4 channel interpretation "speakers" constructor convolvernode() creates a new convolvernode object instance.
DataTransferItem.webkitGetAsEntry() - Web APIs
example in this example, a drop zone is created, which responds to the drop event by scanning through the dropped files and directories,
outputting a hierarchical directory listing.
...find some files and directories and drag them in, and take a look at the resulting
output.
Detecting device orientation - Web APIs
so let's imagine a ball in a garden: <div class="garden"> <div class="ball"></div> </div> <pre class="
output"></pre> this garden is 200 pixel wide (yes, it's a tiny one), and the ball is in the center: .garden { position: relative; width : 200px; height: 200px; border: 5px solid #ccc; border-radius: 10px; } .ball { position: absolute; top : 90px; left : 90px; width : 20px; height: 20px; background: green; border-radius: 100%; } now, if we move our device, the ball will m...
...ove accordingly: var ball = document.queryselector('.ball'); var garden = document.queryselector('.garden'); var
output = document.queryselector('.
output'); var maxx = garden.clientwidth - ball.clientwidth; var maxy = garden.clientheight - ball.clientheight; function handleorientation(event) { var x = event.beta; // in degree in the range [-180,180] var y = event.gamma; // in degree in the range [-90,90]
output.innerhtml = "beta : " + x + "\n";
output.innerhtml += "gamma: " + y + "\n"; // because we don't want to have the device upside down // we constrain the x value to the range [-90,90] if (x > 90) { x = 90}; if (x < -90) { x = -90}; // to make computation easier we shift the range of // x and y to [0,180] x += 90; y += 90; // 10 is half the size of the...
DocumentOrShadowRoot.activeElement - Web APIs
morbi sed euismod diam.</textarea> </form> <p>active element id: <b id="
output-element"></b></p> <p>selected text: <b id="
output-text"></b></p> javascript function onmouseup(e) { const activetextarea = document.activeelement; const selection = activetextarea.value.substring( activetextarea.selectionstart, activetextarea.selectionend ); const
outputelement = document.getelementbyid('
output-element'); const
outputtext = document.getelementbyid('
output-text');...
...
outputelement.innerhtml = activetextarea.id;
outputtext.innerhtml = selection; } const textarea1 = document.getelementbyid('ta-example-one'); const textarea2 = document.getelementbyid('ta-example-two'); textarea1.addeventlistener('mouseup', onmouseup, false); textarea2.addeventlistener('mouseup', onmouseup, false); result specifications specification status comment html living standardthe definition of 'activeelement' in that specification.
Element.innerHTML - Web APIs
javascript function log(msg) { var logelem = document.queryselector(".log"); var time = new date(); var timestr = time.tolocaletimestring(); logelem.innerhtml += timestr + ": " + msg + "<br/>"; } log("logging mouse events inside this container..."); the log() function creates the log
output by getting the current time from a date object using tolocaletimestring(), and building a string with the timestamp and the message text.
...you can see
output into the log by moving the mouse in and out of the box, clicking in it, and so forth.
Element.outerHTML - Web APIs
for example: var div = document.createelement("div"); div.outerhtml = "<div class=\"test\">test</div>"; console.log(div.outerhtml); //
output: "<div></div>" also, while the element will be replaced in the document, the variable whose outerhtml property was set will still hold a reference to the original element: var p = document.getelementsbytagname("p")[0]; console.log(p.nodename); // shows: "p" p.outerhtml = "<div>this div replaced a paragraph.</div>"; console.log(p.nodename); // still "p"; the returned value will contain html es...
...caped attributes: var anc = document.createelement("a"); anc.href = "https://developer.mozilla.org?a=b&c=d"; console.log(anc.outerhtml); //
output: "<a href='https://developer.mozilla.org?a=b&c=d'></a>" specification specification status comment dom parsing and serializationthe definition of 'element.outerhtml' in that specification.
Element.setCapture() - Web APIs
1px; color: black; padding: 2px; box-shadow: black 2px 2px; } </style> <script type="text/javascript"> function init() { var btn = document.getelementbyid("mybutton"); if (btn.setcapture) { btn.addeventlistener("mousedown", mousedown, false); btn.addeventlistener("mouseup", mouseup, false); } else { document.getelementbyid("
output").innerhtml = "sorry, there appears to be no setcapture support on this browser"; } } function mousedown(e) { e.target.setcapture(); e.target.addeventlistener("mousemove", mousemoved, false); } function mouseup(e) { e.target.removeeventlistener("mousemove", mousemoved, false); } function mousemoved(e) { var
output = document.getel...
...ementbyid("
output");
output.innerhtml = "position: " + e.clientx + ", " + e.clienty; } </script> </head> <body onload="init()"> <p>this is an example of how to use mouse capture on elements in gecko 2.0.</p> <p><a id="mybutton" href="#">test me</a></p> <div id="
output">no events yet</div> </body> </html> view live examples notes the element may not be scrolled completely to the top or bottom, depending on the layout of other elements.
Element.tagName - Web APIs
example html <span id="born">when i was born...</span> javascript var span = document.getelementbyid("born"); console.log(span.tagname); in xhtml (or any other xml format), the original case will be maintained, so "span" would be
output in case the original tag name was created lowercase.
... in html, "span" would be
output instead regardless of the case used while creating the original document.
Event.preventDefault() - Web APIs
this example demonstrates how to prevent that from happening: javascript document.queryselector("#id-checkbox").addeventlistener("click", function(event) { document.getelementbyid("
output-box").innerhtml += "sorry!
... <code>preventdefault()</code> won't let you check this!<br>"; event.preventdefault(); }, false); html <p>please click on the checkbox control.</p> <form> <label for="id-checkbox">checkbox:</label> <input type="checkbox" id="id-checkbox"/> </form> <div id="
output-box"></div> result stopping keystrokes from reaching an edit field the following example demonstrates how invalid text input can be stopped from reaching the input field with preventdefault().
FileSystemDirectoryReader.readEntries() - Web APIs
example in this example, a drop zone is created, which responds to the drop event by scanning through the dropped files and directories,
outputting a hierarchical directory listing.
...find some files and directories and drag them in, and take a look at the resulting
output.
FileSystemFileEntry.createWriter() - Web APIs
example this example establishes a method, writetofileentry(), which
outputs a text string to the file corresponding to the passed-in directory entry.
...this blob is then
output to the filewriter object to be written to the file.
HTMLElement.innerText - Web APIs
html <h3>source element:</h3> <p id="source"> <style>#source { color: red; } #text { text-transform: uppercase; }</style> <span id=text>take a look at<br>how this text<br>is interpreted below.</span> <span style="display:none">hidden text</span> </p> <h3>result of textcontent:</h3> <textarea id="textcontent
output" rows="6" cols="30" readonly>...</textarea> <h3>result of innertext:</h3> <textarea id="innertext
output" rows="6" cols="30" readonly>...</textarea> javascript const source = document.getelementbyid("source"); const textcontent
output = document.getelementbyid("textcontent
output"); const innertext
output = document.getelementbyid("innertext
output"); textcontent
output.value = source.textcontent; i...
...nnertext
output.value = source.innertext; result specification specification status comment html living standardthe definition of 'innertext' in that specification.
HTMLImageElement.crossOrigin - Web APIs
const imageurl = "https://mdn.mozillademos.org/files/16797/clock-demo-400px.png"; const container = document.queryselector(".container"); function loadimage(url) { const image = new image(200, 200); image.addeventlistener("load", () => container.prepend(image) ); image.addeventlistener("error", () => { const errmsg = document.createelement("
output"); errmsg.value = `error loading image at ${url}`; container.append(errmsg); }); image.crossorigin = "anonymous"; image.alt = ""; image.src = url; } loadimage(imageurl); html <div class="container"> <p>here's a paragraph.
...thanks for reading me.</p> </div> css body { font: 1.125rem/1.5, helvetica, sans-serif; } .container { display: flow-root; width: 37.5em; border: 1px solid #d2d2d2; } img { float: left; padding-right: 1.5em; }
output { background: rgba(100, 100, 100, 0.1); font-family: courier, monospace; width: 95%; } result specifications specification status comment html living standardthe definition of 'htmlimageelement.crossorigin' in that specification.
In depth: Microtasks and the JavaScript runtime environment - Web APIs
consider the javascript program below: let
outputelem = document.getelementbyid("
output"); let userlanguages = { "mike": "en", "teresa": "es" }; function greetuser(user) { function localgreeting(user) { let greeting; let language = userlanguages[user]; switch(language) { case "es": greeting = `¡hola, ${user}!`; break; case "en": default: greeting = `hello, ${user}!`; break; ...
... } return greeting; }
outputelem.innerhtml += localgreeting(user) + "<br>\r"; } greetuser("mike"); greetuser("teresa"); greetuser("veronica"); this short program contains three execution contexts, some of which are created and destroyed several times over the course of the program's execution.
Dragging and Dropping Multiple Items - Web APIs
<html> <head> <script> function dodrop(event) { var dt = event.datatransfer; var count = dt.mozitemcount;
output("items: " + count + "\n"); for (var i = 0; i < count; i++) {
output(" item " + i + ":\n"); var types = dt.moztypesat(i); for (var t = 0; t < types.length; t++) {
output(" " + types[t] + ": "); try { var data = dt.mozgetdataat(types[t], i);
output("(" + (typeof data) + ") : <" + data + " >\n"); } catch (ex) {
output("<<error>>\n"); ...
...dump(ex); } } } } function
output(text) { document.getelementbyid("
output").textcontent += text; dump(text); } </script> </head> <body> <div id="
output" style="min-height: 100px; white-space: pre; border: 1px solid black;" ondragenter="document.getelementbyid('
output').textcontent = ''; event.stoppropagation(); event.preventdefault();" ondragover="event.stoppropagation(); event.preventdefault();" ondrop="event.stoppropagation(); event.preventdefault(); dodrop(event);"> <div> fix</div> </div> </body> </html> this example cancels both the dragenter and dragover events by calling the preventdefault().
KeyboardEvent.code - Web APIs
examples exercising keyboardevent html <p>press keys on the keyboard to see what the keyboardevent's key and code values are for each one.</p> <div id="
output"> </div> css #
output { font-family: arial, helvetica, sans-serif; border: 1px solid black; } javascript window.addeventlistener("keydown", function(event) { let str = "keyboardevent: key='" + event.key + "' | code='" + event.code + "'"; let el = document.createelement("span"); el.innerhtml = str + "<br/>"; document.getelementbyid("
output").appendchild(el); }, true); ...
... try it out to ensure that keystrokes go to the sample, click in the
output box below before pressing keys.
MediaDeviceInfo - Web APIs
the mediadeviceinfo interface contains information that describes a single media input or
output device.
... mediadeviceinfo.kindread only returns an enumerated value that is either "videoinput", "audioinput" or "audio
output".
MediaDevices - Web APIs
events devicechange fired when a media input or
output device is attached to or removed from the user's computer.
... enumeratedevices() obtains an array of information about the media input and
output devices available on the system.
MediaError.message - Web APIs
the error handler simply
outputs a message to a box onscreen describing the error, including both the code and the message.
...then the resulting text is
output to the log.
MediaTrackSettings.groupId - Web APIs
for example, a headset has two devices on it: a microphone which can serve as a source for audio tracks and a speaker which can serve as an
output for audio.
...however, it can be used to ensure that audio input and
output are both being performed on the same headset, for example, or to ensure that the built-in camera and microphone on a phone are being used for video conferencing purposes.
Transcoding assets for Media Source Extensions - Web APIs
run the following commands (shown with sample
output): $ python mp4-dash-encode.py -b 5 -v bunny_fragmented.mp4 encoding 5 bitrates, min bitrate = 500.0 max bitrate = 2000.0 media source: video: resolution=640x360 encoding bitrate: 500, resolution: 256x144 encoding bitrate: 875, resolution: 384x216 encoding bitrate: 1250, resolution: 480x270 encoding bitrate: 1625, resolution: 560x316 encoding bitrate: 2000, resolution: 640x360 $ python mp4-dash.
...p4 parsing media file 3: video_01250.mp4 parsing media file 4: video_01625.mp4 parsing media file 5: video_02000.mp4 splitting media file (audio) video_00500.mp4 splitting media file (video) video_00500.mp4 splitting media file (video) video_00875.mp4 splitting media file (video) video_01250.mp4 splitting media file (video) video_01625.mp4 splitting media file (video) video_02000.mp4 $ tree -l 2
output output ├── audio │ └── und ├── stream.mpd └── video ├── 1 ├── 2 ├── 3 ├── 4 └── 5 8 directories, 1 file note: mp4-dash-encode.py does not display ffmpeg error messages.
MessageChannel - Web APIs
when a message is received back from the iframe, the onmessage function simply
outputs the message to a paragraph.
... var channel = new messagechannel(); var
output = document.queryselector('.
output'); var iframe = document.queryselector('iframe'); // wait for the iframe to load iframe.addeventlistener("load", onload); function onload() { // listen for messages on port1 channel.port1.onmessage = onmessage; // transfer port2 to the iframe iframe.contentwindow.postmessage('hello from the main page!', '*', [channel.port2]); } // handle messages received on port1 function onmessage(e) {
output.innerhtml = e.data; } for a full working example, see our channel messaging basic demo on github (run it live too).
MessagePort - Web APIs
when a message is received back from the iframe, the onmessage function simply
outputs the message to a paragraph.
... var channel = new messagechannel(); var
output = document.queryselector('.
output'); var iframe = document.queryselector('iframe'); // wait for the iframe to load iframe.addeventlistener("load", onload); function onload() { // listen for messages on port1 channel.port1.onmessage = onmessage; // transfer port2 to the iframe iframe.contentwindow.postmessage('hello from the main page!', '*', [channel.port2]); } // handle messages received on port1 function onmessage(e) {
output.innerhtml = e.data; } for a full working example, see our channel messaging basic demo on github (run it live too).
Node.isEqualNode() - Web APIs
then we run some javascript to compare the nodes using isequalnode() and
output the results.
... html <div>this is the first element.</div> <div>this is the second element.</div> <div>this is the first element.</div> <p id="
output"></p> css #
output { width: 440px; border: 2px solid black; border-radius: 5px; padding: 10px; margin-top: 20px; display: block; } javascript let
output = document.getelementbyid("
output"); let divlist = document.getelementsbytagname("div");
output.innerhtml += "div 0 equals div 0: " + divlist[0].isequalnode(divlist[0]) + "<br/>";
output.innerhtml += "div 0 equals div 1: " + divlist[0].isequalnode(divlist[1]) + "<br/>";
output.innerhtml += "div 0 equals div 2: " + divlist[0].isequalnode(divlist[2]) + "<br/>"; results specifications specification status comment domthe definition of 'node.isequalnode' in that s...
Node.isSameNode() - Web APIs
then we run some javascript to compare the nodes using issamenode() and
output the results.
... html <div>this is the first element.</div> <div>this is the second element.</div> <div>this is the first element.</div> <p id="
output"></p> css #
output { width: 440px; border: 2px solid black; border-radius: 5px; padding: 10px; margin-top: 20px; display: block; } javascript let
output = document.getelementbyid("
output"); let divlist = document.getelementsbytagname("div");
output.innerhtml += "div 0 same as div 0: " + divlist[0].issamenode(divlist[0]) + "<br/>";
output.innerhtml += "div 0 same as div 1: " + divlist[0].issamenode(divlist[1]) + "<br/>";
output.innerhtml += "div 0 same as div 2: " + divlist[0].issamenode(divlist[2]) + "<br/>"; results specifications specification status comment domthe definition of 'node: issamenode' in that ...
OfflineAudioContext.startRendering() - Web APIs
syntax event-based version: offlineaudioctx.startrendering(); offlineaudioctx.oncomplete = function(e) { // e.renderedbuffer contains the
output buffer } promise-based version: offlineaudioctx.startrendering().then(function(buffer) { // buffer contains the
output buffer }); parameters none.
... when the startrendering() promise resolves, rendering has completed and the
output audiobuffer is returned out of the promise.
OfflineAudioContext - Web APIs
in contrast with a standard audiocontext, an offlineaudiocontext doesn't render the audio to the device hardware; instead, it generates it, as fast as it can, and
outputs the result to an audiobuffer.
... when the startrendering() promise resolves, rendering has completed and the
output audiobuffer is returned out of the promise.
OscillatorNode.setPeriodicWave() - Web APIs
the setperiodicwave() method of the oscillatornode interface is used to point to a periodicwave defining a periodic waveform that can be used to shape the oscillator's
output, when type is custom.
... syntax oscillatornode.setperiodicwave(wave); parameters wave a periodicwave object representing the waveform to use as the shape of the oscillator's
output.
OscillatorNode - Web APIs
it always has exactly one
output and no inputs.
... its basic property defaults (see audionode for definitions) are: number of inputs 0 number of
outputs 1 channel count mode max channel count 2 (not used in the default count mode) channel interpretation speakers constructor oscillatornode() creates a new instance of an oscillatornode object, optionally providing an object specifying default values for the node's properties.
PannerNode - Web APIs
a pannernode always has exactly one input and one
output: the input can be mono or stereo but the
output is always stereo (2 channels); you can't have panning effects without at least two audio channels!
... number of inputs 1 number of
outputs 1 channel count mode "clamped-max" channel count 2 channel interpretation "speakers" constructor pannernode.pannernode creates a new pannernode object instance.
PeriodicWave - Web APIs
the periodicwave interface defines a periodic waveform that can be used to shape the
output of an oscillatornode.
... periodicwave has no inputs or
outputs; it is used to define custom oscillators when calling oscillatornode.setperiodicwave().
Multi-touch interaction - Web APIs
<body onload="init();" style="touch-action:none"> <div id="target1"> tap, hold or swipe me 1</div> <div id="target2"> tap, hold or swipe me 2</div> <div id="target3"> tap, hold or swipe me 3</div> <!-- ui for logging/debugging --> <button id="log" onclick="enablelog(event);">start/stop event logging</button> <button id="clearlog" onclick="clearlog(event);">clear the log</button> <p></p> <
output></
output> </body> miscellaneous functions these functions support the application but aren't directly involved with the event flow.
...false : true; } function log(name, ev) { var o = document.getelementsbytagname('
output')[0]; var s = name + ": pointerid = " + ev.pointerid + " ; pointertype = " + ev.pointertype + " ; isprimary = " + ev.isprimary; o.innerhtml += s + " "; } function clearlog(event) { var o = document.getelementsbytagname('
output')[0]; o.innerhtml = ""; } ...
Pinch zoom gestures - Web APIs
nd hold with 2 pointers, then pinch in or out.<br/> the background color will change to pink if the pinch is opening (zoom in) or changes to lightblue if the pinch is closing (zoom out).</div> <!-- ui for logging/debugging --> <button id="log" onclick="enablelog(event);">start/stop event logging</button> <button id="clearlog" onclick="clearlog(event);">clear the log</button> <p></p> <
output></
output> </body> miscellaneous functions these functions support the application but aren't directly involved in the event flow.
...false : true; } function log(prefix, ev) { if (!logevents) return; var o = document.getelementsbytagname('
output')[0]; var s = prefix + ": pointerid = " + ev.pointerid + " ; pointertype = " + ev.pointertype + " ; isprimary = " + ev.isprimary; o.innerhtml += s + " "; } function clearlog(event) { var o = document.getelementsbytagname('
output')[0]; o.innerhtml = ""; } ...
RsaPssParams - Web APIs
rfc 3447 says that "typical salt lengths" are either 0 or the length of the
output of the digest algorithm that was selected when this key was generated.
... the maximum size of saltlength is given by: math.ceil((keysizeinbits - 1)/8) - digestsizeinbytes - 2 so for a key length of 2048 bits and a digest
output size of 32 bytes, the maximum size would be 222.
ScriptProcessorNode: audioprocess event - Web APIs
bubbles no cancelable no default action none interface audioprocessingevent event handler property scriptprocessornode.onaudioprocess examples scriptnode.addeventlistener('audioprocess', function(audioprocessingevent) { // the input buffer is a song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the
output buffer contains the samples that will be modified and played var
outputbuffer = audioprocessingevent.
outputbuffer; // loop through the
output channels (in this case there is only one) for (var channel = 0; channel <
outputbuffer.numberofchannels; channel++) { var inputdata = inputbuffer.getchanneldata(channel); var
outputdata =
outputbuffer.getchanneldata(channel); // loop thr...
...ough the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make
output equal to the same as the input
outputdata[sample] = inputdata[sample]; // add noise to each
output sample
outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } }) you could also set up the event handler using the scriptprocessornode.onaudioprocess property: scriptnode.onaudioprocess = function(audioprocessingevent) { ...
StereoPannerNode - Web APIs
number of inputs 1 number of
outputs 1 channel count mode "clamped-max" channel count 2 channel interpretation "speakers" constructor stereopannernode() creates a new instance of a stereopannernode object.
... moving the slider left and right while the music is playing pans the music across to the left and right speakers of the
output, respectively.
StylePropertyMapReadOnly - Web APIs
</p> <dl id="
output"></dl> we add a touch of css with a custom property to better demonstrate the
output: p { --somevariable: 1.6em; --someothervariable: translatex(33vw); --anothervariable: 42; line-height: var(--somevariable); } we add javascript to grab our paragraph and return back a definition list of all the default css property values using computedstylemap().
... // get the element const myelement = document.queryselector('p'); // get the <dl> we'll be populating const styleslist = document.queryselector('#
output'); // retrieve all computed styles with computedstylemap() const stylepropertymap = myelement.computedstylemap(); // iterate thru the map of all the properties and values, adding a <dt> and <dd> for each for (const [prop, val] of stylepropertymap) { // properties const cssproperty = document.createelement('dt'); cssproperty.appendchild(document.createtextnode(prop)); styleslist.appendchild(cssproperty); // values const cssvalue = document.createelement('dd'); cssvalue.appendchild(document.createtextnode(val)); styleslist.appendchild(cssvalue); } specifications specification status comment css typed om le...
WaveShaperNode - Web APIs
a waveshapernode always has exactly one input and one
output.
... number of inputs 1 number of
outputs 1 channel count mode "max" channel count 2 (not used in the default count mode) channel interpretation "speakers" constructor waveshapernode() creates a new instance of an waveshapernode object.
Advanced techniques: Creating and sequencing audio - Web APIs
when
outputting sound to a file or speakers we need to have a number to represent 0db full scale — the numerical limit of the fixed point media or dac.
... in floating point audio, 1 is a convenient number to map to "full scale" for mathematical operations on signals, so oscillators, noise generators and other sound sources typically
output bipolar signals in the range -1 to 1.
Using the Web Audio API - Web APIs
you have input nodes, which are the source of the sounds you are manipulating, modification nodes that change those sounds as desired, and
output nodes (destinations), which allow you to save or hear those sounds.
...for the most part, you don't need to create an
output node, you can just connect your other nodes to baseaudiocontext.destination, which handles the situation for you: track.connect(audiocontext.destination); a good way to visualise these nodes is by drawing an audio graph so you can visualize it.
Window.matchMedia() - Web APIs
examples this example runs the media query (max-width: 600px) and displays the value of the resulting mediaquerylist's matches property in a <span>; as a result, the
output will say "true" if the viewport is less than or equal to 600 pixels wide, and will say "false" if the window is wider than that.
... html <span class="mq-value"></span> a simple <span> to receive the
output.
Window.pageYOffset - Web APIs
html the html is extremely simple and has just two elements: an <iframe> that contains the document we're going to scroll, and a <div> into which we'll
output the value of pageyoffset when we've finished the scroll.
...ument.getelementbyid("info"); var target = framedoc.getelementbyid("overview"); framedoc.scrollingelement.scrolltop = target.offsettop; info.innertext = "y offset after scrolling: " + frame.contentwindow.pageyoffset + " pixels"; the javascript code begins by getting into frame and info the <iframe> element that contains our content as well as the <div> element into which we'll
output the result of our scroll position check.
Window: pageshow event - Web APIs
"persisted" : "not persisted"; console.log('event:', event.type, '-', ispersisted); break; default: console.log('event:', event.type); break; } }; events.foreach(eventname => window.addeventlistener(eventname, eventlogger) ); html <p>open the console and watch the
output as you navigate to and from this page.
... try loading new pages into this tab, then navigating forward and backward through history, noting the events’
output to the log.</p> results specifications specification status comment html living standardthe definition of 'pageshow' in that specification.
Window: unhandledrejection event - Web APIs
bubbles no cancelable yes interface promiserejectionevent event handler property onunhandledrejection usage notes allowing the unhandledrejection event to bubble will eventually result in an error message being
output to the console.
... // prevent the default handling (such as
outputting the // error to the console) event.preventdefault(); }); specifications specification status comment html living standardthe definition of 'unhandledrejection' in that specification.
WorkerGlobalScope.dump() - Web APIs
example to write an
output from your worker to your computer's terminal, you first have to run an instance of firefox started from your command line/terminal.
... next, run a worker containing the following line: dump('test\n'); this should result in a "test" message being
output to the terminal.
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
= cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(); req.open('get', url, true); req.addeventlistener("error", function(e) { var error = createtcperrorfromfailedxhr(req); dumpsecurityinfo(req, error); }, false); req.onload = function(e) { dumpsecurityinfo(req); }; req.send(); } then test("https://addons.mozilla.org"); produced the following
output in my console: connection status: succeeded security info: security state: secure common name (cn) = addons.mozilla.org organisation = mozilla corporation issuer = verisign, inc.
... sha1 fingerprint = f4:99:64:18:6b:7d:c8:fa:c0:0c:2e:a9:61:77:28:67:13:c4:97:7b valid from 7/14/2011 0:00:00 am valid until 8/20/2013 23:59:59 pm and here is the
output of making an https request to a server that uses an expired certificate: test("https://www.appliancetherapy.com/"); note that the security state has become "insecure" now and there is an error name reported: connection status: failed: securityexpiredcertificateerror security info: security state: insecure common name (cn) = www.appliancetherapy.com organisation = appliance therapy group (selane products, inc) issuer = verisign, inc.
XRPermissionDescriptor.mode - Web APIs
syntax xrpermissiondescriptor = { mode: xrsessionmode, requiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.mode = xrsessionmode; xrmode = xrpermissiondescriptor.mode; value a domstring whose value is one of the strings found in the xrsessionmode enumerated type: immersive-ar the session's
output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment.
... inline the
output is presented inline within the context of an element in a standard html document, rather than occupying the full visual space.
XRSessionMode - Web APIs
values immersive-ar the session's
output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment.
... inline the
output is presented inline within the context of an element in a standard html document, rather than occupying the full visual space.
XRSystem: requestSession() - Web APIs
the supported modes are: immersive-ar the session's
output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment.
... inline the
output is presented inline within the context of an element in a standard html document, rather than occupying the full visual space.
XRViewerPose.views - Web APIs
this array's length may potentially vary over the lifetime of the xrsession (for example, if the viewer enables or disables stereo mode on their xr
output device).
...0, 0, 0, 1); gl.cleardepth(1); gl.clear(gl.color_buffer_bit, gl.depth_buffer_bit); for (let view of pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /* render the scene for the eye view.eye */ } } passing each view to getviewport() returns the webgl viewport to apply in order to cause the rendered
output to be positioned correctly in the framebuffer for renderijng to the corresponding eye on the
output device.
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
if the scaling factor is greater than zero, then the frame buffer is smaller than the diplay's native dimensions, resulting in the
output being up-scaled for display to the screen after rendering into the frame buffer.
...this ensures that the scene we render will not only match the viewpoint we need to express (which is defined by the position and orientation data in the pose), but that the rendered
output will be constrained within the correct portion of the frame buffer for the eye we're drawing, regardless of any scaling that is being performed.
XSLTProcessor - Web APIs
an xsltprocessor applies an xslt stylesheet transformation to an xml document to produce a new xml document as
output.
... the resultant object depends on the
output method of the stylesheet:
output method result type html htmldocument xml xmldocument text xmldocument with a single root element <transformiix:result> with the text as a child [throws] void xsltprocessor.setparameter(string namespaceuri, string localname, any value) sets a parameter in the xslt stylesheet that w...
Web APIs
htmlimageelement htmlinputelement htmlisindexelement htmlkeygenelement htmllielement htmllabelelement htmllegendelement htmllinkelement htmlmapelement htmlmarqueeelement htmlmediaelement htmlmenuelement htmlmenuitemelement htmlmetaelement htmlmeterelement htmlmodelement htmlolistelement htmlobjectelement htmloptgroupelement htmloptionelement htmloptionscollection htmlorforeignelement html
outputelement htmlparagraphelement htmlparamelement htmlpictureelement htmlpreelement htmlprogresselement htmlquoteelement htmlscriptelement htmlselectelement htmlshadowelement htmlslotelement htmlsourceelement htmlspanelement htmlstyleelement htmltablecaptionelement htmltablecellelement htmltablecolelement htmltableelement htmltablerowelement htmltablesectionelement htmltemplateelement htmltextarea...
...observerentry interventionreportbody k keyboard keyboardevent keyboardlayoutmap keyframeeffect keyframeeffectoptions l largestcontentfulpaint layoutshift layoutshiftattribution linearaccelerationsensor linkstyle localfilesystem localfilesystemsync localmediastream location lock lockmanager lockedfile m midiaccess midiconnectionevent midiinput midiinputmap midimessageevent midi
outputmap mscandidatewindowhide mscandidatewindowshow mscandidatewindowupdate msgestureevent msgraphicstrust msmanipulationevent msrangecollection mssitemodeevent magnetometer mathmlelement mediacapabilities mediacapabilitiesinfo mediaconfiguration mediadecodingconfiguration mediadeviceinfo mediadevices mediaelementaudiosourcenode mediaencodingconfiguration mediaerror mediaimage mediakeyme...
Web Accessibility: Understanding Colors and Luminance - Accessibility
because of the current domination of the rgb color space in measuring color
output, most calculations in this document are presumed to be in the rgb color space, and very specifically, in the srgb color space.
... 3:1 is provided for icons understanding success criterion 1.4.3: contrast (minimum) wcag working group's wiki page on relative luminance contributers many, many thanks to wayne dick of the low vision task force of the w3c and the intense discussions on luminance; to teal for his help and discussions on human perception of the color blue and how software companies create algorithms for image
output based on it; and to tom jewett from knowbility; for the tools and educational resources he developed, that help us all.
:scope - CSS: Cascading Style Sheets
javascript let paragraph = document.getelementbyid("para"); let
output = document.getelementbyid("
output"); if (paragraph.matches(":scope")) {
output.innertext = "yep, the element is its own scope as expected!"; } html <p id="para"> this is a paragraph.
...</p> <p id="
output"></p> result direct children a situation where the :scope pseudo-class prove to be useful is when you need to get direct descendant of an already retrieved element.
color-index - CSS: Cascading Style Sheets
the color-index css media feature can be used to test the number of entries in the
output device's color lookup table.
... syntax the color-index feature is specified as an <integer> value representing the number of entries in the
output device's color lookup table.
color - CSS: Cascading Style Sheets
the color css media feature can be used to test the number of bits per color component (red, green, blue) of the
output device.
... syntax the color feature is specified as an <integer> value that represents the number of bits per color component (red, green, blue) of the
output device.
resolution - CSS: Cascading Style Sheets
the resolution css media feature can be used to test the pixel density of the
output device.
... syntax the resolution feature is specified as a <resolution> value representing the pixel density of the
output device.
border-image-slice - CSS: Cascading Style Sheets
html <div class="wrapper"> <div></div> </div> <ul> <li> <label for="width">slide to adjust <code>border-width</code></label> <input type="range" min="10" max="45" id="width"> <
output id="width-
output">30px</
output> </li> <li> <label for="slice">slide to adjust <code>border-image-slice</code></label> <input type="range" min="10" max="45" id="slice"> <
output id="slice-
output">30</
output> </li> </ul> css .wrapper { width: 400px; height: 300px; } div > div { width: 300px; height: 200px; border-width: 30px; border-style: solid; border-image: url(...
...https://udn.realityripple.com/samples/56/bb98f533ef.png); border-image-slice: 30; border-image-repeat: round; } li { display: flex; place-content: center; } javascript const widthslider = document.getelementbyid('width'); const sliceslider = document.getelementbyid('slice'); const width
output = document.getelementbyid('width-
output'); const slice
output = document.getelementbyid('slice-
output'); const divelem = document.queryselector('div > div'); widthslider.addeventlistener('input', () => { const newvalue = widthslider.value + 'px'; divelem.style.borderwidth = newvalue; width
output.textcontent = newvalue; }) sliceslider.addeventlistener('input', () => { const newvalue = sliceslider.value; divelem.style.borderimageslice = newvalue; slice
output.textcontent = newvalue; }) ...
<string> - CSS: Cascading Style Sheets
to
output new lines, you must escape them with a line feed character such as \a or \00000a.
...his is a string with \" an escaped double quote." "this string also has \22 an escaped double quote." 'this is a string with \' an escaped single quote.' 'this string also has \27 an escaped single quote.' "this is a string with \\ an escaped backslash." /* new line in a string */ "this string has a \aline break in it." /* string spanning two lines of code (these two strings will have identical
output) */ "a really long \ awesome string" "a really long awesome string" specifications specification status comment css values and units module level 3the definition of '<string>' in that specification.
Audio and Video Delivery - Developer guides
you take the stream you receive from getusermedia, pass it to a mediarecorder object, take the resulting
output and feed it to your audio or video source*.
... streaming media tutorials live streaming web audio and video live streaming technology is often employed to relay live events such as sports, concerts and more generally tv and radio programmes that are
output live.
Audio and video manipulation - Developer guides
in this case, we'll show both the source video and the
output greyscale frames.
... selecting an audio source the web audio api can receive audio from a variety of sources, then process it and send it back out to an audiodestinationnode representing the
output device to which the sound is sent after processing.
Constraint validation - Developer guides
the constraint validation is done in the following ways: by a call to the checkvalidity() or reportvalidity() method of a form-associated dom interface, (htmlinputelement, htmlselectelement, htmlbuttonelement, html
outputelement or htmltextareaelement), which evaluates the constraints only on this element, allowing a script to get this information.
... <input> <
output> <select> submit buttons (created with either a <button> element with the submit type, or an input element with the submit type.
<dialog>: The Dialog element - HTML: Hypertext Markup Language
elect> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select> </label></p> <menu> <button value="cancel">cancel</button> <button id="confirmbtn" value="default">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <
output aria-live="polite"></
output> javascript var updatebutton = document.getelementbyid('updatedetails'); var favdialog = document.getelementbyid('favdialog'); var
outputbox = document.queryselector('
output'); var selectel = document.queryselector('select'); var confirmbtn = document.getelementbyid('confirmbtn'); // "update details" button opens the <dialog> modally updatebutton.addeventlistener('...
...owmodal(); } else { alert("the <dialog> api is not supported by this browser"); } }); // "favorite animal" input sets the value of the submit button selectel.addeventlistener('change', function onselect(e) { confirmbtn.value = selectel.value; }); // "confirm" button of form triggers "close" on dialog because of [method="dialog"] favdialog.addeventlistener('close', function onclose() {
outputbox.value = favdialog.returnvalue + " button clicked - " + (new date()).tostring(); }); result specifications specification status comment html living standardthe definition of '<dialog>' in that specification.
<input type="button"> - HTML: Hypertext Markup Language
<div class="toolbar"> <input type="color" aria-label="select pen color"> <input type="range" min="2" max="50" value="30" aria-label="select pen size"><span class="
output">30</span> <input type="button" value="clear canvas"> </div> <canvas class="mycanvas"> <p>add suitable fallback here.</p> </canvas> body { background: #ccc; margin: 0; overflow: hidden; } .toolbar { background: #ccc; width: 150px; height: 75px; padding: 5px; } input[type="color"], input[type="button"] { width: 90%; margin: 0 auto; display: block; } input[type="range"...
... bottom: 5px; } var canvas = document.queryselector('.mycanvas'); var width = canvas.width = window.innerwidth; var height = canvas.height = window.innerheight-85; var ctx = canvas.getcontext('2d'); ctx.fillstyle = 'rgb(0,0,0)'; ctx.fillrect(0,0,width,height); var colorpicker = document.queryselector('input[type="color"]'); var sizepicker = document.queryselector('input[type="range"]'); var
output = document.queryselector('.
output'); var clearbtn = document.queryselector('input[type="button"]'); // covert degrees to radians function degtorad(degrees) { return degrees * math.pi / 180; }; // update sizepicker
output value sizepicker.oninput = function() {
output.textcontent = sizepicker.value; } // store mouse pointer coordinates, and whether the button is pressed var curx; var cury;...
<input type="file"> - HTML: Hypertext Markup Language
nd pdf files, might look like this: <input type="file" accept="image/*,.pdf"> using file inputs a basic example <form method="post" enctype="multipart/form-data"> <div> <label for="file">choose file to upload</label> <input type="file" id="file" name="file" multiple> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } this produces the following
output: note: you can find this example on github too — see the source code, and also see it running live.
... let's look at a more complete example: <form method="post" enctype="multipart/form-data"> <div> <label for="profile_pic">choose file to upload</label> <input type="file" id="profile_pic" name="profile_pic" accept=".jpg, .jpeg, .png"> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } this produces a similar-looking
output to the previous example: note: you can find this example on github too — see the source code, and also see it running live.
<input type="radio"> - HTML: Hypertext Markup Language
the html is revised to add a <pre> block to
output the form data into: <form> <p>please select your preferred contact method:</p> <div> <input type="radio" id="contactchoice1" name="contact" value="email"> <label for="contactchoice1">email</label> <input type="radio" id="contactchoice2" name="contact" value="phone"> <label for="contactchoice2">phone</label> <input type="radio" id="contactchoice3" ...
... <div> <button type="submit">submit</button> </div> </form> <pre id="log"> </pre> then we add some javascript to set up an event listener on the submit event, which is sent when the user clicks the "submit" button: var form = document.queryselector("form"); var log = document.queryselector("#log"); form.addeventlistener("submit", function(event) { var data = new formdata(form); var
output = ""; for (const entry of data) {
output =
output + entry[0] + "=" + entry[1] + "\r"; }; log.innertext =
output; event.preventdefault(); }, false); try this example out and see how there's never more than one result for the contact group.
<sup>: The Superscript element - HTML: Hypertext Markup Language
for example: <p>one of the most common equations in all of physics is <var>e</var>=<var>m</var><var>c</var><sup>2</sup>.<p> the resulting
output looks like this: superior lettering superior lettering is not technically the same thing as superscript.
...among the most common uses of superior lettering is the presentation of certain abbreviations in french: <p>robert a présenté son rapport à m<sup>lle</sup> bernard.</p> the resulting
output: ordinal numbers ordinal numbers, such as "fourth" in english or "quinto" in spanish may be abbreviated using numerals and language-specific text rendered in superscript: <p>the ordinal number "fifth" can be abbreviated in various languages as follows:</p> <ul> <li>english: 5<sup>th</sup></li> <li>french: 5<sup>ème</sup></li> </ul> the
output: specifications specification status comment html living standardthe definition of '<sub> and <sup>' in that specification.
<tr>: The Table Row element - HTML: Hypertext Markup Language
result let's actually look at the
output first this time: notice how the heading area here is actually two rows, one with "name", "id", "membership dates", and "balance" headings, and the other with "joined" and "canceled", which are sub-headings below "membership dates".
... table { border: 1px solid black; } th, td { border: 1px solid black; } result the
output is entirely unchanged, despite the addition of useful contextual information under the hood: basic styling as is the case with all parts of a table, you can change the appearance of a table row and its contents using css.
<var>: The Variable element - HTML: Hypertext Markup Language
usage notes related elements other elements that are used in contexts in which <var> is commonly used include: <code>: the html code element <kbd>: the html keyboard input element <samp>: the html sample
output element if you encounter code that is mistakenly using <var> for style purposes rather than semantic purposes, you should either use a <span> with appropriate css or, an appropriate semantic element among the following: <em> <i> <q> default style most browsers apply font-style to "italic" when rendering <var>.
... <p>a simple equation: <var>x</var> = <var>y</var> + 2 </p> the
output: overriding the default style using css, you can override the default style for the <var> element.
HTML elements reference - HTML: Hypertext Markup Language
<samp> the html sample element (<samp>) is used to enclose inline text which represents sample (or quoted)
output from a computer program.
... <
output> the html
output element (<
output>) is a container element into which a site or app can inject the results of a calculation or the outcome of a user action.
HTML documentation index - HTML: Hypertext Markup Language
172 <
output>: the
output element element, html, html forms, html5, html:flow content, reference, web the html
output element (<
output>) is a container element into which a site or app can inject the results of a calculation or the outcome of a user action.
... 186 <samp>: the sample
output element element, html, html text-level semantics, inline sample, reference, sample
output, sample text, web the html sample element (<samp>) is used to enclose inline text which represents sample (or quoted)
output from a computer program.
Data URLs - HTTP
echo -n hello|base64 #
outputs to console: agvsbg8= echo -n hello>a.txt base64 a.txt #
outputs to console: agvsbg8= base64 a.txt>b.txt #
outputs to file b.txt: agvsbg8= encoding on microsoft windows encoding on windows can be done through powershell or some dedicated tool.
... [convert]::tobase64string([text.encoding]::utf8.getbytes("hello")) #
outputs to console: agvsbg8= bash -c "echo -n hello`|base64" #
outputs to console: agvsbg8= # the backtick (`) is used to escape the piping (|) character here common problems this section describes problems that commonly occur when creating and using data urls.
Functions - JavaScript
a function in javascript is similar to a procedure—a set of statements that performs a task or calculates a value, but for a procedure to qualify as a function, it should take some input and return an
output where there is some obvious relationship between the input and the
output.
...the stack-like behavior can be seen in the following example: function foo(i) { if (i < 0) return; console.log('begin: ' + i); foo(i - 1); console.log('end: ' + i); } foo(3); //
output: // begin: 3 // begin: 2 // begin: 1 // begin: 0 // end: 0 // end: 1 // end: 2 // end: 3 nested functions and closures you may nest a function within another function.
Using Promises - JavaScript
read the following example: new promise((resolve, reject) => { console.log('initial'); resolve(); }) .then(() => { throw new error('something failed'); console.log('do this'); }) .catch(() => { console.error('do that'); }) .then(() => { console.log('do this, no matter what happened before'); }); this will
output the following text: initial do that do this, no matter what happened before note: the text do this is not displayed because the something failed error caused a rejection.
...you can capture these for analysis and handling by your code—or just to avoid having them cluttering up your
output—by adding a handler for the unhandledrejection event, like this: window.addeventlistener("unhandledrejection", event => { /* you might start here by adding code to examine the promise specified by event.promise and the reason in event.reason */ event.preventdefault(); }, false); by calling the event's preventdefault() method, you tell the javascript runtime not to do its defau...
Private class fields - JavaScript
class classwithprivatemethod { #privatemethod() { return 'hello world' } getprivatemessage() { return this.#privatemethod() } } const instance = new classwithprivatemethod() console.log(instance.getprivatemessage()) // expected
output: "hello world" private instance methods may be generator, async, or async generator functions.
... private getters and setters are also possible: class classwithprivateaccessor { #message get #decoratedmessage() { return `✨${this.#message}✨` } set #decoratedmessage(msg) { this.#message = msg } constructor() { this.#decoratedmessage = 'hello world' console.log(this.#decoratedmessage) } } new classwithprivateaccessor(); // expected
output: "✨hello world✨" specifications specification public and private instance fieldsthe definition of 'fielddefinition' in that specification.
Classes - JavaScript
// unnamed let rectangle = class { constructor(height, width) { this.height = height; this.width = width; } }; console.log(rectangle.name); //
output: "rectangle" // named let rectangle = class rectangle2 { constructor(height, width) { this.height = height; this.width = width; } }; console.log(rectangle.name); //
output: "rectangle2" note: class expressions are subject to the same hoisting restrictions as described in the class declarations section.
... a function with a superclass as input and a subclass extending that superclass as
output can be used to implement mix-ins in ecmascript: let calculatormixin = base => class extends base { calc() { } }; let randomizermixin = base => class extends base { randomize() { } }; a class that uses these mix-ins can then be written like this: class foo { } class bar extends calculatormixin(randomizermixin(foo)) { } specifications specification ecmascript (ecma-262)...
Array.prototype.flatMap() - JavaScript
let arr1 = ["it's sunny in", "", "california"]; arr1.map(x => x.split(" ")); // [["it's","sunny","in"],[""],["california"]] arr1.flatmap(x => x.split(" ")); // ["it's","sunny","in", "", "california"] notice, the
output list length can be different from the input list length.
...[n] : [n-1, 1] ) // expected
output: [4, 1, 4, 20, 16, 1, 18] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.flatmap' in that specification.
Array.prototype.sort() - JavaScript
out a compare function:', numericstringarray.sort()); console.log('sorted with comparenumbers:', numericstringarray.sort(comparenumbers)); console.log('mixednumericarray:', mixednumericarray.join()); console.log('sorted without a compare function:', mixednumericarray.sort()); console.log('sorted with comparenumbers:', mixednumericarray.sort(comparenumbers)); this example produces the following
output.
... as the
output shows, when a compare function is used, numbers sort correctly whether they are numbers or numeric strings.
Date.prototype.toLocaleString() - JavaScript
however, this might change in the future, and isn't guaranteed for all languages;
output variations are by design, and allowed by the specification.
... most notably, the ie and edge browsers insert bidirectional control characters around dates, so the
output text will flow properly when concatenated with other text.
Intl.DateTimeFormat.prototype.format() - JavaScript
however, this might change in the future and isn't guaranteed for all the languages —
output variations are by design and allowed by the specification.
... most notably, the ie and edge browsers insert bidirectional control characters around dates, so the
output text will flow properly when concatenated with other text.
Intl.DateTimeFormat.prototype.formatToParts() - JavaScript
examples datetimeformat
outputs localized, opaque strings that cannot be manipulated directly: var date = date.utc(2012, 11, 17, 3, 0, 42); var formatter = new intl.datetimeformat('en-us', { weekday: 'long', year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', fractionalseconddigits: 3, hour12: true, timezone: 'utc' }); formatter.format(date); // "mond...
... not set in the bag (to any value), the result will include only the relatedyear: let df = new intl.datetimeformat("zh-u-ca-chinese"); df.formattoparts(date.utc(2012, 11, 17, 3, 0, 42)); // return value [ { type: 'relatedyear', value: '2012' }, { type: 'literal', value: '年' }, { type: 'month', value: '十一月' }, { type: 'day', value: '4' } ] in cases where the year would be
output, .format() may commonly present these side-by-side: let df = new intl.datetimeformat("zh-u-ca-chinese", {year: "numeric"}); df.format(date.utc(2012, 11, 17, 3, 0, 42)); // return value 2012壬辰年 this also makes it possible to mix locale and calendar in both format: let df = new intl.datetimeformat("en-u-ca-chinese", {year: "numeric"}); let date = date.utc(2012, 11, 17, 3, 0, 42); df.fo...
Object.prototype.constructor - JavaScript
function tree(name) { this.name = name } let thetree = new tree('redwood') console.log('thetree.constructor is ' + thetree.constructor) this example displays the following
output: thetree.constructor is function tree(name) { this.name = name } changing the constructor of an object the following example shows how to modify the constructor value of generic objects.
..., math, new number(), 1, // remains unchanged new object(), {}, new regexp(), /(?:)/, new string(), 'test' // remains unchanged ] for (let i = 0; i < types.length; i++) { types[i].constructor = type types[i] = [types[i].constructor, types[i] instanceof type, types[i].tostring()] } console.log(types.join('\n')) this example displays the following
output (comments added for reference): function type() {},false, // new array() function type() {},false, // [] function type() {},false,false // new boolean() function boolean() { [native code] },false,true // true function type() {},false,mon sep ...
Promise.any() - JavaScript
const perr = new promise((resolve, reject) => { reject("always fails"); }); const pslow = new promise((resolve, reject) => { settimeout(resolve, 500, "done eventually"); }); const pfast = new promise((resolve, reject) => { settimeout(resolve, 100, "done quick"); }); promise.any([perr, pslow, pfast]).then((value) => { console.log(value); // pfast fulfils first }) // expected
output: "done quick" rejections with aggregateerror promise.any() rejects with an aggregateerror if no promise fulfils.
... const perr = new promise((resolve, reject) => { reject('always fails'); }); promise.any([perr]).catch((err) => { console.log(err); }) // expected
output: "aggregateerror: no promise in promise.any was resolved" displaying the first image loaded in this example, we have a function that fetches an image and returns a blob.
String length - JavaScript
lows: object.defineproperty(string.prototype, 'charlength', { get () { return getcharacterlength(this); } }); console.log('a\ud87e\udc04z'.charlength); // 3 examples basic usage let x = 'mozilla'; let empty = ''; console.log(x + ' is ' + x.length + ' code units long'); /* "mozilla is 7 code units long" */ console.log('the empty string has a length of ' + empty.length); // expected
output: "the empty string has a length of 0" assigning to length let mystring = "bluebells"; // attempting to assign a value to a string's .length property has no observable effect.
... mystring.length = 4; console.log(mystring); // expected
output: "bluebells" console.log(mystring.length); // expected
output: 9 specifications specification ecmascript (ecma-262) ...
String.prototype.matchAll() - JavaScript
() prior to the addition of matchall to javascript, it was possible to use calls to regexp.exec (and regexes with the /g flag) in a loop to obtain all the matches: const regexp = regexp('foo[a-z]*','g'); const str = 'table football, foosball'; let match; while ((match = regexp.exec(str)) !== null) { console.log(`found ${match[0]} start=${match.index} end=${regexp.lastindex}.`); // expected
output: "found football start=6 end=14." // expected
output: "found foosball start=16 end=24." } with matchall available, you can avoid the while loop and exec with g.
... instead, by using matchall, you get an iterator to use with the more convenient for...of, array spread, or array.from() constructs: const regexp = regexp('foo[a-z]*','g'); const str = 'table football, foosball'; const matches = str.matchall(regexp); for (const match of matches) { console.log(`found ${match[0]} start=${match.index} end=${match.index + match[0].length}.`); } // expected
output: "found football start=6 end=14." // expected
output: "found foosball start=16 end=24." // matches iterator is exhausted after the for..of iteration // call matchall again to create a new iterator array.from(str.matchall(regexp), m => m[0]); // array [ "football", "foosball" ] matchall will throw an exception if the g flag is missing.
String.prototype.slice() - JavaScript
str2 = str1.slice(1, 8), str3 = str1.slice(4, -2), str4 = str1.slice(12), str5 = str1.slice(30); console.log(str2) //
output: he morn console.log(str3) //
output: morning is upon u console.log(str4) //
output: is upon us.
... console.log(str5) //
output: "" using slice() with negative indexes the following example uses slice() with negative indexes.
String.prototype.split() - JavaScript
if separator is a regular expression with capturing parentheses, then each time separator matches, the results (including any undefined results) of the capturing parentheses are spliced into the
output array.
...og('the array has ', arrayofstrings.length, ' elements: ', arrayofstrings.join(' / ')) } const tempeststring = 'oh brave new world that has such people in it.' const monthstring = 'jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec' const space = ' ' const comma = ',' splitstring(tempeststring, space) splitstring(tempeststring) splitstring(monthstring, comma) this example produces the following
output: the original string is: "oh brave new world that has such people in it." the separator is: " " the array has 10 elements: oh / brave / new / world / that / has / such / people / in / it.
String - JavaScript
console.log(eval(s2.valueof())) // returns the number 4 escape notation special characters can be encoded using escape notation: code
output \xxx (where xxx is 1–3 octal digits; range of 0–377) iso-8859-1 character / unicode code point between u+0000 and u+00ff \' single quote \" double quote \\ backslash \n new line \r carriage return \v vertical tab \t tab \b backspace \f form feed \uxxxx (wher...
...for example: let
outputstrings = [] for (let i = 0, n = inputvalues.length; i < n; ++i) {
outputstrings.push(string(inputvalues[i])); } specifications specification ecmascript (ecma-262)the definition of 'string' in that specification.
Property accessors - JavaScript
this
outputs 'value', since 1 is coerced into '1'.
... let object = {} object['1'] = 'value' console.log(object[1]) this also
outputs 'value', since both foo and bar are converted to the same string.
label - JavaScript
examples using a labeled continue with for loops var i, j; loop1: for (i = 0; i < 3; i++) { //the first for statement is labeled "loop1" loop2: for (j = 0; j < 3; j++) { //the second for statement is labeled "loop2" if (i === 1 && j === 1) { continue loop1; } console.log('i = ' + i + ', j = ' + j); } } //
output is: // "i = 0, j = 0" // "i = 0, j = 1" // "i = 0, j = 2" // "i = 1, j = 0" // "i = 2, j = 0" // "i = 2, j = 1" // "i = 2, j = 2" // notice how it skips both "i = 1, j = 1" and "i = 1, j = 2" using a labeled continue statement given an array of items and an array of tests, this example counts the number of items that passes all the tests.
...ems[i])) { continue top; } } itemspassed++; } using a labeled break with for loops var i, j; loop1: for (i = 0; i < 3; i++) { //the first for statement is labeled "loop1" loop2: for (j = 0; j < 3; j++) { //the second for statement is labeled "loop2" if (i === 1 && j === 1) { break loop1; } console.log('i = ' + i + ', j = ' + j); } } //
output is: // "i = 0, j = 0" // "i = 0, j = 1" // "i = 0, j = 2" // "i = 1, j = 0" // notice the difference with the previous continue example using a labeled break statement given an array of items and an array of tests, this example determines whether all items pass all tests.
Template literals (Template strings) - JavaScript
in that case, the tag expression (usually a function) gets called with the template literal, which you can then manipulate before
outputting.
... // let str2 = strings[2]; let agestr; if (ageexp > 99){ agestr = 'centenarian'; } else { agestr = 'youngster'; } // we can even return a string built using a template literal return `${str0}${personexp}${str1}${agestr}`; } let
output = mytag`that ${ person } is a ${ age }`; console.log(
output); // that mike is a youngster tag functions don't even need to return a string!
Authoring MathML - MathML
</head> <body> <p>$\sqrt{a^2-3c}$</p> <p>$$ {\sum_{i=1}^n i} = \frac{n(n+1)}{2} $$</p> </body> </html> then to generate the html page input.html with tex expressions replaced by mathml expressions, just do cat input.html | itex2mml >
output.html there are even more sophisticated tools to convert arbitrary latex documents into html+mathml.
...for example, this will split the pages at the \section level: latexmlc --dest foo.html --splitat=section foo.tex server-side conversion pros: conversion is done server-side and the mathml
output can be cached, which is more efficient and cleaner than client-side conversion.
Digital audio concepts - Web media technologies
generally, lossy compression results in significantly smaller
output than lossless compression methods; also, many lossy codecs are excellent, with the loss in quality and detail being difficult or even impossible for the average listener to discern.
... average bit rate the first method for controlling the quality of the
output file is to specify the average bit rate (abr) to target when encoding the audio.
Populating the page: how browsers work - Web Performance
some browser engines take the abstract syntax tree and pass it into an interpreter,
outputting bytecode which is executed on the main thread.
... tags that aren't going to be displayed, like the <head> and its children and any nodes with display: none, such as the script { display: none; } you will find in user agent stylesheets, are not included in the render tree as they will not appear in the rendered
output.
Subresource Integrity - Web security
tools for generating sri hashes you can generate sri hashes from the command-line with openssl using a command invocation such as this: cat filename.js | openssl dgst -sha384 -binary | openssl base64 -a or with shasum using a command invocation such as this: shasum -b -a 384 filename.js | awk '{ print $1 }' | xxd -r -p | base64 notes: the pipe-through-xxd step takes the hexadecimal
output from shasum and converts it to binary.
... the pipe-through-awk step is necessary because shasum will pass the hashed filename in its
output to xxd.
translate - XPath
example <xsl:value-of select="translate('the quick brown fox.', 'abcdefghijklmnopqrstuvwxyz', 'abcdefghijklmnopqrstuvwxyz')" />
output the quick brown fox.
... example <xsl:value-of select="translate('the quick brown fox.', 'brown', 'red')" />
output the quick red fdx.
<xsl:copy> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:copy> element transfers a shallow copy (the node and any associated namespace node) of the current node to the
output document.
... optional attributes use-attribute-sets lists attribute sets that should be applied to the
output node, if it is an element.
<xsl:message> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:message> element
outputs a message (to the javascript console in ns) and optionally terminates execution of the stylesheet.
...the default value is "no", in which case the message is
output and execution continues.
WebAssembly Concepts - WebAssembly
writing a rust application and targeting webassembly as its
output.
...it’s very easy to modify the emscripten
output and turn it into whatever web app you require.
Working with Events - Archive of obsolete content
var tabs = require("sdk/tabs"); function listener1() { console.log("listener 1"); tabs.removelistener("ready", listener1); } function listener2() { console.log("listener 2"); } tabs.on("ready", listener1); tabs.on("ready", listener2); tabs.open("https://www.mozilla.org"); tabs.open("https://www.mozilla.org"); we should see
output like this: info: tabevents: listener 1 info: tabevents: listener 2 info: tabevents: listener 2 listeners will be removed automatically when the add-on is unloaded.
l10n - Archive of obsolete content
and the following code: var _ = require("sdk/l10n").get; console.log(_("hello_string")); the following
output will be logged: info: hello!
simple-storage - Archive of obsolete content
read", icon: "./read.png", onclick: function() { console.log(ss.storage.value); } }); require("sdk/ui/button/action").actionbutton({ id: "delete", label: "delete", icon: "./delete.png", onclick: function() { delete ss.storage.value; console.log("deleting value"); } }); if you run it, you'll see that after clicking "read" after clicking "delete" gives you the expected
output: info: undefined note that to run this add-on you'll have to save icon files named "write.png", "read.png", and "delete.png" to the add-on's "data" directory.
cfx to jpm - Archive of obsolete content
permanently removed options jpm has dropped support for: --extra-packages --use-config --package-path --pkgdir --no-strip-xpi --harness-option --manifest-overload --
output-file --templatedir --keydir --profiledir --overload-modules --static-args --app --no-run --addons --e10s --logfile --dependencies --force-mobile --test-runner-pkg instead of --profiledir and --overload-modules, use --profile and --overload.
Creating Event Targets - Archive of obsolete content
console.log("visited ", bookmarkservice.getbookmarkuri(aitemid).spec); }, queryinterface: xpcomutils.generateqi([ci.nsinavbookmarkobserver]) }; exports.main = function() { bookmarkservice.addobserver(bookmarkobserver, false); }; exports.onunload = function() { bookmarkservice.removeobserver(bookmarkobserver); } try running this add-on, adding and visiting bookmarks, and observing the
output in the console.
List Open Tabs - Archive of obsolete content
you'll see
output in the command line console that looks something like this: info: http://www.mozilla.org/about/ info: http://www.bbc.co.uk/ you don't get direct access to any content hosted in the tab.
Listen for Page Load - Archive of obsolete content
the following add-on listens to the tab's built-in ready event and just logs the url of each tab as the user loads it: require("sdk/tabs").on("ready", logurl); function logurl(tab) { console.log(tab.url); } you will find this console
output in the browser console, not the web console.
XPCOM Objects - Archive of obsolete content
floating point float boolean boolean, prbool void void timestamps prtime this type is used to pass timestamps measured in milliseconds, such as the
output of the gettime() method in a javascript date object.
Signing an extension - Archive of obsolete content
sign the basic usage of the signing tool is as follows: nss-signtool \ -d (path to the directory that contains your certificate database files) \ -k (your certificate nickname) \ -p (your certificate password) \ -x -z (
output path/name of signed file) \ (path to your extension working directory that contains chrome directory, chrome.manifest file, install.rdf file, etc.) writing your password directly in the script is dangerous.
Supporting search suggestions in search plugins - Archive of obsolete content
(this means that a suggestion-supporting engine plugin will have two <url> elements, the other one being the main text/html search url.) for example, the yahoo search plugin has this <url> entry: <url type="application/x-suggestions+json" template="http://ff.search.yahoo.com/gossip?
output=fxjson&command={searchterms}"/> if the user types "fir" into the search bar, then pauses, firefox inserts "fir" in place of {searchterms} and queries that url: <url type="application/x-suggestions+json" template="http://ff.search.yahoo.com/gossip?
output=fxjson&command=fir"/> the results are used to construct the suggestion list box.
Adding preferences to an extension - Archive of obsolete content
be called as a callback, we can't rely on // "this" referring to the right object, so we need to reference // it by its full name var symbol = stockwatcher.tickersymbol; var fullurl = "http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=" + symbol; function inforeceived() { var samplepanel = document.getelementbyid('stockwatcher2'); var
output = httprequest.responsetext; if (
output.length) { // remove any whitespace from the end of the string
output =
output.replace(/\w*$/, ""); // build the tooltip string var fieldarray =
output.split(","); samplepanel.label = symbol + ": " + fieldarray[1]; samplepanel.tooltiptext = "chg: " + fieldarray[4] + " | " + "open: " +...
Index of archived content - Archive of obsolete content
implementation status mozilla xforms specials mozilla xforms user interface xforms alert element xforms group element xforms help element xforms hint element xforms input element xforms label element xforms message element xforms
output element xforms range element xforms repeat element xforms secret element xforms select element xforms select1 element xforms submit element xforms switch module xforms textarea element xforms trigger element xforms upload element ...
JXON - Archive of obsolete content
"script": { "@type": "text/javascript", "keyvalue": "alert(\"welcome!\");" }, "style": "p:first-letter {\n font: italic bold 30px georgia, serif;\n}" }, "body": { "h1": "my html document", "p": "hello world!!" } } }; /* create the document */ var omyhtmldoc = jxon.unbuild(omyhtmlstruct, "http://www.w3.org/1999/xhtml"); …and here is the
output of alert((new xmlserializer()).serializetostring(omyhtmldoc)): <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>my html document</title> <script type="text/javascript"> alert("welcome!"); </script> <style> p:first-letter { font: italic bold 30px georgia, serif; } </style> </head> <body> <h1>my html document</h1> <p>hel...
Microsummary XML grammar reference - Archive of obsolete content
example the microsummary generator created in the creating a microsummary tutorial: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> <
output method="text"/> <template match="/"> <value-of select="id('download-count')"/> <text> fx downloads</text> </template> </transform> </template> <pages> <include>http://(www\.)?spreadfirefox\.com/(index\.php)?</include> </pages> </generator> namespace the namespace uri for microsummary generator xml documents is: http://www.mozilla.org/microsummaries/0.1 ...
Microsummary topics - Archive of obsolete content
generator from the creating a microsummary tutorial: var generatortext = ' \ <?xml version="1.0" encoding="utf-8"?> \ <generator xmlns="http://www.mozilla.org/microsummaries/0.1" \ name="firefox download count" \ uri="urn:{835daeb3-6760-47fa-8f4f-8e4fdea1fb16}"> \ <template> \ <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> \ <
output method="text"/> \ <template match="/"> \ <value-of select="id(\'download-count\')"/> \ <text> fx downloads</text> \ </template> \ </transform> \ </template> \ <pages> <include>http://(www\.)?spreadfirefox\.com/(index\.php)?</include> </pages> </generator> \ '; var domparser = components.classes["@mozilla.org/xmlextras/domparser;1"].
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
[setup] appname=my app appvername=my app 1.0 apppublisher=mark finkle apppublisherurl=http://developer.mozilla.org/en/docs/getting_started_with_xulrunner appsupporturl=http://developer.mozilla.org/en/docs/getting_started_with_xulrunner appupdatesurl=http://developer.mozilla.org/en/docs/getting_started_with_xulrunner defaultdirname={pf}\my app defaultgroupname=my app allownoicons=yes
outputdir=..\build\
output outputbasefilename=myapp-1.0-win32 ; setupiconfile= compression=lzma solidcompression=yes [languages] name: english; messagesfile: compiler:default.isl [components] name: main; description: my app; types: full compact custom; flags: fixed name: runtime; description: xul runner runtime; types: full custom [tasks] name: desktopicon; description: {cm:createdesktopicon}; groupde...
Mozprocess - Archive of obsolete content
nv={}, # environment to use for the process; defaults to os.environ ) exit_code = process.waitforfinish(timeout=60) # seconds see an example in https://github.com/mozilla/mozbase/b...profilepath.py processhandler may be subclassed to handle process timeouts (by overriding the ontimeout() method), process completion (by overriding onfinish()), and to process the command
output (by overriding process
outputline()).
2006-11-10 - Archive of obsolete content
3 and tried to build it on fc3 with the following options: ./configure --enable-application=browser --prefix=$prefix --enable-extensions=default,spatialnavigation then he tried running "make" and received the following error: /usr/bin/ld: testtarray.o(.text+0x2237): unresolvable relocation against symbol `nstarray_base::semptyhdr' /usr/bin/ld: final link failed: nonrepresentable section on
output collect2: ld returned 1 exit status gmake[3]: *** [testtarray] error 1 gmake[3]: leaving directory `/usr/mozilla2/src/mozilla/xpcom/tests' gmake[2]: *** [libs] error 2 gmake[2]: leaving directory `/usr/mozilla2/src/mozilla/xpcom' gmake[1]: *** [tier_2] error 2 gmake[1]: leaving directory `/usr/mozilla2/src/mozilla' make: *** [default] error 2 he is not sure what is wrong with his build, and is ...
NPSavedData - Archive of obsolete content
you can use the plug-in's npp_destroy() function to allocate an npsaveddata object using the npn_memalloc() function, fill in the fields, and return it to the browser as an
output parameter.
SAX - Archive of obsolete content
below is an example of parsing from a string: xmlreader.parsefromstring("<f:a xmlns:f='g' d='1'><bbq/></f:a>", "text/xml"); this call results in the following
output (assuming the content handler from the example above is used): startdocument startelement: namespace='g', localname='a', qname='f:a', attributes={d='1'} startelement: namespace='', localname='bbq', qname='bbq', attributes={} endelement: namespace='', localname='bbq', qname='bbq' endelement: namespace='g', localname='a', qname='f:a' enddocument ...
Scratchpad - Archive of obsolete content
unlike the web console, which is designed for interpreting a single line of code at a time, scratchpad lets you edit larger chunks of javascript code, then execute it in various ways depending on how you want to use the
output.
Using workers in extensions - Archive of obsolete content
that file, ticker_worker.js, is shown here: var symbol = ""; function refreshinformation() { if (!symbol) { throw "no symbol set!"; } var fullurl = "http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=" + symbol; function inforeceived() { var
output = httprequest.responsetext; if (
output) { postmessage(
output.trim()); } httprequest = null; } var httprequest = new xmlhttprequest(); httprequest.open("get", fullurl, true); httprequest.onload = inforeceived; httprequest.send(null); } setinterval(function() { refreshinformation(); }, 10*60*1000); onmessage = function(event) { if (event.data) { symbol = event...
::-ms-browse - Archive of obsolete content
t margin-bottom margin-left margin-right margin-top opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-browse example html <label>select image: <input type="file"></label> css input[type="file"]::-ms-browse { color: red; background-color: yellow; } result
output example specifications not part of any specification.
CSS - Archive of obsolete content
stereo
output produce a lateral sound stage, while binaural headphones and multi-speaker setups allow for a fully three-dimensional stage.display-insidethe display-inside css property specifies the inner display type of the box generated by an element, dictating how its contents lay out inside the box.display-outsidethe display-outside css property specifies the outer display type of the box generated by an el...
E4X for templating - Archive of obsolete content
lse if (typeof item === 'string') { ret += new xml(item); } else { var ser = (new xmlserializer()).serializetostring(item); ret += new xml(ser); } }); return ret; } example: var fruits = <fruits> <item>pear</item> <item>banana</item> <item>grapes</item> </fruits>; alert( // using a javascript 1.8 expression closure <
output> {sort(fruits.*, function (a, b) a.text() > b.text() /* text() call may not be necessary */ )} </
output>.toxmlstring() ); /* <
output> <item>banana</item> <item>grapes</item> <item>pear</item> </
output> */ the above utility also works if the input is an htmlcollection, an array of strings, an array of dom objects, or an array of e4x objects (assuming the comparison function is changed...
Enumerator - Archive of obsolete content
ng += drv.path + " - "; if (drv.isready){ var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; drivestring += freegb.tofixed(3) + " gb free of "; drivestring += totalgb.tofixed(3) + " gb"; } else{ drivestring += "not ready"; } drivestring += "<br />";; e.movenext(); } document.write(drivestring); //
output: <drive information properties the enumerator object has no properties.
Error.number - Archive of obsolete content
var x = y; } catch(e) { document.write ("error code: "); document.write (e.number & 0xffff) document.write ("<br />"); document.write ("facility code: ") document.write(e.number>>16 & 0x1fff) document.write ("<br />"); document.write ("error message: ") document.write (e.message) } example the
output of this code is as follows.
ScriptEngine() - Archive of obsolete content
example the following example illustrates the use of the scriptengine function: if (window.scriptengine) { console.log(window.scriptengine()); } //
output: jscript requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards, internet explorer 11 standards.
ScriptEngineBuildVersion - Archive of obsolete content
example the following example illustrates the use of the scriptenginebuildversion function: if(window.scriptenginebuildversion) { console.log(window.scriptenginebuildversion()); } //
output: <current build version> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards, internet explorer 11 standards.
ScriptEngineMajorVersion - Archive of obsolete content
example the following example illustrates the use of the scriptenginemajorversion function: if (window.scriptenginemajorversion) { console.log(window.scriptengine()); }
output: <current major version> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards, internet explorer 11 standards.
ScriptEngineMinorVersion - Archive of obsolete content
if (window.scriptengineminorversion) { console.log(window.scriptengineminorversion()); } //
output: <current minor version> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards, internet explorer 11 standards.
Object.prototype.__noSuchMethod__ - Archive of obsolete content
examples simple test of __nosuchmethod__ var o = { __nosuchmethod__: function(id, args) { console.log(id, '(' + args.join(', ') + ')'); } }; o.foo(1, 2, 3); o.bar(4, 5); o.baz(); //
output // foo (1, 2, 3) // bar (4, 5) // baz () using __nosuchmethod__ to simulate multiple inheritance an example of code that implements a primitive form of multiple inheritance is shown below.
Debugging CSS - Learn web development
to create a reduced test case: if your markup is dynamically generated — for example via a cms — make a static version of the
output that shows the problem.
Introduction to CSS layout - Learn web development
basic block level element.</p> <p class="positioned">i am a basic block level element.</p> <p>i am a basic block level element.</p> this html will be styled by default using the following css: body { width: 500px; margin: 0 auto; } p { background-color: rgb(207,232,220); border: 2px solid rgb(79,185,227); padding: 10px; margin: 10px; border-radius: 5px; } the rendered
output is as follows: relative positioning relative positioning allows you to offset an item from the position in normal flow it would have by default.
How CSS is structured - Learn web development
<div class="box"></div> .box { margin: 30px; width: 100px; height: 100px; background-color: rebeccapurple; transform: rotate(0.8turn) } the
output from the above code looks like this: look up different values of properties listed below.
Using CSS generated content - Learn web development
html a text where i need to <span class="ref">something</span> css .ref::before { font-weight: bold; color: navy; content: "reference "; }
output the character set of a stylesheet is utf-8 by default, but it can also be specified in the link, in the stylesheet itself, or in other ways.
Advanced form styling - Learn web development
file input types inputs of type file are generally ok — as you saw in our example, it is fairly easy to create something that fits in ok with the rest of the page — the
output line that is part of the control will inherit the parent font if you tell the input to do so, and you can style the custom list of file names and sizes in any way you want; we created it after all.
Other form controls - Learn web development
previous overview: forms next we now look at the functionality of non-<input> form elements in detail, from other control types such as drop-down lists and multi-line text fields, to other useful form features such as the <
output> element (which we saw in action in the previous article), and progress bars.
Debugging HTML - Learn web development
you will know when all your errors are fixed when you see the following banner in your
output: summary so there we have it, an introduction to debugging html, which should give you some useful skills to count on when you start to debug css, javascript, and other types of code later on in your career.
HTML table advanced features and accessibility - Learn web development
d="table1"> <tr> <th>title1</th> <th>title2</th> <th>title3</th> </tr> <tr> <td id="nested"> <table id="table2"> <tr> <td>cell1</td> <td>cell2</td> <td>cell3</td> </tr> </table> </td> <td>cell2</td> <td>cell3</td> </tr> <tr> <td>cell4</td> <td>cell5</td> <td>cell6</td> </tr> </table> the
output of which looks something like this: title1 title2 title3 cell1 cell2 cell3 cell2 cell3 cell4 cell5 cell6 tables for visually impaired users let's recap briefly on how we use data tables.
Index - Learn web development
you can check if the unique ids are working by temporarily adding more <to-do-item></to-do-item> calls into app.vue, and then checking their rendered
output with your browser's devtools.
Introducing asynchronous JavaScript - Learn web development
it will then move to the next line and begin executing the fetch() block but, because fetch() executes asynchronously without blocking, code execution continues after the promise-related code, thereby reaching the final console.log() statement (all done!) and
outputting it to the console.
Test your skills: Events - Learn web development
note: in the examples below, if there is an error in your code it will be
outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
Test your skills: Functions - Learn web development
note: in the examples below, if there is an error in your code it will be
outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
Test your skills: Loops - Learn web development
loops 2 in this next task, we want you to write a simple program that, given a name, searches an array of objects containing names and phone numbers (phonebook) and, if it finds the name,
outputs the name and phone number into the paragraph (para) and then exits the loop before it has run its course.
Silly story generator - Learn web development
will generate another random silly story if you press the button again (and again...) the following screenshot shows an example of what the finished program should
output: to give you more of an idea, have a look at the finished example (no peeking at the source code!) steps to complete the following sections describe what you need to do.
Test your skills: Arrays - Learn web development
note: in the examples below, if there is an error in your code it will be
outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
Test your skills: Math - Learn web development
note: in the examples below, if there is an error in your code it will be
outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
Test your skills: Strings - Learn web development
note: in the examples below, if there is an error in your code it will be
outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
Object prototypes - Learn web development
you can check out existing prototype properties for yourself — go back to our previous example and try entering the following into the javascript console: person.prototype the
output won't show you very much because we haven't defined anything on our custom constructor's prototype!
Test your skills: JSON - Learn web development
note: in the example below, if there is an error in your code it will be
outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
Test your skills: Object basics - Learn web development
note: in the examples below, if there is an error in your code it will be
outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
Multimedia: Images - Learn web development
pngs can be saved with three different
output combinations: 24 bit color + 8 bit transparency — offer full color acurracy and smooth transparencies at the expense of size.
Getting started with Ember - Learn web development
starting the development server you may start the app in development mode by typing the following command in your terminal, while inside the todomvc directory: ember server this should give you an
output similar to the following: build successful (190ms) – serving on http://localhost:4200/ slowest nodes (totaltime >= 5%) | total (avg) -----------------------------------------+----------- broccolimergetrees (17) | 35ms (2 ms) package /assets/vendor.js (1) | 13ms concat: vendor styles/assets/vend...
Ember interactivity: Events, classes and state - Learn web development
run this terminal command to generate a service for us to store our todo-list data in: ember generate service todo-data this should give you a terminal
output like so: installing service create app/services/todo-data.js installing service-test create tests/unit/services/todo-data-test.js this creates a todo-data.js file inside the todomvc/app/services directory to contain our service, which initially contains an import statement and an empty class: import service from '@ember/service'; export default class tododataservice extends service { } ...
Deploying our app - Learn web development
you should now be able to run the following command in the root of your project directory to run the production build step (first quit the running process with ctrl + c if you need to): npm run build this should give you an
output like the following, showing you the production files that were created, how big they are, and how long they took to build: dist/src.99d8a31a.js.map 446.15 kb 63ms dist/src.99d8a31a.js 172.51 kb 5.55s dist/stars.7f1dd035.svg 6.31 kb 145ms dist/asteriod2.3ead4904.svg 3.51 kb 155ms dist/asteriod1.698d75e9.svg 2.9 kb 153ms dist/src.84f2edd1.css.m...
Mozilla's Section 508 Compliance
gnopernicus support in beta no screen reader support on mac os x b) at least one mode of operation and information retrieval that does not require visual acuity greater than 20/70 shall be provided in audio and enlarged print
output working together or independently, or support for assistive technology used by people who are visually impaired shall be provided.
Browser chrome tests
requestlongertimeout(2); waitforexplicitfinish(); settimeout(completetest, 40000); } function completetest() { ok(true, "timeout did not run"); finish(); } exceptions in tests any exceptions thrown under test() will be caught and reported in the test
output as a failure.
Continuous Integration
the sheriffs' role is to "keep the tree green", or in other words, to keep the code in our respositories in a good state, to the extent that the state is reflected in the
output shown on treeherder.
Creating MozSearch plugins
h/"> <shortname>yahoo</shortname> <description>yahoo search</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16">data:image/x-icon;base64,r0lgodlheaaqajecap8aaaaaap///waaach5baeaaaialaaaaaaqabaaaaipli+py+0nogquybdened2khkffwuamezmpzsfmaihphrrguum/ft+uwaaow==</image> <url type="application/x-suggestions+json" method="get" template="http://ff.search.yahoo.com/gossip?
output=fxjson&command={searchterms}" /> <url type="text/html" method="get" template="http://search.yahoo.com/search"> <param name="p" value="{searchterms}"/> <param name="ei" value="utf-8"/> <mozparam name="fr" condition="pref" pref="yahoo-fr" /> </url> <searchform>http://search.yahoo.com/</searchform> </searchplugin> let's say the user chooses to use the yahoo!
Capturing a minidump
you should now see a "command" text window with debug
output at the top and an input box at the bottom.
OS TARGET
os_target is typically the
output of the 'uname -s' command on the target platform.
Updating NSPR or NSS in mozilla-central
check for new or removed files $ hg addremove -n review the
output to make sure it looks correct update the minimum required system nss version in old-configure.in.
Reviewer Checklist
make sure the patch doesn't create any unused code (e.g., remove strings when removing a feature) all caught exceptions should be logged at the appropriate level, bearing in mind personally identifiable information, but also considering the expense of computing and recording log
output.
Experimental features in Firefox
nightly 74 no developer edition 74 no beta 74 no release 74 no preference name dom.input_events.beforeinput.enabled htmlmediaelement method: setsinkid() htmlmediaelement.setsinkid() allows you to set the sink id of an audio
output device on an htmlmediaelement, thereby changing where the audio is being
output.
Limitations of frame scripts
examples of apis add-on authors should avoid in frame scripts: nsifileinputstream nsifile
outputstream constructing a file from a string or nsifile (but file objects can be sent via message manager) htmlinputelement.mozsetfilenamearray (alternative: mozsetfilearray) xul and browser ui anything that tries to touch the browser ui or anything to do with xul is likely to not work in the content process.
Communicating with frame scripts
logs all the messages details: // chrome script messagemanager.addmessagelistener("my-addon@me.org:my-e10s-extension-message", listener); function listener(message) { console.log(message.name); console.log(message.sync); console.log(message.data); console.log(message.target); console.log(message.objects); } so combining this message listener with the message above will give console
output somewhat like this, when the user clicks a <div>: "my-addon@me.org:my-e10s-extension-message" false object { details: "they clicked", tag: "div" } <xul:browser anonid="initialbrowser" ...
Limitations of frame scripts
for example: nsifileinputstream nsifile
outputstream constructing a file from a string or nsifile (but file objects can be sent via message manager) htmlinputelement.mozsetfilenamearray (alternative: mozsetfilearray) file: uris, see bug 1187099 <...> xul and browser ui anything that tries to touch the browser ui or anything to do with xul is likely not to work in the content process.
Tracking Protection
note that with firefox for android, you can access console
output using the remote debugger.
JavaScript OS.Constants
error values eacces permission denied eagain resource temporarily unavailable ebadf bad file descriptor eexist file exists efault bad address efbig file too large einval invalid argument eio input/
output error eisdir is a directory eloop (not always available under windows) too many levels of symbolic links.
Log.jsm
); and the methods mentioned below: logger methods loggerrepository(); length: 0 keys of prototype: getlogger(); rootlogger storagestreamappender(); length: 1 keys of prototype: doappend(); getinputstream(); new
outputstream();
outputstream reset(); structuredformatter(); length: 0 keys of prototype: format(); method overview enumerateinterfaces(); length: 0 enumerateproperties(); length: 2 member fields variable type description ...
SourceMap.jsm
this is useful as the final intermediate representation a compiler might use before
outputting the generated js and source map.
JavaScript code modules
netutil.jsm provides helpful networking utility functions, including the ability to easily copy data from an input stream to an
output stream asynchronously.
Bootstrapping a new locale
we'll first navigate to the directory called "browser" by running the following commands one after the other from your command line: $ cd [ab-cd]/browser/chrome/browser to see what is contained in "browser" type $ ls and, you should see the following
output from your terminal: aboutcerterror.dtd pageinfo.dtd aboutdialog.dtd pageinfo.properties aboutprivatebrowsing.dtd pagereportfirsttime.dtd aboutrobots.dtd places aboutsessionrestore.dtd preferences aboutsupport.dtd quitdialog.properties basemenuoverlay.dtd safemode.dtd browser.dtd safebrowsing b...
Localization and Plurals
chrome://mozapps/locale/downloads/do...tes,hours,days chrome://mozapps/locale/downloads/do...dstitlepercent chrome://browser/locale/browser.prop...auseddownloads version history 0.1: initial version with pluralrule check, properties input loading, table generation, sample
output display 0.2: use pluralform.numforms() to get the number of forms instead of figuring out locally to better support future rules - requires build from 2007/01/27 or later 0.3: generate a list of what numbers fall into which plural form to minimize the sample
output to at most 3 of each form developing with pluralform the functionality for getting the correct plural forms is provided by a java...
Localizing with Koala
here's a quick summary of what the
output of the comparison means: files: "unmodified" - the file is completely translated.
GC and CC logs
output to a file can be controlled with the moz_gctimer environment variable.
Gecko Profiler FAQ
how do we know when profiler
output is statistically significant (for comparing across runs / across machines)?
Intel Power Gadget
understanding the power gadget
output the following screenshot (from the mac version) demonstrates the available measurements.
Memory reporting
return moz_collect_report( "explicit/mystring", kind_heap, units_bytes, gmystring->sizeofincludingthis(mallocsizeof), "memory used for mystring."); } }; ns_impl_isupports1(mystringreporter, nsimemoryreporter) note that moz_define_malloc_size_of defines a function of type mozilla::mallocsizeof that is specific to this memory reporter (and will be identified as such in dmd's
output).
about:memory
0%) ++ jid1-xufzosoflzsoxg@jetpack/js-non-window/zones/zone(0x100496800) │ ├───5,574,608 b (00.58%) -- {59c81df5-4b7a-477b-912d-4e0fdf64e5f2} │ │ ├──5,529,280 b (00.57%) -- window-objects │ │ │ ├──4,175,584 b (00.43%) ++ top(chrome://chatzilla/content/chatzilla.xul, id=4293) │ │ │ └──1,353,696 b (00.14%) ++ top(chrome://chatzilla/content/
output-window.html, id=4298) │ │ └─────45,328 b (00.00%) ++ js-non-window/zones/zone(0x100496800)/compartment([system principal], file:///users/njn/library/application%20support/firefox/profiles/puna0zr8.new/extensions/%7b59c81df5-4b7a-477b-912d-4e0fdf64e5f2%7d/components/chatzilla-service.js) │ └───1,872,144 b (00.19%) ++ treestyletab@piro.sakura.ne.jp/js-non-window/zone...
NSS 3.16.2 release notes
notable changes in nss 3.16.2 the btoa command has a new command-line option -w suffix, which causes the
output to be wrapped in begin/end lines with the given suffix.
NSS 3.38 release notes
when using certutil -o to print the chain for a given certificate nickname, the new parameter --simple-self-signed may be provided, which can avoid ambiguous
output in some scenarios.
NSS 3.44.2 release notes
bugs fixed in nss 3.44.2 bug 1582343 - soft token mac verification not constant time bug 1577953 - remove arbitrary hkdf
output limit by allocating space as needed this bugzilla query returns all the bugs fixed in nss 3.44.2: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.44.2 compatibility nss 3.44.2 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.45 release notes
only relevant for clients that might have copied the unit test code verbatim bug 1550022 - ensure nssutil3 gets built on android bug 1528174 - chacha20poly1305 should no longer modify
output length on failure bug 1549382 - don't leak in pkcs#11 modules if c_getslotinfo() returns error bug 1551041 - fix builds using gcc < 4.3 on big-endian architectures bug 1554659 - add versioning to openbsd builds to fix link time errors using nss bug 1553443 - send session ticket only after handshake is marked as finished bug 1550708 - fix gyp scripts on solaris sparc so that libfreebl_64...
NSS 3.46.1 release notes
bugs fixed in nss 3.46.1 bug 1582343 - soft token mac verification not constant time bug 1577953 - remove arbitrary hkdf
output limit by allocating space as needed this bugzilla query returns all the bugs fixed in nss 3.46.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.46.1 compatibility nss 3.46.1 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.46 release notes
for aes-kw bug 1571316 - curve25519_32.c:280: undefined reference to `pr_assert' when building nss 3.45 on armhf-linux bug 1516593 - client to generate new random during renegotiation bug 1563258 - fips.sh fails due to non-existent "resp" directories bug 1561598 - remove -wmaybe-uninitialized warning in pqg.c bug 1560806 - increase softoken password max size to 500 characters bug 1568776 -
output paths relative to repository in nss coverity bug 1453408 - modutil -changepw fails in fips mode if password is an empty string bug 1564727 - use a pss spki when possible for delegated credentials bug 1493916 - fix ppc64 inline assembler for clang bug 1561588 - remove -wmaybe-uninitialized warning in p7env.c bug 1561548 - remove -wmaybe-uninitialized warning in pkix_pl_ldapdefaultclient.c bu...
NSS 3.47 release notes
aes hw acceleration on armv8 bug 1549225 - disable dsa signature schemes for tls 1.3 bug 1586947 - pk11_importandreturnprivatekey does not store nickname for ec keys bug 1586456 - unnecessary conditional in pki3hack, pk11load and stanpcertdb bug 1576307 - check mechanism param and param length before casting to mechanism-specific structs bug 1577953 - support longer (up to rfc maximum) hkdf
outputs bug 1508776 - remove refcounting from sftk_freesession (cve-2019-11756) bug 1494063 - support tls exporter in tstclnt and selfserv bug 1581024 - heap overflow in nss utility "derdump" bug 1582343 - soft token mac verification not constant time bug 1578238 - handle invald tag sizes for ckm_aes_gcm bug 1576295 - check all bounds when encrypting with seed_cbc bug 1580286 - nss rejects tls 1.
NSS API Guidelines
nsigned char *outbuf, secbufferlen *outlen, secbufferlenmaxoutlength, unsigned char *inbuf, secbufferleninlen) encrypt and decrypt like functions which have different properties, additional parameters, callbacks, etc., should insert their additional parameters between the context (first parameter) and the
output buffer.
NSS Sample Code Sample1
ne; *pubkey = seckey_converttopublickey(prvkey); if (!*pubkey) { rv = 1; goto done; } done: if (prvkey) seckey_destroyprivatekey(prvkey); return rv; } int server::wrapkey(pk11symkey *key, seckeypublickey *pubkey, secitem **ret) { int rv = 0; secitem *data; secstatus s; data = (secitem *)port_zalloc(sizeof(secitem)); if (!data) { rv = 1; goto done; } // allocate space for
output of wrap data->len = seckey_publickeystrength(pubkey); data->data = new unsigned char[data->len]; if (!data->data) { rv = 1; goto done; } s = pk11_pubwrapsymkey(ckm_rsa_pkcs, pubkey, key, data); if (s != secsuccess) { rv = 1; goto done; } *ret = data; data = 0; done: if (data) secitem_freeitem(data, pr_true); return rv; } // example of how to do a raw export (no wrapping of ...
NSS Sample Code sample3
ed char *digest, unsigned int len) { int i; cout << "length: " << len << endl; for(i = 0;i < len;i++) printf("%02x ", digest[i]); cout << endl; } /* * main */ int main(int argc, const char *argv[]) { int status = 0; pk11slotinfo *slot = 0; pk11symkey *key = 0; pk11context *context = 0; unsigned char data[80]; unsigned char digest[20]; /*is there a way to tell how large the
output is?*/ unsigned int len; secstatus s; /* initialize nss * if your application code has already initialized nss, you can skip it * here.
nss tech note6
32fpu_3.sl for cpus that do multiply operations faster in floating point, with a corresponding libfreebl_32fpu_3.chk libfreebl_32int_3.sl for other pa-risc cpus, with a corresponding libfreebl_32int_3.chk on the 64-bit hp-ux pa-risc architecture, there is only one freebl library, called libfreebl3.sl, with a corresponding libfreebl3.chk applications should always use nss binaries that are the
output of the regular nss build process.
New NSS Samples
see https://bugzilla.mozilla.org/show_bug.cgi?id=490238 how to download the samples: hg clone https://hg.mozilla.org/projects/nss; cd nss; hg update samples_branch samples list: sample code 1: hashing sample code 2: init nss database sample code 3: encrypt/decrypt and mac using token sample code 4: encrypt/decrypt and mac using session objects sample code 5: encrypt/decrypt/mac
output public key as a csr sample code 6: encrypt/decrypt/mac generating a pkcs#11 csr common code used by these samples: sample code 0: utilities thanks are due to shailendra jain, mozilla community member, who is the principal author of these samples.
Python binding for NSS
add certificate_summary_format_lines() utility to generate concise certificate identification info for
output.
FC_Digest
pusdigestlen [in, out] pointer to the maximum size of the
output buffer, replaced by the length of the message digest if the operation is successful.
FC_GetFunctionList
syntax ck_rv fc_getfunctionlist(ck_function_list_ptr *ppfunctionlist); parameters fc_getfunctionlist has one parameter: ppfunctionlist [
output] the address of a variable that will receive a pointer to the list of function pointers.
JSAPI User Guide
*name = js_getfunctionid((jsfunction*)func); const char *entexit; const char *namestr; /* build a c string for the function's name */ if (!name) { namestr = "unnamed function"; } else { namestr = js_encodestring(cx, name); } /* build a string for whether we're entering or exiting */ if (entering) { entexit = "entering"; } else { entexit = "exiting"; } /*
output information about the trace */ printf("%s javascript function: %s at time: %ld", entexit, namestr, clock()); } void enabletracing(jscontext *cx) { js_setfunctioncallback(cx, functransition); } void disabletracing(jscontext *cx) { js_setfunctioncallback(cx, nullptr); } ...
JS_FileEscapedString
if quote is not 0, it must be a single or double quote character that will quote the
output.
JS_FlattenString
note: the input and
output of js_flattenstring() are the same actual gc-thing so only one needs to be rooted.
Setting up CDT to work on SpiderMonkey
under the "providers" group tab, select "cdt gcc build
output parser" and add the string |(ccache) to the end of the "compiler command pattern" text input.
TPS Tests
it will include log
output written by the python driver, which includes information about where the temporary profiles it uses are stored.
Thread Sanitizer
the default way of symbolizing the traces is much slower than using llvm-symbolizer for that purpose: llvm ships with a symbolizer binary that tsan will readily use to immediately
output symbolized traces much faster.
Web Replay
when a call or message is intercepted, the wrapped call/message is first performed normally and then it and its
outputs are recorded in a data stream for the thread performing the call.
Mozinfo
example
output: os: linux version: ubuntu 10.10 bits: 32 processor: x86 three of these fields, os, bits, and processor, have a finite set of choices.
Secure Development Guidelines
r issues example class foo { private: char *ptr; public: foo() {} ~foo() { if (ptr) free(ptr); } }; constructor/destructor issues: prevention initialize the data members of an object in the constructor writing secure code: miscellaneous file i/o a lot can go wrong because a lot can be done with file input and
output filenames permissions file handles and descriptors file i/o: filename divided in directories, subdirectories, and the file itself ‘/’ is separator; in windows ‘\’ would work too int openfile(char *file) { handle fh; if (strstr(file, “\”)) return -1; fh = createfilea(file, ...); writefile(fh, data, sizeofdata, null, null); } ...
Setting up an update server
then run these commands, substituting <obj dir>, <mar
output path>, <version> and <channel> appropriately: ./mach package touch "<obj dir>/dist/firefox/precomplete" mar="<obj dir>/dist/host/bin/mar.exe" moz_product_version=<version> mar_channel_id=<channel> ./tools/update-packaging/make_full_update.sh <mar
output path> "<obj dir>/dist/firefox" for a local build, <channel> can be default, and <version> can be the value from browser/config/version.txt (or...
isNonBlocking
this content is now available at nsi
outputstream.isnonblocking().
write
this content is now available at nsi
outputstream.write().
writeFrom
this content is now available at nsi
outputstream.writefrom().
writeSegments
this content is now available at nsi
outputstream.writesegments().
nsIPropertyBag
to do this use nsipropertybag: services.sysinfo.getproperty("version"); //
output 5.1 services.sysinfo.getproperty("name"); //
output windows_nt services.sysinfo.getproperty("arch"); //
output x86 services.sysinfo.getproperty("haswindowstouchinterface"); //
outputs false or true if windows touch is there consult the uxp repo (//github.com/realityripple/uxp/blob/master/xpcom/base/nssysteminfo.cpp) for the properties supported.
nsIRequest
this will close any open input or
output streams and terminate any async requests.
nsIScriptError
tostring()
outputs a string representing the error message described by the object.
nsIScriptableUnescapeHTML
this is equivalent to calling nsiparserutils::converttoplaintext(src, nsidocumentencoder::
outputselectiononly | nsidocumentencoder::
outputabsolutelinks, 0).
nsISocketTransport
inherits from: nsitransport last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: connection setup is triggered by opening an input or
output stream, it does not start on its own.
nsITransferable
flavorstransferablecanexport() returns a list of flavors (mime types as nsisupportscstring) that the transferable can export, either through intrinsic knowledge or
output data converters.
nsIZipReader
erik because we want everything listed out while (entries.hasmore()) { var entrypointer = entries.getnext(); //just a string of "zip path" (this means path to file in zip, and it uses forward slashes remember) var entry = zr.getentry(entrypointer); // should return true on `entry instanceof ci.nsizipentry` console.log('entrypointer', entrypointer); /* console
output * "entrypointer" "bootstrap.js" scratchpad/1:18 */ console.info('entry', entry); /* console
output * "entry" xpcwrappednative_nohelper { queryinterface: queryinterface(), compression: getter, size: getter, realsize: getter, crc32: getter, isdirectory: getter, lastmodifiedtime: getter, issynthetic: getter, permissions: getter, compression: 8 } scratchpad/...
XPCOM Interface Reference by grouping
nsidirectoryenumerator nsidirectoryiterator nsidirectoryservice nsidirectoryserviceprovider nsidirectoryserviceprovider2 nsidirindex nsidirindexlistener nsidirindexparser nsifile nsilocalfile stream nsiasyncinputstream nsiasync
outputstream nsiasyncstreamcopier nsibinaryinputstream nsibinary
outputstream nsicontentsniffer nsiconverterinputstream nsifileinputstream nsifile
outputstream nsiinputstream nsiinputstreamcallback nsi
outputstream nsi
outputstreamcallback nsiscriptableinputstream ...
Getting Started Guide
all these cases show that automatically addrefing on `
output' makes nscomptrs and raw-pointers act differently from the point of view of the clients.
Generating xpt on Windows
assuming you installed your xulrunner sdk at <mozsdkdir>, you then need to issue a command similar to c:\working-dir> <mozsdkdir>\sdk\bin\typelib.py <inputfile.idl> -o <
outputfile.xpt> -i <mozsdkdir>\idl ...
XPIDL Syntax
this may be followed by the language, as in `%{c++', to
output the raw fragment only in the specified language.
xpidl
``/tmp/nsithing) for
output -e use explicit
output filename -d write dependencies (requires -e) -m specify
output mode: header generate c++ header (.h) typelib generate xpconnect typelib (.xpt) doc generate html documentation (.html) java generate java interface (.java) ...
XSLT 2.0
error and diagnostics
output from saxon-ce can be reviewed in the firefox developer console or in firebug.
Index
bug 493414), but in the meantime, it would be helpful to be able to get useful
output on stderr about exceptions, events and pretty-printed objects.
MailNews fakeserver
saction the transaction is an object with two properties: us, and them; us is an array of responses we sent, them an array of commands received resettest none nothing prepares the server for the next test without closing the connection start port number nothing starts the server listening stop none nothing stops the server and closes the connection using fakeserver in qa testing debug
output from fakeservers it is possible to get the fakeservers to dump to the console the commands they have sent and received.
libmime content type handlers
sample content type handler plugin to see an example of a content type handler plugin, the source for the handler of the content type "text/calendar" can be viewed at the following link: calendar plugin note: this plugin simply creates a blue table in the
output stream to identify the fact that it is operational, but the basic constructs of what is needed to build a functional content type handler can be seen.
Using the Mozilla symbol server
the
output of this command should be similar to: symchk: fullsoft.dll failed - image is split correctly, but fullsoft.dbg is missing symchk: qfaservices.dll failed - qfaservices.pdb mismatched or not found symchk: talkback.exe failed - built without debugging information.
Declaring and Calling Functions
example: no input parameters in this example, we declare the libc clock() function, which returns the elapsed time since system startup, then fetch and
output that value.
Constants - Plugins
version feature constants npvers constant: version feature information value description npvers_has_stream
output 8 streaming data.
Plug-in Basics - Plugins
ep acces | grep -v search | grep plugins access("/home/user_name/.mozilla/firefox/dqh2nb5k.default-1441864569209/plugins", f_ok) = -1 enoent (no such file or directory) access("/home/user_name/.mozilla/plugins", f_ok) = -1 enoent (no such file or directory) access("/usr/lib64/firefox/browser/plugins", f_ok) = -1 enoent (no such file or directory) access("/usr/lib/mozilla/plugins", f_ok) = 0 this
output i have after close firefox.
Inspecting web app manifests - Firefox Developer Tools
when you open the application panel’s manifest view on a page that doesn't have an app manifest successfully deployed, you'll get the following
output shown: deploying a manifest to get a manifest deployed successfully, you need to include a <link> element in the <head> of your document that points to your .webmanifest file: <link rel="manifest" href="/manifest.webmanifest"> the .webmanifest extension is recommended in the spec, and should be served with an application/manifest+json mime type, although browsers generally tend to support manifests with other appropriate extensions like .json (mime type: application/json).
Debugging service workers - Firefox Developer Tools
when you open the application panel’s service workers view on a page that doesn't have a service worker registered, you'll get the following
output shown: this gives you some advice on what to do if you don't have a service worker registered, and were perhaps expecting there to be one registered!
Tutorial: Set a breakpoint - Firefox Developer Tools
if debugger is unable to find the report function, or the console
output does not appear, evaluate the expression tabs[0].content.document.location in the console to make sure that tabs[0] indeed refers to the html file you visited.
Examine and edit HTML - Firefox Developer Tools
usually this white space seems to have no effect and no visual
output, but in fact, when a browser parses html it will automatically generate anonymous text nodes for elements not contained in a node.
Waterfall - Firefox Developer Tools
iterations; i++) { var candidate = i * (multiplier * math.random()); var isprime = true; for (var c = 2; c <= math.sqrt(candidate); ++c) { if (candidate % c === 0) { // not prime isprime = false; break; } } if (isprime) { primes.push(candidate); } } console.timeend("calculating..."); return primes; } the waterfall's
output will look something like this: the marker is labeled with the argument you passed to console.time(), and when you select the marker, you can see the program stack in the right-hand sidebar.
Tips - Firefox Developer Tools
in the console
output: click on the inspector icon () next to an element in the
output to select it within the inspector.
AnalyserNode.fftSize - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style"
output of the current audio input.
AnalyserNode.frequencyBinCount - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style"
output of the current audio input.
AnalyserNode.getByteFrequencyData() - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style"
output of the current audio input.
AnalyserNode.getByteTimeDomainData() - Web APIs
return value void | none example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style"
output of the current audio input.
AnalyserNode.getFloatTimeDomainData() - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style"
output of the current audio input.
AnalyserNode.maxDecibels - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style"
output of the current audio input.
AnalyserNode.minDecibels - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style"
output of the current audio input.
AnalyserNode.smoothingTimeConstant - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style"
output of the current audio input.
Blob.size - Web APIs
example this example uses an <input> element of type file to ask the user for a group of files, then iterates over those files
outputting their names and lengths in bytes.
CSSPseudoElement.element - Web APIs
examples the example below demonstrates the relationship between csspseudoelement.element and element.pseudo(): const myelement = document.queryselector('q'); const csspseudoelement = myelement.pseudo('::after'); const originatingelement = csspseudoelement.element; console.log(myelement === originatingelement); //
outputs true console.log(myelement.parentelement === originatingelement); //
outputs false console.log(myelement.lastelementchild === csspseudoelement); //
outputs false console.log(myelement.lastchild === csspseudoelement); //
outputs false console.log(myelement.nextelementsibling === csspseudoelement); //
outputs false console.log(myelement.nextsibling === csspseudoelement); // ou...
CSSPseudoElement.type - Web APIs
owing values: "::before" "::after" "::marker" examples the example below demonstrates the relationship between csspseudoelement.type and element.pseudo(): const myelement = document.queryselector('q'); const myselector = '::after'; const csspseudoelement = myelement.pseudo(myselector); const typeofpseudoelement = csspseudoelement.type; console.log(myselector === typeofpseudoelement); //
outputs true specifications specification status comment css pseudo-elements level 4the definition of 'type' in that specification.
CSSPseudoElement - Web APIs
const element = document.queryselector('q'); const csspseudoelement = element.pseudo('::before'); console.log(csspseudoelement.element); //
outputs [object htmlquoteelement] console.log(csspseudoelement.type); //
outputs '::before' specifications specification status comment css pseudo-elements level 4the definition of 'csspseudoelement' in that specification.
CanvasRenderingContext2D.arcTo() - Web APIs
html <div> <label for="radius">radius: </label> <input name="radius" type="range" id="radius" min=0 max=100 value=50> <label for="radius" id="radius-
output">50</label> </div> <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const controlout = document.getelementbyid('radius-
output'); const control = document.getelementbyid('radius'); control.oninput = () => { controlout.textcontent = r = control.value; }; const mouse = { x: 0, y: 0 }; let...
CanvasRenderingContext2D.putImageData() - Web APIs
"2d"); const imgdata = context.getimagedata(0, 0, canvas.width, canvas.height); const pixels = imgdata.data; pixels[0 + 0] = 1; pixels[0 + 1] = 127; pixels[0 + 2] = 255; pixels[0 + 3] = 1; console.log("before:", pixels); context.putimagedata(imgdata, 0, 0); const imgdata2 = context.getimagedata(0, 0, canvas.width, canvas.height); const pixels2 = imgdata2.data; console.log("after:", pixels2); the
output might look like: before: uint8clampedarray(4) [ 1, 127, 255, 1 ] after: uint8clampedarray(4) [ 255, 255, 255, 1 ] specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.putimagedata' in that specification.
Drawing shapes with canvas - Web APIs
ctangular shape example <html> <body onload="draw();"> <canvas id="canvas" width="150" height="150"></canvas> </body> </html> function draw() { var canvas = document.getelementbyid('canvas'); if (canvas.getcontext) { var ctx = canvas.getcontext('2d'); ctx.fillrect(25, 25, 100, 100); ctx.clearrect(45, 45, 60, 60); ctx.strokerect(50, 50, 50, 50); } } this example's
output is shown below.
Using images - Web APIs
the images are hidden from
output by setting the css property display to none for those images.
Console.timeEnd() - Web APIs
examples console.time("answer time"); alert("click to continue"); console.timelog("answer time"); alert("do a bunch of other stuff..."); console.timeend("answer time"); the
output from the example above shows the time taken by the user to dismiss the first alert box, followed by the time it took for the user to dismiss the second alert: notice that the timer's name is displayed when the timer value is logged using timelog() and again when it's stopped.
Console.timeLog() - Web APIs
examples console.time("answer time"); alert("click to continue"); console.timelog("answer time"); alert("do a bunch of other stuff..."); console.timeend("answer time"); the
output from the example above shows the time taken by the user to dismiss the first alert box, followed by the time it took for the user to dismiss the second alert: notice that the timer's name is displayed when the timer value is logged using timelog() and again when it's stopped.
Console API - Web APIs
examples let mystring = 'hello world'; //
output "hello world" to the console console.log(mystring) see the console reference page for more examples.
ConstantSourceNode() - Web APIs
the constantsourcenode() constructor creates a new constantsourcenode object instance, representing an audio source which constantly
outputs samples whose values are always the same.
Constraint validation API - Web APIs
extensions to other interfaces the constraint validation api extends the interfaces for the form-associated elements listed below with a number of new properties and methods (elements that can have a form attribute that indicates their form owner): htmlbuttonelement htmlfieldsetelement htmlinputelement htmlobjectelement html
outputelement htmlselectelement htmltextareaelement properties validity a read-only property that returns a validitystate object, whose properties represent validation errors for the value of that element.
ConvolverNode.normalize - Web APIs
its default value is true in order to achieve a more uniform
output level from the convolver, when loaded with diverse impulse responses.
DOMException - Web APIs
notreadableerror the input/
output read operation failed (no legacy code value and constant name).
DOMTokenList.add() - Web APIs
first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; classes.add("d"); span.textcontent = classes; the
output looks like this: you can add multiple tokens as well: span.classlist.add("d", "e", "f"); specifications specification status comment domthe definition of 'add()' in that specification.
DOMTokenList.contains() - Web APIs
first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; let result = classes.contains("c"); if (result) { span.textcontent = "the classlist contains 'c'"; } else { span.textcontent = "the classlist does not contain 'c'"; } the
output looks like this: specifications specification status comment domthe definition of 'contains()' in that specification.
DOMTokenList.entries() - Web APIs
first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; let iterator = classes.entries(); for (let value of iterator) { span.textcontent += value + ' ++ '; } the
output looks like this: specifications specification status comment domthe definition of 'entries() (as iterable<node>)' in that specification.
DOMTokenList.item() - Web APIs
first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; let item = classes.item(classes.length-1); span.textcontent = item; the
output looks like this: specifications specification status comment domthe definition of 'item()' in that specification.
DOMTokenList.keys() - Web APIs
first, the html: <span class="a b c"></span> now the javascript: var span = document.queryselector("span"); var classes = span.classlist; var iterator = classes.keys(); for(var value of iterator) { span.textcontent += value + ' ++ '; } the
output looks like this: specifications specification status comment domthe definition of 'keys() (as iterable<node>)' in that specification.
DOMTokenList.length - Web APIs
first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; let length = classes.length; span.textcontent = `classlist length = ${length}`; the
output looks like this: specifications specification status comment domthe definition of 'length' in that specification.
DOMTokenList.remove() - Web APIs
first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; classes.remove("c"); span.textcontent = classes; the
output looks like this: to remove multiple classes at once, you can supply multiple tokens.
DOMTokenList.replace() - Web APIs
first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; let result = classes.replace("c", "z"); console.log(result); if (result) { span.textcontent = classes; } else { span.textcontent = 'token not replaced successfully'; } the
output looks like this: polyfill the following polyfill will add the replace method to the domtokenlist class.
DOMTokenList.toggle() - Web APIs
<span class="a b">classlist is 'a b'</span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; span.addeventlistener('click', function() { let result = classes.toggle("c"); if (result) { span.textcontent = `'c' added; classlist is now "${classes}".`; } else { span.textcontent = `'c' removed; classlist is now "${classes}".`; } }) the
output looks like this: specifications specification status comment domthe definition of 'toggle()' in that specification.
DOMTokenList.value - Web APIs
first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; span.textcontent = classes.value; the
output looks like this: specifications specification status comment domthe definition of 'value' in that specification.
DOMTokenList.values() - Web APIs
first, the html: <span class="a b c"></span> now the javascript: var span = document.queryselector("span"); var classes = span.classlist; var iterator = classes.values(); for(var value of iterator) { span.textcontent += value + ' ++ '; } the
output looks like this: specifications specification status comment domthe definition of 'values() (as iterable<node>)' in that specification.
DataTransfer.mozGetDataAt() - Web APIs
function drop_handler(event) { var dt = event.datatransfer; var count = dt.mozitemcount;
output("items: " + count + "\n"); for (var i = 0; i < count; i++) {
output(" item " + i + ":\n"); var types = dt.moztypesat(i); for (var t = 0; t < types.length; t++) {
output(" " + types[t] + ": "); try { var data = dt.mozgetdataat(types[t], i);
output("(" + (typeof data) + ") : <" + data + " >\n"); } catch (ex) {
output("<>\n"); dump(ex...
DataTransfer.mozTypesAt() - Web APIs
function drop_handler(event) { var dt = event.datatransfer; var count = dt.mozitemcount;
output("items: " + count + "\n"); for (var i = 0; i < count; i++) {
output(" item " + i + ":\n"); var types = dt.moztypesat(i); for (var t = 0; t < types.length; t++) {
output(" " + types[t] + ": "); try { var data = dt.mozgetdataat(types[t], i);
output("(" + (typeof data) + ") : <" + data + " >\n"); } catch (ex) {
output("<>\n"); dump(ex...
DelayNode() - Web APIs
the delaynode() constructor of the web audio api creates a new delaynode object with a delay-line; an audionode audio-processing module that causes a delay between the arrival of an input data, and its propagation to the
output.
DeprecationReportBody - Web APIs
the report details are displayed via the displayreports() fuction, which takes the observer callback's reports parameter as its parameter: function displayreports(reports) { const
outputelem = document.queryselector('.
output'); const list = document.createelement('ul');
outputelem.appendchild(list); for(let i = 0; i < reports.length; i++) { let listitem = document.createelement('li'); let textnode = document.createtextnode('report ' + (i + 1) + ', type: ' + reports[i].type); listitem.appendchild(textnode); let innerlist = document.createelement('ul'); l...
DocumentOrShadowRoot.elementsFromPoint() - Web APIs
example html <div> <p>some text</p> </div> <p>elements at point 30, 20:</p> <div id="
output"></div> javascript let
output = document.getelementbyid("
output"); if (document.elementsfrompoint) { let elements = document.elementsfrompoint(30, 20); for (var i = 0; i < elements.length; i++) {
output.textcontent += elements[i].localname; if (i < elements.length - 1) {
output.textcontent += " < "; } } } else {
output.innerhtml = "<span style=\"color: red;\">" + ...
DocumentOrShadowRoot.nodeFromPoint() - Web APIs
examples html content <div> <p>some text</p> </div> <p>top node at point 30, 20:</p> <div id="
output"></div> javascript content var
output = document.getelementbyid("
output"); if (document.nodefrompoint) { var node = document.nodefrompoint(30, 20);
output.textcontent += node.localname; } else {
output.innerhtml = "<span style=\"color: red;\">" + "browser does not support <code>document.nodefrompoint()</code>" + "</span>"; } specifications not part of any specification at...
DocumentOrShadowRoot.nodesFromPoint() - Web APIs
example html content <div> <p>some text</p> </div> <p>nodes at point 30, 20:</p> <div id="
output"></div> javascript content var
output = document.getelementbyid("
output"); if (document.nodesfrompoint) { var nodes = document.nodesfrompoint(30, 20); for(var i = 0; i < nodes.length; i++) {
output.textcontent += nodes[i].localname; if (i < nodes.length - 1) {
output.textcontent += " < "; } } } else {
output.innerhtml = "<span style=\"color: red;\">" + "browser d...
DynamicsCompressorNode.ratio - Web APIs
the ratio property of the dynamicscompressornode interface is a k-rate audioparam representing the amount of change, in db, needed in the input for a 1 db change in the
output.
EXT_frag_depth - Web APIs
examples enable the extension: gl.getextension('ext_frag_depth'); now the
output variable gl_fragdepthext 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_fragdepthext = 0.5; } </script> specifications specification status comment ext_frag_depththe definition of 'ext_frag_depth' in that specification.
Element.attributes - Web APIs
ctype html> <html> <head> <title>attributes example</title> <script type="text/javascript"> function listattributes() { var paragraph = document.getelementbyid("paragraph"); var result = document.getelementbyid("result"); // first, let's verify that the paragraph has some attributes if (paragraph.hasattributes()) { var attrs = paragraph.attributes; var
output = ""; for(var i = attrs.length - 1; i >= 0; i--) {
output += attrs[i].name + "->" + attrs[i].value; } result.value =
output; } else { result.value = "no attributes to show"; } } </script> </head> <body> <p id="paragraph" style="color: green;">sample paragraph</p> <form action=""> <p> <input type="button" value="show first attribute nam...
Element.querySelector() - Web APIs
html <div> <h5>original content</h5> <p> inside paragraph <span>inside span</span> inside paragraph </p> </div> <div> <h5>
output</h5> <div id="
output"></div> </div> javascript var baseelement = document.queryselector("p"); document.getelementbyid("
output").innerhtml = (baseelement.queryselector("div span").innerhtml); result the result looks like this: notice how the "div span" selector still successfully matches the <span> element, even though the baseelement's child nodes do not include the div element (it is ...
ElementCSSInlineStyle.style - Web APIs
id="myelement">..</div> </body> </html> var element = document.getelementbyid("myelement"); var out = ""; var elementstyle = element.style; var computedstyle = window.getcomputedstyle(element, null); for (prop in elementstyle) { if (elementstyle.hasownproperty(prop)) { out += " " + prop + " = '" + elementstyle[prop] + "' > '" + computedstyle[prop] + "'\n"; } } console.log(out) the
output would be something like: ...
Event.bubbles - Web APIs
passes the event along if does not passiton(e); } // already bubbling do
output(e); } note: only certain events can bubble.
EventTarget.addEventListener() - Web APIs
const mybutton = document.getelementbyid('my-button-id'); const somestring = 'data'; mybutton.addeventlistener('click', function() { console.log(somestring); // expected value: 'data' somestring = 'data again'; }); console.log(somestring); // expected value: 'data' (will never
output 'data again') note: although inner scopes have access to const, let variables from outer scopes, you cannot expect any changes to these variables to be accessible after the event listener definition, within the same outer scope.
File.webkitRelativePath - Web APIs
html content <input type="file" id="filepicker" name="filelist" webkitdirectory multiple /> <ul id="listing"></ul> javascript content document.getelementbyid("filepicker").addeventlistener("change", function(event) { let
output = document.getelementbyid("listing"); let files = event.target.files; for (let i=0; i<files.length; i++) { let item = document.createelement("li"); item.innerhtml = files[i].webkitrelativepath;
output.appendchild(item); }; }, false); result specifications specification status comment file and directory entries apithe definition of 'webkitrelati...
Using FormData Objects - Web APIs
m file label:</label> <input type="text" name="filelabel" size="12" maxlength="32" /><br /> <label>file to stash:</label> <input type="file" name="file" required /> <input type="submit" value="stash the file!" /> </form> <div></div> then you can send it using code like the following: var form = document.forms.nameditem("fileinfo"); form.addeventlistener('submit', function(ev) { var o
output = document.queryselector("div"), odata = new formdata(form); odata.append("customfield", "this is some extra data"); var oreq = new xmlhttprequest(); oreq.open("post", "stash.php", true); oreq.onload = function(oevent) { if (oreq.status == 200) { o
output.innerhtml = "uploaded!"; } else { o
output.innerhtml = "error " + oreq.status + " occurred when trying to upl...
GainNode.gain - Web APIs
if you still hear something, make sure you haven't // connected your source into the
output in addition to using the gainnode.
Using the Gamepad API - Web APIs
we have done this below using window.setinterval(); once the object is available the gamepad info is
outputted, the game loop is started, and the interval is cleared using window.clearinterval().
GlobalEventHandlers.onpointerdown - Web APIs
#target { width: 400px; height: 30px; text-align: center; font: 16px "open sans", "helvetica", sans-serif; color: white; background-color: blue; border: 2px solid darkblue; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; } result the resulting
output is shown below.
GlobalEventHandlers.onresize - Web APIs
examples window size logger <p>resize the browser window to fire the <code>resize</code> event.</p> <p>window height: <span id="height"></span></p> <p>window width: <span id="width"></span></p> const height
output = document.queryselector('#height'); const width
output = document.queryselector('#width'); function resize() { height
output.textcontent = window.innerheight; width
output.textcontent = window.innerwidth; } window.onresize = resize; specification specification status comment html living standardthe definition of 'onresize' in that specification.
HTMLCanvasElement.mozFetchAsStream() - Web APIs
utilcallback = function() { return function(result) { if (!components.issuccesscode(result)) { alert('failed to create icon'); } else { alert('succesfully made'); } }; } var mfascallback = function(iconname) { return function(instream) { var file = fileutils.getfile('desk', [iconname + '.ico']); var outstream = fileutils.openfile
outputstream(file); cu.import('resource://gre/modules/netutil.jsm'); netutil.asynccopy(instream, outstream, netutilcallback()); } } canvas.mozfetchasstream(mfascallback('myicon'), 'image/vnd.microsoft.icon'); specifications not part of any specification.
HTMLFormElement.elements - Web APIs
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 excellent way to get at the elements most important when processing forms.
HTMLFormElement.length - Web APIs
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 excellent way to get at the elements most important when processing forms.
HTMLFormElement.target - Web APIs
the target property of the htmlformelement interface represents the target of the form's action (i.e., the frame in which to render its
output).
HTMLFormElement - Web APIs
elements that are considered form controls 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 excellent way to get at the elements most important when processing forms.
HTMLImageElement.height - Web APIs
var clockimage = document.queryselector("img"); let
output = document.queryselector(".size"); const updateheight = event => {
output.innertext = clockimage.height; }; window.addeventlistener("load", updateheight); window.addeventlistener("resize", updateheight); result this example may be easier to try out in its own window.
HTMLImageElement.srcset - Web APIs
let box = document.queryselector(".box"); let image = box.queryselector("img"); let newelem = document.createelement("p"); newelem.innerhtml = `image: <code>${image.currentsrc}</code>`; box.appendchild(newelem); result in the displayed
output below, the selected url will correspond with whether your display results in selecting the 1x or the 2x version of the image.
HTMLImageElement.width - Web APIs
var clockimage = document.queryselector("img"); let
output = document.queryselector(".size"); const updatewidth = event => {
output.innertext = clockimage.width; }; window.addeventlistener("load", updatewidth); window.addeventlistener("resize", updatewidth); result this example may be easier to try out in its own window.
HTMLInputElement.webkitdirectory - Web APIs
html content <input type="file" id="filepicker" name="filelist" webkitdirectory multiple /> <ul id="listing"></ul> javascript content document.getelementbyid("filepicker").addeventlistener("change", function(event) { let
output = document.getelementbyid("listing"); let files = event.target.files; for (let i=0; i<files.length; i++) { let item = document.createelement("li"); item.innerhtml = files[i].webkitrelativepath;
output.appendchild(item); }; }, false); result specifications specification status comment file and directory entries apithe definition of 'webkitdirect...
HTMLMediaElement.playbackRate - Web APIs
(default: 1.0) example var obj = document.createelement('video'); console.log(obj.playbackrate); // expected
output: 1 specifications specification status comment html living standardthe definition of 'htmlmediaelement.playbackrate' in that specification.
HTMLMediaElement.seekable - Web APIs
examples var video = document.queryselector("video"); var timerangesobject = video.seekable; var timeranges = []; //go through the object and
output an array for (let count = 0; count < timerangesobject.length; count ++) { timeranges.push([timerangesobject.start(count), timerangesobject.end(count)]); } specifications specification status comment html living standardthe definition of 'htmlmediaelement' in that specification.
The HTML DOM API - Web APIs
ement htmlformelement htmlhrelement htmlheadelement htmlheadingelement htmlhtmlelement htmliframeelement htmlimageelement htmlinputelement htmllielement htmllabelelement htmllegendelement htmllinkelement htmlmapelement htmlmediaelement htmlmenuelement htmlmetaelement htmlmeterelement htmlmodelement htmlolistelement htmlobjectelement htmloptgroupelement htmloptionelement html
outputelement htmlparagraphelement htmlparamelement htmlpictureelement htmlpreelement htmlprogresselement htmlquoteelement htmlscriptelement htmlselectelement htmlslotelement htmlsourceelement htmlspanelement htmlstyleelement htmltablecaptionelement htmltablecellelement htmltablecolelement htmltableelement htmltablerowelement htmltablesectionelement htmltemplateelement htmltextareael...
Recommended Drag Types - Web APIs
lication/x-moz-file-promise-dir', dirprimitive, datasize); var dir = dirprimitive.value.queryinterface(components.interfaces.nsilocalfile); console.log("target folder is = " + dir.path); var file = cc['@mozilla.org/file/local;1'].createinstance(components.interfaces.nsilocalfile); file.initwithpath(dir.path); file.appendrelativepath(name); console.log("
output final path is =" + file.path); // now you can write or copy the file yourself… } } } see also html drag and drop api (overview) drag operations dragging and dropping multiple items html5 living standard: drag and drop ...
HkdfParams - Web APIs
ideally, the salt is a random or pseudo-random value with the same length as the
output of the digest function.
Key Values - Web APIs
rf bypass mode passes rf input directly to the rf
output without any processing or filtering.
KeyboardEvent.key - Web APIs
logmessage(`key "${e.key}" released [event: keyup]`); }); btnclearconsole.addeventlistener('click', (e) => { let child = consolelog.firstchild; while (child) { consolelog.removechild(child); child = consolelog.firstchild; } }); result note: on browsers that don't fully implement the inputevent interface which is used for the beforeinput and input events, you may get incorrect
output on those lines of the log
output.
MediaDeviceInfo.kind - Web APIs
the kind readonly property of the mediadeviceinfo interface returns an enumerated value, that is either "videoinput", "audioinput" or "audio
output".
MediaError.code - Web APIs
the error handler simply
outputs a message var obj = document.createelement('video'); obj.onerror = function() {console.log("error with media: " + obj.error.code);} obj.src="https://example.com/blahblah.mp4"; specifications specification status comment html living standardthe definition of 'mediaerror.code' in that specification.
MediaStreamAudioDestinationNode - Web APIs
number of inputs 1 number of
outputs 0 channel count 2 channel count mode "explicit" channel count interpretation "speakers" constructor mediastreamaudiodestinationnode.mediastreamaudiodestinationnode() creates a new mediastreamaudiodestinationnode object instance.
Microdata DOM API - Web APIs
t"> <h1 itemprop="name http://example.com/fn">hedral</h1> <p itemprop="desc">hedral is a male american domestic shorthair, with a fluffy <span itemprop="http://example.com/color">black</span> fur with <span itemprop="http://example.com/color">white</span> paws and belly.</p> <img itemprop="img" src="hedral.jpeg" alt="" title="hedral, age 18 months"> </section> ...it would result in the following
output: name http://example.com/fn desc http://example.com/color img (the duplicate occurrence of "http://example.com/color" is not included in the list.) htmlpropertiescollection the htmlpropertiescollection interface is used for collections of elements that add name-value pairs to a particular item in the microdata model.
Navigator.mediaCapabilities - Web APIs
the navigator.mediacapabilities read-only property returns a mediacapabilities object that can expose information about the decoding and encoding capabilities for a given format and
output capabilities as defined by the media capabilities api.
Navigator.oscpu - Web APIs
4 or 4.5) windows ce windowsce x.y1 windows 64-bit (64-bit build) windows nt x.y; win64; x64 windows 64-bit (32-bit build) windows nt x.y; wow64 windows 32-bit windows nt x.y mac os x (ppc build) powerpc mac os x version x.y mac os x (i386/x64 build) intel mac os x or macos version x.y linux 64-bit (32-bit build)
output of uname -s plus "i686 on x86_64" linux
output of uname -sm x.y refers to the version of the operating system example function osinfo() { alert(window.navigator.oscpu); } osinfo(); // alerts "windows nt 6.0" for example usage notes unless your code is privileged (chrome or at least has the universalbrowserread privilege), it may get the value of the general.oscpu.ove...
Navigator - Web APIs
navigator.locks read only returns a lockmanager object which provides methods for requesting a new lock object and querying for an existing lock object navigator.mediacapabilities read only returns a mediacapabilities object that can expose information about the decoding and encoding capabilities for a given format and
output capabilities.
Node.isSupported() - Web APIs
var main = document.getelementbyid('doc'); var
output = main.issupported('html', '2.0'); </script> specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'node.issupported()' in that specification.
NodeList - Web APIs
for example, node.childnodes is live: const parent = document.getelementbyid('parent'); let child_nodes = parent.childnodes; console.log(child_nodes.length); // let's assume "2" parent.appendchild(document.createelement('div')); console.log(child_nodes.length); //
outputs "3" static nodelists in other cases, the nodelist is static, where any changes in the dom does not affect the content of the collection.
NonDocumentTypeChildNode.nextElementSibling - Web APIs
syntax var nextnode = elementnodereference.nextelementsibling; example <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <script type="text/javascript"> var el = document.getelementbyid('div-01').nextelementsibling; console.log('siblings of div-01:'); while (el) { console.log(el.nodename); el = el.nextelementsibling; } </script> this example
outputs the following into the console when it loads: siblings of div-01: div script polyfill for internet explorer 8 this property is unsupported prior to ie9, so the following snippet can be used to add support to ie8: // source: https://github.com/alhadis/snippets/blob/master/js/polyfills/ie8-child-elements.js if(!("nextelementsibling" in document.documentelement)){ object.defineproperty(elem...
NonDocumentTypeChildNode.previousElementSibling - Web APIs
02</div> <li>this is a list item</li> <li>this is another list item</li> <div id="div-03">here is div-03</div> <script> let el = document.getelementbyid('div-03').previouselementsibling; document.write('<p>siblings of div-03</p><ol>'); while (el) { document.write('<li>' + el.nodename + '</li>'); el = el.previouselementsibling; } document.write('</ol>'); </script> this example
outputs the following into the page when it loads: siblings of div-03 1.
OfflineAudioContext.OfflineAudioContext() - Web APIs
the offlineaudiocontext() constructor—part of the web audio api—creates and returns a new offlineaudiocontext object instance, which can then be used to render audio to an audiobuffer rather than to an audio
output device.
PannerNode.coneInnerAngle - Web APIs
rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the
output values are always normalised // i.e.
PannerNode.coneOuterAngle - Web APIs
rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the
output values are always normalised // i.e.
PannerNode.coneOuterGain - Web APIs
rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the
output values are always normalised // i.e.
PannerNode.orientationX - Web APIs
rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the
output values are always normalised // i.e.
PannerNode.orientationY - Web APIs
rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the
output values are always normalised // i.e.
PannerNode.orientationZ - Web APIs
rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the
output values are always normalised // i.e.
PannerNode.panningModel - Web APIs
hrtf: renders a stereo
output of higher quality than equalpower — it uses a convolution with measured impulse responses from human subjects.
PerformancePaintTiming - Web APIs
rformance = window.performance; let performanceentries = performance.getentriesbytype('paint'); performanceentries.foreach( (performanceentry, i, entries) => { console.log("the time to " + performanceentry.name + " was " + performanceentry.starttime + " milliseconds."); }); } else { console.log('performance timing isn\'t supported.'); } } the code above produces console
output something like the following: the time to first-paint was 2785.915 milliseconds.
Using the Performance API - Web APIs
function print_json() { var json; var o = document.getelementsbytagname("
output")[0]; if (window.performance.tojson === undefined) { json = "window.performance.tojson() is not supported"; o.innerhtml += json + "<br>"; } else { var s; json = window.performance.tojson(); // print the performance object s = json.stringify(json); o.innerhtml = "<p>performance = " + s + "</p>"; // print the performance.timing and performance.navigation objec...
Using Performance Timeline - Web APIs
function log(s) { var o = document.getelementsbytagname("
output")[0]; o.innerhtml += s + " <br>"; } function do_work (n) { for (var i=0 ; i < n; i++) { var m = math.random(); } } function print_perf_entry(pe) { log("..name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: " + pe.duration); } function print_performanceentries() { if (performance.mark === undefined) { ...
PublicKeyCredentialCreationOptions - Web APIs
{ type: "public-key", // the id for john-doe@example.com id : new uint8array(26) /* another id */ } ] } }; // create the new credential with the options above navigator.credentials.create(createcredentialoptions) .then(function (newcredentialinfo) { var attestationresponse = newcredentialinfo.response; var clientextensions
outputs = newcredentialinfo.getclientextensionsresults(); // send the response to the relying party server // it will verify the content and integrity before // creating a new credential }).catch(function (err) { // deal with any error properly console.error(err); });; specifications specification status comment web authentication: an api for acce...
RTCError - Web APIs
this message is then displayed using a function called showmyalertmessage(), which stands in for whatever
output mechanism this code might use.
RTCErrorEvent.error - Web APIs
this message is then displayed using a function called showmyalertmessage(), which stands in for whatever
output mechanism this code might use.
RTCIceCandidate.relatedAddress - Web APIs
example in this example, the candidate's type is checked, and then debugging
output is presented, based on the candidate type, including the candidate's ip and relatedaddress.
RTCIceCandidate.relatedPort - Web APIs
example in this example, the candidate's type is checked, and then debugging
output is presented, based on the candidate type, including the candidate's type, address (ip and port), and related address (relatedaddress and relatedport).
RTCIceTransport.getLocalCandidates() - Web APIs
example this simple example gets the local candidate list from the rtcicetransport for the first rtcrtpsender on the rtcpeerconnection, then
outputs to the console all of the candidates in the list.
RTCIceTransport.getRemoteCandidates() - Web APIs
example this simple example gets the remote candidate list from the rtcicetransport for the first rtcrtpsender on the rtcpeerconnection, then
outputs to the console all of the candidates in the list.
RTCStatsReport - Web APIs
local-candidate an rtcicecandidatestats object giving statistics about an ice local candidate; these candidates are found in the
output from rtcicetransport.getlocalcandidates().
RTCStatsType - Web APIs
local-candidate an rtcicecandidatestats object giving statistics about an ice local candidate; these candidates are found in the
output from rtcicetransport.getlocalcandidates().
Range.toString() - Web APIs
look at the
output below.</p> <p id="log"></p> javascript const range = document.createrange(); range.setstartbefore(document.getelementsbytagname('b').item(0), 0); range.setendafter(document.getelementsbytagname('b').item(1), 0); document.getelementbyid('log').textcontent = range.tostring(); result specifications specification status comment domthe definition of 'range.tostring()' in that specification.
ReadableStream.getReader() - Web APIs
each chunk is read sequentially and
output to the ui, until the stream has finished being read, at which point we return out of the recursive function and print the entire stream to another part of the ui.
ReadableStreamDefaultReader.cancel() - Web APIs
each chunk is read sequentially and
output to the ui, until the stream has finished being read, at which point we return out of the recursive function and print the entire stream to another part of the ui.
ReadableStreamDefaultReader.read() - Web APIs
each chunk is read sequentially and
output to the ui as an array of utf-8 bytes, until the stream has finished being read, at which point we return out of the recursive function and print the entire stream to another part of the ui.
Report - Web APIs
the report details are displayed via the displayreports() fuction, which takes the observer callback's reports parameter as its parameter: function displayreports(reports) { const
outputelem = document.queryselector('.
output'); const list = document.createelement('ul');
outputelem.appendchild(list); for(let i = 0; i < reports.length; i++) { let listitem = document.createelement('li'); let textnode = document.createtextnode('report ' + (i + 1) + ', type: ' + reports[i].type); listitem.appendchild(textnode); let innerlist = document.createelement('ul'); l...
Response.useFinalURL - Web APIs
example consider a script residing in page index.html: fetch('/test').then((r) => console.log(r.url)) test.html is being controlled by the service worker sw.js: onfetch = (e) => { e.respondwith(fetch('/page2').then((r) => { r.usefinalurl = true; return r; }) } the
output will be /page2 and not /test in index.html, since setting the usefinalurl means that the response's url is not set to request's url.
SVGEllipseElement - Web APIs
example svg content <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <ellipse cx="100" cy="100" rx="100" ry="60" id="ellipse" onclick="
outputsize();"/> </svg> javascript content function
outputsize() { var ellipse = document.getelementbyid("ellipse"); //
outputs "horizontal radius: 100 vertical radius: 60" console.log( 'horizontal radius: ' + ellipse.rx.baseval.valueasstring, 'vertical radius: ' + ellipse.ry.baseval.valueasstring ) } result specifications specification status comment ...
Using server-sent events - Web APIs
istener("ping", function(event) { const newelement = document.createelement("li"); const time = json.parse(event.data).time; newelement.innerhtml = "ping at " + time; eventlist.appendchild(newelement); }); this code is similar, except that it will be called automatically whenever the server sends a message with the event field set to "ping"; it then parses the json in the data field and
outputs that information.
SpeechRecognition.abort() - Web APIs
live | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.
output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } abortbtn.onclick = function() { recognition.abort(); console.log('speech recognition aborted.'); } recognition.onspeechend = function() { recognition.stop(); console.log('speech recognition has stopped.'); } specifications ...
SpeechRecognition.start() - Web APIs
live | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.
output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } abortbtn.onclick = function() { recognition.abort(); console.log('speech recognition aborted.'); } recognition.onspeechend = function() { recognition.stop(); console.log('speech recognition has stopped.'); } specifications ...
SpeechRecognition.stop() - Web APIs
live | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.
output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } abortbtn.onclick = function() { recognition.abort(); console.log('speech recognition aborted.'); } recognition.onspeechend = function() { recognition.stop(); console.log('speech recognition has stopped.'); } specifications ...
SpeechRecognition - Web APIs
rquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; var diagnostic = document.queryselector('.
output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } recognition.onresult = function(event) { var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color; bg.style.backgroundcolor = color; } specifications specification status comme...
SpeechSynthesisErrorEvent.error - Web APIs
audio-busy the operation couldn't be completed at this time because the user-agent couldn't access the audio
output device (for example, the user may need to correct this by closing another application.) audio-hardware the operation couldn't be completed at this time because the user-agent couldn't identify an audio
output device (for example, the user may need to connect a speaker or configure system settings.) network the operation couldn't be completed at this time because some required network communic...
StereoPannerNode.pan - Web APIs
moving the slider left and right while the music is playing pans the music across to the left and right speakers of the
output, respectively.
Streams API concepts - Web APIs
in javascript, this is achieved via the readablestream.tee() method — it
outputs an array containing two identical copies of the original readable stream, which can then be read independently by two separate readers.
Using readable streams - Web APIs
this is achieved via the readablestream.tee() method — it
outputs an array containing two identical copies of the original readable stream, which can then be read independently by two separate readers.
TextRange - Web APIs
var sel = document.selection; var range = sel.createrange(); alert(range.text); //
output plaintext of the selection note that the createrange method does not create a reference.
TrackEvent - Web APIs
{ trackkind = "text"; } else { trackkind = "unknown"; } switch(event.type) { case "addtrack": console.log("added a " + trackkind + " track"); break; case "removetrack": console.log("removed a " + trackkind + " track"); break; } } the event handler uses the javascript instanceof operator to determine which type of track the event occurred on, then
outputs to console a message indicating what kind of track it is and whether it's being added to or removed from the element.
USBDevice.clearHalt() - Web APIs
syntax var promise = usbdevice.clearhalt(direction, endpointnumber) parameters direction indicates whether the devices input or
output should be cleared.
USBEndpoint - Web APIs
for example, a usb serial device must provide bulk input and
output endpoints but their endpoint numbers will depend on what other interfaces the device provides.
validityState.tooShort - Web APIs
the read-only tooshort property of a validitystate object indicates if the value of an <input>, <button>, <select>, <
output>, <fieldset> or <textarea>, after having been edited by the user, is less than the minimum code-unit length established by the element's minlength attribute.
WebGL2RenderingContext.transformFeedbackVaryings() - Web APIs
examples var transformfeedback = gl.createtransformfeedback(); gl.bindtransformfeedback(gl.transform_feedback, transformfeedback); var transformfeedback
outputs = ['gl_position', 'another
output']; gl.transformfeedbackvaryings(shaderprog, transformfeedback
outputs, gl.interleaved_attribs); gl.linkprogram(shaderprog); specifications specification status comment webgl 2.0the definition of 'transformfeedbackvaryings' in that specification.
WebGLRenderingContext.getParameter() - Web APIs
d_bias glfloat gl.max_transform_feedback_interleaved_components glint gl.max_transform_feedback_separate_attribs glint gl.max_transform_feedback_separate_components glint gl.max_uniform_block_size glint64 gl.max_uniform_buffer_bindings glint gl.max_varying_components glint gl.max_vertex_
output_components glint gl.max_vertex_uniform_blocks glint gl.max_vertex_uniform_components glint gl.min_program_texel_offset glint gl.pack_row_length glint see pixelstorei.
Clearing with colors - Web APIs
by tweaking those "dials" and "switches" you can modify the internal state of the webgl machine, which in turn changes how input (in this case, a clear command) translates into
output (in this case, all pixels are set to green).
Color masking - Web APIs
this means that graphics operations in webgl are done in a certain order, where the
output of each operation serves as the input of the next.
Hello GLSL - Web APIs
if the canvas remains blank, you can check the
output of the next example, which draws exactly the same thing.
WebGL constants - Web APIs
_vertex_uniform_components 0x8b4a max_array_texture_layers 0x88ff min_program_texel_offset 0x8904 max_program_texel_offset 0x8905 max_varying_components 0x8b4b fragment_shader_derivative_hint 0x8b8b rasterizer_discard 0x8c89 vertex_array_binding 0x85b5 max_vertex_
output_components 0x9122 max_fragment_input_components 0x9125 max_server_wait_timeout 0x9111 max_element_index 0x8d6b textures constants passed to webglrenderingcontext.texparameteri(), webglrenderingcontext.texparameterf(), webglrenderingcontext.bindtexture(), webglrenderingcontext.teximage2d(), and others.
Lifetime of a WebRTC session - Web APIs
one peer can
output a data object that can be printed out, physically carried (on foot or by carrier pigeon) to another device, entered into that device, and a response then
output by that device to be returned on foot, and so forth, until the webrtc peer connection is open.
Signaling and video calling - Web APIs
open the web console on both devices and look at the logged
output—although you don't see it in the code as shown above, the code on the server (and on github) has a lot of console
output so you can see the signaling and connection processes at work.
WebRTC Statistics API - Web APIs
try { mypeerconnection = new rtcpeerconnection(pcoptions); statsinterval = window.setinterval(getconnectionstats, 1000); /* add event handlers, etc */ } catch(err) { console.error("error creating rtcpeerconnection: " + err); } function getconnectionstats() { mypeerconnection.getstats(null).then(stats => { var stats
output = ""; stats.foreach(report => { if (report.type === "inbound-rtp" && report.kind === "video") { object.keys(report).foreach(statname => { stats
output += `<strong>${statname}:</strong> ${report[statname]}<br>\n`; }); } }); document.queryselector(".stats-box").innerhtml = stats
output; }); } when the promise returned by getstats() is fulfilled, ...
Migrating from webkitAudioContext - Web APIs
(audiobuffersourcenode has yet another way of starting
output: the notegrainon() method.) the noteon()/notegrainon()/noteoff() methods were the original way to start/stop
output in these nodes, and in the newer versions of the specification, the noteon() and notegrainon() methods were consolidated into a single start() method, and the noteoff() method was renamed to the stop() method.
Visualizations with Web Audio API - Web APIs
ntext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); this node is then connected to your audio source at some point between your source and your destination, for example: source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(audioctx.destination); note: you don't need to connect the analyser's
output to another node for it to work, as long as the input is connected to the source, either directly or via another node.
Using the Web Storage API - Web APIs
we have also provided an event
output page — if you load this page in another tab, then make changes to your choices in the landing page, you'll see the updated storage information
outputted as a storageevent is fired.
Web Storage API - Web APIs
in addition, we have provided an event
output page — if you load this page in another tab, then make changes to your choices in the landing page, you'll see the updated storage information
outputted as the storageevent is fired.
Window.getDefaultComputedStyle() - Web APIs
example simple example var elem1 = document.getelementbyid("elemid"); var style = window.getdefaultcomputedstyle(elem1); longer example <style> #elem-container { position: absolute; left: 100px; top: 200px; height: 100px; } </style> <div id="elem-container">dummy</div> <div id="
output"></div> <script> var elem = document.getelementbyid("elem-container"); var thecssprop = window.getdefaultcomputedstyle(elem).position; document.getelementbyid("
output").innerhtml = thecssprop; // will
output "static" </script> use with pseudo-elements the getdefaultcomputedstyle() method can pull style info from pseudo-elements (e.g., ::before or ::after).
Window: resize event - Web APIs
<p>resize the browser window to fire the <code>resize</code> event.</p> <p>window height: <span id="height"></span></p> <p>window width: <span id="width"></span></p> const height
output = document.queryselector('#height'); const width
output = document.queryselector('#width'); function reportwindowsize() { height
output.textcontent = window.innerheight; width
output.textcontent = window.innerwidth; } window.onresize = reportwindowsize; addeventlistener equivalent you could set up the event handler using the addeventlistener() method: window.addeventlistener('resize', rep...
Worker.prototype.postMessage() - Web APIs
abuf) break; default: throw 'no atopic on incoming message to chromeworker'; } } function sendworkerarrbuff(abuf) { console.info('from worker, pre send back abuf.bytelength:', abuf.bytelength); self.postmessage({atopic:'do_sendmainarrbuff', abuf:abuf}, [abuf]); console.info('from worker, post send back abuf.bytelength:', abuf.bytelength); }
output logged arrbuf.bytelength pre transfer: 8 bootstrap.js:40 arrbuf.bytelength post transfer: 0 bootstrap.js:42 from worker, pre send back abuf.bytelength: 8 myworker.js:5:2 incoming message from worker, msg: message { ...
Using XMLHttpRequest - Web APIs
</p> <p> <input type="submit" value="submit" /> </p> </fieldset> </form> </body> </html> to test this, create a page named register.php (which is the action attribute of these sample forms), and put the following minimalistic content: <?php /* register.php */ header("content-type: text/plain"); /* note: you should never use `print_r()` in production scripts, or otherwise
output client-submitted data without sanitizing it first.
XMLHttpRequest.status - Web APIs
example var xhr = new xmlhttprequest(); console.log('unsent: ', xhr.status); xhr.open('get', '/server'); console.log('opened: ', xhr.status); xhr.onprogress = function () { console.log('loading: ', xhr.status); }; xhr.onload = function () { console.log('done: ', xhr.status); }; xhr.send(); /** *
outputs the following: * * unsent: 0 * opened: 0 * loading: 200 * done: 200 */ specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XMLHttpRequest.statusText - Web APIs
example var xhr = new xmlhttprequest(); console.log('0 unsent', xhr.statustext); xhr.open('get', '/server', true); console.log('1 opened', xhr.statustext); xhr.onprogress = function () { console.log('3 loading', xhr.statustext); }; xhr.onload = function () { console.log('4 done', xhr.statustext); }; xhr.send(null); /** *
outputs the following: * * 0 unsent * 1 opened * 3 loading ok * 4 done ok */ specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XMLSerializer.serializeToString() - Web APIs
notes on the resulting xml there are some things worth noting about the xml
output by serializetostring(): for xml serializations, element and attr nodes are always serialized with their namespaceuri intact.
XPathEvaluator.createExpression() - Web APIs
html <div>xpath example</div> <div>number of <div>s: <
output></
output></div> javascript var xpath = "//div"; var evaluator = new xpathevaluator(); var expression = evaluator.createexpression("//div"); var result = expression.evaluate(document, xpathresult.ordered_node_snapshot_type); document.queryselector("
output").textcontent = result.snapshotlength; result specifications specification status comment document object model...
XPathEvaluator.evaluate() - Web APIs
html <div>xpath example</div> <div>number of <div>s: <
output></
output></div> javascript var evaluator = new xpathevaluator(); var result = evaluator.evaluate("//div", document, null, xpathresult.ordered_node_snapshot_type); document.queryselector("
output").textcontent = result.snapshotlength; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpatheva...
XPathEvaluator - Web APIs
html <div>xpath example</div> <div>number of <div>s: <
output></
output></div> javascript var xpath = "//div"; var evaluator = new xpathevaluator(); var expression = evaluator.createexpression("//div"); var result = expression.evaluate(document, xpathresult.ordered_node_snapshot_type); document.queryselector("
output").textcontent = result.snapshotlength; result specifications specification status comment document object model...
XPathExpression.evaluate() - Web APIs
html <div>xpath example</div> <div>number of <div>s: <
output></
output></div> javascript var xpath = "//div"; var evaluator = new xpathevaluator(); var expression = evaluator.createexpression("//div"); var result = expression.evaluate(document, xpathresult.ordered_node_snapshot_type); document.queryselector("
output").textcontent = result.snapshotlength; result specifications specification status comment document object model...
XPathExpression - Web APIs
html <div>xpath example</div> <div>number of <div>s: <
output></
output></div> javascript var xpath = "//div"; var evaluator = new xpathevaluator(); var expression = evaluator.createexpression(xpath); var result = expression.evaluate(document, xpathresult.ordered_node_snapshot_type); document.queryselector("
output").textcontent = result.snapshotlength; result specifications specification status comment document object model (...
XPathResult.booleanValue - Web APIs
html <div>xpath example</div> <p>text is 'xpath example': <
output></
output></p> javascript var xpath = "//div/text() = 'xpath example'"; var result = document.evaluate(xpath, document, null, xpathresult.boolean_type, null); document.queryselector("
output").textcontent = result.booleanvalue; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.boo...
XPathResult.invalidIteratorState - Web APIs
html <div>xpath example</div> <p>iterator state: <
output></
output></p> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.any_type, null); // invalidates the iterator state document.queryselector("div").remove(); document.queryselector("
output").textcontent = result.invaliditeratorstate ?
XPathResult.iterateNext() - Web APIs
html <div>xpath example</div> <div>tag names of the matched nodes: <
output></
output></div> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.any_type, null); var node = null; var tagnames = []; while(node = result.iteratenext()) { tagnames.push(node.localname); } document.queryselector("
output").textcontent = tagnames.join(", "); result specifications specification status comment document...
XPathResult.numberValue - Web APIs
html <div>xpath example</div> <div>number of <div>s: <
output></
output></div> javascript var xpath = "count(//div)"; var result = document.evaluate(xpath, document, null, xpathresult.number_type, null); document.queryselector("
output").textcontent = result.numbervalue; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.numbervalue' in that ...
XPathResult.resultType - Web APIs
html <div>xpath example</div> <div>is xpath result a node set: <
output></
output></div> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.any_type, null); document.queryselector("
output").textcontent = result.resulttype >= xpathresult.unordered_node_iterator_type && result.resulttype <= xpathresult.first_ordered_node_type; result specifications specification status comment document o...
XPathResult.singleNodeValue - Web APIs
html <div>xpath example</div> <div>tag name of the element having the text content 'xpath example': <
output></
output></div> javascript var xpath = "//*[text()='xpath example']"; var result = document.evaluate(xpath, document, null, xpathresult.first_ordered_node_type, null); document.queryselector("
output").textcontent = result.singlenodevalue.localname; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definit...
XPathResult.snapshotItem() - Web APIs
html <div>xpath example</div> <div>tag names of the matched nodes: <
output></
output></div> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.ordered_node_snapshot_type, null); var node = null; var tagnames = []; for(var i = 0; i < result.snapshotlength; i++) { var node = result.snapshotitem(i); tagnames.push(node.localname); } document.queryselector("
output").textcontent = tagnames.join(", "); result specificat...
XPathResult.snapshotLength - Web APIs
html <div>xpath example</div> <div>number of matched nodes: <
output></
output></div> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.ordered_node_snapshot_type, null); document.queryselector("
output").textcontent = result.snapshotlength; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.snapshotle...
XPathResult.stringValue - Web APIs
html <div>xpath example</div> <div>text content of the <div> above: <
output></
output></div> javascript var xpath = "//div/text()"; var result = document.evaluate(xpath, document, null, xpathresult.string_type, null); document.queryselector("
output").textcontent = result.stringvalue; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.stringvalue' in that ...
XRViewerPose - Web APIs
0, 0, 0, 1); gl.cleardepth(1); gl.clear(gl.color_buffer_bit, gl.depth_buffer_bit); for (let view of pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /* render the scene for the eye view.eye */ } } passing each view to getviewport() returns the webgl viewport to apply in order to cause the rendered
output to be positioned correctly in the framebuffer for renderijng to the corresponding eye on the
output device.
XRWebGLLayer.ignoreDepthValues - Web APIs
usage notes when the ignoredepthvalues property is false, the xr compositor uses the values found in the depth buffer, which should be accurate for the scene, in order to potentially improve the quality or the
output as well as the comfort level for the viewer.
ARIA live regions - Accessibility
a working example of a simple year control for better understanding: <div id="date-input"> <label>year: <input type="text" id="year" value="1990" onblur="change(event)"/> </label> </div> <div id="date-
output" aria-live="polite"> the set year is: <span id="year-
output">1990</span> </div> function change(event) { var yearout = document.getelementbyid("year-
output"); switch (event.target.id) { case "year": yearout.innerhtml = event.target.value; break; default: return; } }; without aria-atomic="true" the screenreader announces only the changed value of year.
Using the alert role - Accessibility
assistive technology products should listen for such an event and notify the user accordingly: screen readers may interrupt current
output (whether it's speech or braille) and immediately announce or display the alert message.
Using the slider role - Accessibility
<label for="fader">volume</label> <input type="range" id="fader" min="1" max="100" value="50" step="1" aria-valuemin="1" aria-valuemax="100" aria-valuenow="50" oninput="
outputupdate(value)"> <
output for="fader" id="volume">50</
output> the following code snippet allows you to return the
output as it is updated by user input: function
outputupdate(vol) { document.queryselector('#volume').value = vol; } example 2: text values sometimes, a slider is used to choose a value that is not, semantically, a number.
Accessibility Information for Web Authors - Accessibility
the
output data report is displayed in a clear and well structured table where each and all checkpoints are identified and described (along with an helpful clickable link to the related reference guideline) into logical groups and according to measurable results: passed, warning, failed for automated verification, warning for manual verification, not selected, not available, not related, etc.
Web accessibility for seizures and physical reactions - Accessibility
uce), (update: slow) { * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; /* hat tip nick/cssremedy (https://css-tricks.com/revisiting-prefers-reduced-motion-the-reduced-motion-media-query/#comment-1700170) */ transition-duration: 0.001ms !important; } } from w3.org's page on media queries 4: the update media feature is used to query the ability of the
output device to modify the appearance of content once it has been rendered.
Text labels and names - Accessibility
this applies to all types of <input> items, as well as <button>, <
output>, <select>, <textarea>, <progress> and <meter> elements, as well as any element with the switch aria role.
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
.body { padding: 10px; } .listing { list-style: none; margin: 2em; display: grid; grid-gap: 20px; grid-auto-flow: dense; grid-template-columns: repeat(auto-fill,minmax(200px, 1fr)); } .listing .wide { grid-column-end: span 2; } this technique of using auto-placement with some rules applied to certain items is very useful, and can help you to deal with content that is being
output by a cms for example, where you have repeated items and can perhaps add a class to certain ones as they are rendered into the html.
animation - CSS: Cascading Style Sheets
furthermore, when serialized, default values of other properties must be
output in at least the cases necessary to distinguish an animation-name that could be a value of another property, and may be
output in additional cases.
<length> - CSS: Cascading Style Sheets
absolute length units absolute length units represent a physical measurement when the physical properties of the
output medium are known, such as for print layout.
<percentage> - CSS: Cascading Style Sheets
examples width and margin-left <div style="background-color:navy;"> <div style="width:50%; margin-left:20%; background-color:chartreuse;"> width: 50%, left margin: 20% </div> <div style="width:30%; margin-left:60%; background-color:pink;"> width: 30%, left margin: 60% </div> </div> the above html will
output: font-size <div style="font-size:18px;"> <p>full-size text (18px)</p> <p><span style="font-size:50%;">50% (9px)</span></p> <p><span style="font-size:200%;">200% (36px)</span></p> </div> the above html will
output: specifications specification status comment css values and units module level 4the definition of '<percentage>' in that specification.
writing-mode - CSS: Cascading Style Sheets
ertical-rl; -webkit-writing-mode: vertical-rl; -ms-writing-mode: vertical-rl; } .example.text4 span, .example.text4 { writing-mode: sideways-lr; -webkit-writing-mode: sideways-lr; -ms-writing-mode: sideways-lr; } .example.text5 span, .example.text5 { writing-mode: sideways-rl; -webkit-writing-mode: sideways-rl; -ms-writing-mode: sideways-rl; } result this image shows what the
output should look like, in case your browser's support for writing-mode is incomplete: specifications specification status comment css writing modes level 4the definition of 'writing-mode' in that specification.
regexp:match() - EXSLT
for example: <xsl:for-each select="regexp:match('http://developer.mozilla.org/en/docs/firefox_3_for_developers', '(\w+):\/\/([^/:]+)(:\d*)?([^# ]*)')"> part <xsl:value-of select="position()" /> = <xsl:value-of select="." /> </xsl:for-each> this code generates the following
output: part 1 = http://developer.mozilla.org/en/docs/firefox_3_for_developers part 2 = http part 3 = developer.mozilla.org part 4 = part 5 = /en/docs/firefox_3_for_developers specifications exslt - regexp:match ...
Creating and triggering events - Developer guides
m> const form = document.queryselector('form'); const textarea = document.queryselector('textarea'); // create a new event, allow bubbling, and provide any data you want to pass to the "detail" property const eventawesome = new customevent('awesome', { bubbles: true, detail: { text: () => textarea.value } }); // the form element listens for the custom "awesome" event and then consoles the
output of the passed text() method form.addeventlistener('awesome', e => console.log(e.detail.text())); // as the user types, the textarea inside the form dispatches/triggers the event to fire, and uses itself as the starting point textarea.addeventlistener('input', e => e.target.dispatchevent(eventawesome)); creating and dispatching events dynamically elements can listen for events that haven't bee...
Index - Developer guides
o creating a cross-browser html5 audio player with all the associated attributes, properties, and events explained a guide to custom controls created using the media api 10 live streaming web audio and video guide, adaptive streaming live streaming technology is often employed to relay live events such as sports, concerts and more generally tv and radio programmes that are
output live.
HTML attribute: accept - HTML: Hypertext Markup Language
nd pdf files, might look like this: <input type="file" accept="image/*,.pdf"> using file inputs a basic example <form method="post" enctype="multipart/form-data"> <div> <label for="file">choose file to upload</label> <input type="file" id="file" name="file" multiple> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } this produces the following
output: note: you can find this example on github too — see the source code, and also see it running live.
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
these elements instruct the browser to treat the name in isolation from its embedding context, so the example
output is properly ordered: <ul> <li><bdi class="name">اَلأَعْشَى</bdi> - 1st place</li> <li><bdi class="name">jerry cruncher</bdi> - 2nd place</li> </ul> body { border: 1px solid #3f87a6; max-width: calc(100% - 40px - 6px); padding: 20px; width: calc(100% - 40px - 6px); border-width: 1px 1px 1px 5px; } specifications specification status comment ...
<code>: The Inline Code element - HTML: Hypertext Markup Language
example a paragraph of text that includes <code>: <p>the function <code>selectall()</code> highlights all the text in the input field so the user can, for example, copy or delete the text.</p> the
output generated by this html looks like this: notes to represent multiple lines of code, wrap the <code> element within a <pre> element.
<input type="tel"> - HTML: Hypertext Markup Language
checkmark and invalid entries with a cross: div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; color: #8b0000; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; color: #009000; } the
output looks like this: pattern validation if you want to further restrict entered numbers so they also have to conform to a specific pattern, you can use the pattern attribute, which takes as its value a regular expression that entered values have to match.
<map> - HTML: Hypertext Markup Language
examples <map name="primary"> <area shape="circle" coords="75,75,75" href="left.html"> <area shape="circle" coords="275,75,75" href="right.html"> </map> <img usemap="#primary" src="https://udn.realityripple.com/samples/6a/7e559101b3.png" alt="350 x 150 pic"> result expected live example
output the live example above should appear similar to the following images (when using your keyboard tab key): for the left.html link: for the right.html link specifications specification status comment html living standardthe definition of '<map>' in that specification.
<rb>: The Ruby Base element - HTML: Hypertext Markup Language
in this case we don't need to include <rb> elements: <ruby> 漢 <rp>(</rp><rt>kan</rt><rp>)</rp> 字 <rp>(</rp><rt>ji</rt><rp>)</rp> </ruby> <ruby> <rb>漢<rb>字 <rp>(</rp><rt>kan<rt>ji<rp>)</rp> </ruby> body { font-size: 22px; } the
output looks like so: the html above might look something like this when rendered by a browser without ruby support: 漢字 (kan ji) body { font-size: 22px; } note: see the article about the <ruby> element for further examples.
<rt>: The Ruby Text element - HTML: Hypertext Markup Language
examples this simple example provides romaji transliteration for the kanji characters within the <ruby> element: <ruby> 漢 <rt>kan</rt> 字 <rt>ji</rt> </ruby> body { font-size: 22px; } the
output looks like this in your browser: on a browser without ruby support, this example might look like this: 漢 kan 字 ji body { font-size: 22px; } specifications specification status comment html living standardthe definition of '<rt>' in that specification.
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
examples basic example <p>before proceeding, <strong>make sure you put on your safety goggles</strong>.</p> the resulting
output: labeling warnings <p><strong>important:</strong> before proceeding, make sure you add plenty of butter.</p> this results in: specifications specification status comment html living standardthe definition of '<strong>' in that specification.
<time> - HTML: Hypertext Markup Language
4:54:39.929 2011-11-18 14:54:39.929 a valid global date and time string 2011-11-18t14:54:39.929z 2011-11-18t14:54:39.929-0400 2011-11-18t14:54:39.929-04:00 2011-11-18 14:54:39.929z 2011-11-18 14:54:39.929-0400 2011-11-18 14:54:39.929-04:00 a valid duration string pt4h18m3s examples simple example html <p>the concert starts at <time datetime="2018-07-07t20:00:00">20:00</time>.</p>
output datetime example html <p>the concert took place on <time datetime="2001-05-15t19:00">may 15</time>.</p>
output specifications specification status comment html living standardthe definition of '<time>' in that specification.
Inline elements - HTML: Hypertext Markup Language
ne by default (although block and inline elements are no longer defined in html 5, use content categories instead): <a> <abbr> <acronym> <audio> (if it has visible controls) <b> <bdi> <bdo> <big> <br> <button> <canvas> <cite> <code> <data> <datalist> <del> <dfn> <em> <embed> <i> <iframe> <img> <input> <ins> <kbd> <label> <map> <mark> <meter> <noscript> <object> <
output> <picture> <progress> <q> <ruby> <s> <samp> <script> <select> <slot> <small> <span> <strong> <sub> <sup> <svg> <template> <textarea> <time> <u> <tt> <var> <video> <wbr> see also block-level elements html element reference display content categories block and inline layout in normal flow ...
HTML: Hypertext Markup Language
html markup includes special "elements" such as <head>, <title>, <body>, <header>, <footer>, <article>, <section>, <p>, <div>, <span>, <img>, <aside>, <audio>, <canvas>, <datalist>, <details>, <embed>, <nav>, <
output>, <progress>, <video>, <ul>, <ol>, <li> and many others.
Configuring servers for Ogg media - HTTP
the
output from oggz-info looks like this: $ oggz-info /g/media/bruce_vs_ironman.ogv content-duration: 00:01:00.046 skeleton: serialno 1976223438 4 packets in 3 pages, 1.3 packets/page, 27.508% ogg overhead presentation-time: 0.000 basetime: 0.000 theora: serialno 0170995062 1790 packets in 1068 pages, 1.7 packets/page, 1.049% ogg overhead video-framerate:...
An overview of HTTP - HTTP
this is useful not only for e-commerce shopping baskets, but also for any site allowing user configuration of the
output.
Introduction - JavaScript
along the bottom of the console is an input line that you can use to enter javascript, and the
output appears in the panel above: the console works the exact same way as eval: the last expression entered is returned.
JavaScript modules - JavaScript
createreportlist() — creates an unordered list appended inside a specified wrapper element, which can be used to
output report data into.
Regular expressions - JavaScript
var myre = /d(b+)d/g; var myarray = myre.exec('cdbbdbsbz'); if you do not need to access the properties of the regular expression, an alternative way of creating myarray is with this script: var myarray = /d(b+)d/g.exec('cdbbdbsbz'); // similar to "cdbbdbsbz".match(/d(b+)d/g); however, // "cdbbdbsbz".match(/d(b+)d/g)
outputs array [ "dbbd" ], while // /d(b+)d/g.exec('cdbbdbsbz')
outputs array [ 'dbbd', 'bb', index: 1, input: 'cdbbdbsbz' ].
Inheritance and the prototype chain - JavaScript
try the following code: function dosomething(){} dosomething.prototype.foo = "bar"; // add a property onto the prototype var dosomeinstancing = new dosomething(); dosomeinstancing.prop = "some value"; // add a property onto the object console.log( dosomeinstancing ); this results in an
output similar to the following: { prop: "some value", __proto__: { foo: "bar", constructor: ƒ dosomething(), __proto__: { constructor: ƒ object(), hasownproperty: ƒ hasownproperty(), isprototypeof: ƒ isprototypeof(), propertyisenumerable: ƒ propertyisenumerable(), tolocalestring: ƒ tolocalestring(), ...
Rest parameters - JavaScript
function myfun(a, b, ...manymoreargs) { console.log("a", a) console.log("b", b) console.log("manymoreargs", manymoreargs) } myfun("one", "two", "three", "four", "five", "six") // console
output: // a, one // b, two // manymoreargs, [three, four, five, six] difference between rest parameters and the arguments object there are three main differences between rest parameters and the arguments object: rest parameters are only the ones that haven't been given a separate name (i.e.
Functions - JavaScript
for example, alert(new function())
outputs: function anonymous() { } since the function actually does not have a name, anonymous is not a variable that can be accessed within the function.
Array.prototype.find() - JavaScript
index ', index, ' with value ', value); }); // shows all indexes, including deleted array.find(function(value, index) { // delete element 5 on first iteration if (index === 0) { console.log('deleting array[5] with value ', array[5]); delete array[5]; } // element 5 is still visited even though deleted console.log('visited index ', index, ' with value ', value); }); // expected
output: // deleting array[5] with value 5 // visited index 0 with value 0 // visited index 1 with value 1 // visited index 2 with value undefined // visited index 3 with value undefined // visited index 4 with value undefined // visited index 5 with value undefined // visited index 6 with value 6 specifications specification ecmascript (ecma-262)the definition of 'array.prototyp...
Array.prototype.forEach() - JavaScript
example code let ratings = [5, 4, 5]; let sum = 0; let sumfunction = async function (a, b) { return a + b } ratings.foreach(async function(rating) { sum = await sumfunction(sum, rating) }) console.log(sum) // naively expected
output: 14 // actual
output: 0 examples no operation for uninitialized values (sparse arrays) const arraysparse = [1,3,,7] let numcallbackruns = 0 arraysparse.foreach((element) => { console.log(element) numcallbackruns++ }) console.log("numcallbackruns: ", numcallbackruns) // 1 // 3 // 7 // numcallbackruns: 3 // comment: as you can see the missing value between 3 and 7 didn't invoke callback...
Array.prototype.join() - JavaScript
function f(a, b, c) { var s = array.prototype.join.call(arguments); console.log(s); // '1,a,true' } f(1, 'a', true); //expected
output: "1,a,true" specifications specification ecmascript (ecma-262)the definition of 'array.prototype.join' in that specification.
Array.prototype.map() - JavaScript
ay to achieve the above, while avoiding the "gotcha": ['1', '2', '3'].map(number) // [1, 2, 3] // but unlike parseint(), number() will also return a float or (resolved) exponential notation: ['1.1', '2.2e2', '3e300'].map(number) // [1.1, 220, 3e+300] // for comparison, if we use parseint() on the array above: ['1.1', '2.2e2', '3e300'].map( str => parseint(str) ) // [1, 2, 3] one alternative
output of the map method being called with parseint as a parameter runs as follows: let xs = ['10', '10', '10'] xs = xs.map(parseint) console.log(xs) // actual result of 10,nan,2 may be unexpected based on the above description.
Array.prototype.toString() - JavaScript
examples using tostring const array1 = [1, 2, 'a', '1a']; console.log(array1.tostring()); // expected
output: "1,2,a,1a" specifications specification ecmascript (ecma-262)the definition of 'array.prototype.tostring' in that specification.
Array - JavaScript
'p','p','p','p'], [' ',' ',' ',' ',' ',' ',' ',' '], [' ',' ',' ',' ',' ',' ',' ',' '], [' ',' ',' ',' ',' ',' ',' ',' '], [' ',' ',' ',' ',' ',' ',' ',' '], ['p','p','p','p','p','p','p','p'], ['r','n','b','q','k','b','n','r'] ] console.log(board.join('\n') + '\n\n') // move king's pawn forward 2 board[4][4] = board[6][4] board[6][4] = ' ' console.log(board.join('\n')) here is the
output: r,n,b,q,k,b,n,r p,p,p,p,p,p,p,p , , , , , , , , , , , , , , , , , , , , , , , , , , , , p,p,p,p,p,p,p,p r,n,b,q,k,b,n,r r,n,b,q,k,b,n,r p,p,p,p,p,p,p,p , , , , , , , , , , , , , , , , , ,p, , , , , , , , , , p,p,p,p, ,p,p,p r,n,b,q,k,b,n,r using an array to tabulate a set of values values = [] for (let x = 0; x < 10; x++){ values.push([ 2 ** x, 2 * x ** 2 ]) } console.table(va...
Date - JavaScript
particularly useful are the functions that
output the date and time in coordinated universal time (utc), the global standard time defined by the world time standard.
Function.arguments - JavaScript
examples using the arguments object function f(n) { g(n - 1) } function g(n) { console.log('before: ' + g.arguments[0]) if (n > 0) { f(n) } console.log('after: ' + g.arguments[0]) } f(2) console.log('returned: ' + g.arguments) //
output // before: 1 // before: 0 // after: 0 // after: 1 // returned: null specifications not part of any standard.
Generator.prototype.next() - JavaScript
method returns: function* gen() { yield 1; yield 2; yield 3; } const g = gen(); // "generator { }" g.next(); // "object { value: 1, done: false }" g.next(); // "object { value: 2, done: false }" g.next(); // "object { value: 3, done: false }" g.next(); // "object { value: undefined, done: true }" using next() with a list function* getpage(pagesize = 1, list) { let
output = []; let index = 0; while (index < list.length) {
output = []; for (let i = index; i < index + pagesize; i++) { if (list[i]) {
output.push(list[i]); } } yield
output; index += pagesize; } } list = [1, 2, 3, 4, 5, 6, 7, 8] var page = getpage(3, list); // generator { } page.next(); // object {value: (3) [1,...
Intl.DisplayNames() constructor - JavaScript
console.log((new intl.displaynames()).of('us')); // expected
output: 'us' specifications specification intl.displaynamesthe definition of 'the intl.displaynames constructor' in that specification.
Intl.NumberFormat.prototype.formatToParts() - JavaScript
examples comparing format and formattoparts numberformat
outputs localized, opaque strings that cannot be manipulated directly: var number = 3500; var formatter = new intl.numberformat('de-de', { style: 'currency', currency: 'eur' }); formatter.format(number); // "3.500,00 €" however, in many user interfaces there is a desire to customize the formatting of this string.
Intl - JavaScript
examples formatting dates and numbers you can use intl to format dates and numbers in a form that's conventional for a specific language and region: const count = 26254.39; const date = new date("2012-05-24"); function log(locale) { console.log( `${new intl.datetimeformat(locale).format(date)} ${new intl.numberformat(locale).format(count)}` ); } log("en-us"); // expected
output: 5/24/2012 26,254.39 log("de-de"); // expected
output: 24.5.2012 26.254,39 specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl' in that specification.
Object.create() - JavaScript
rectangle.prototype.constructor = rectangle; var rect = new rectangle(); console.log('is rect an instance of rectangle?', rect instanceof rectangle); // true console.log('is rect an instance of shape?', rect instanceof shape); // true rect.move(1, 1); //
outputs, 'shape moved.' if you wish to inherit from multiple objects, then mixins are a possibility.
Object.freeze() - JavaScript
var employee = { name: "mayank", designation: "developer", address: { street: "rohini", city: "delhi" } }; object.freeze(employee); employee.name = "dummy"; // fails silently in non-strict mode employee.address.city = "noida"; // attributes of child object can be modified console.log(employee.address.city) //
output: "noida" to make an object immutable, recursively freeze each property which is of type object (deep freeze).
Object.getOwnPropertyNames() - JavaScript
ass.prototype.prototypemethod = function() {}; console.log( object.getownpropertynames( new childclass() // ["prop", "method"] ) ); get non-enumerable properties only this uses the array.prototype.filter() function to remove the enumerable keys (obtained with object.keys()) from a list of all keys (obtained with object.getownpropertynames()) thus giving only the non-enumerable keys as
output.
Object.prototype.toString() - JavaScript
by using radix you can also convert base 10 numbers (like 1,2,3,4,5,.........) to another base numbers, in example below we are converting base 10 number to a base 2 (binary) number let basetenint = 10; console.log(basetenint.tostring(2)); // expected
output is "1010" and same for big integers let bignum = bigint(20); console.log(bignum.tostring(2)); // expected
output is "10100" some common radix are 2 for binary numbers, 8 for octal numbers, 10 for decimal numbers, 16 for hexadecimal numbers.
Promise - JavaScript
promisea.then( (val) => console.log("asynchronous logging has val:",val) ); console.log("immediate logging"); // produces
output in this order: // immediate logging // asynchronous logging has val: 777 constructor promise() creates a new promise object.
RegExp.prototype.dotAll - JavaScript
examples using dotall var str1 = 'bar\nexample foo example'; var regex1 = new regexp('bar.example','s'); console.log(regex1.dotall); //
output: true console.log(str1.replace(regex1,'')); //
output: foo example var str2 = 'bar\nexample foo example'; var regex2 = new regexp('bar.example'); console.log(regex2.dotall); //
output: false console.log(str2.replace(regex2,'')); //
output: bar // example foo example specifications specification ecmascript (ecma-262)the definit...
RegExp.prototype.global - JavaScript
examples using global var regex = new regexp('foo', 'g'); console.log(regex.global); // true var str = 'fooexamplefoo'; var str1 = str.replace(regex, ''); console.log(str1); //
output: example var regex1 = new regexp('foo'); var str2 = str.replace(regex1, ''); console.log(str2); //
output: examplefoo specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.global' in that specification.
RegExp.$1-$9 - JavaScript
examples using $n with string.replace the following script uses the replace() method of the string instance to match a name in the format first last and
output it in the format last, first.
RegExp - JavaScript
examples using a regular expression to change data format the following script uses the replace() method of the string instance to match a name in the format first last and
output it in the format last, first.
String.prototype.anchor() - JavaScript
examples using anchor() var mystring = 'table of contents'; document.body.innerhtml = mystring.anchor('contents_anchor'); will
output the following html: <a name="contents_anchor">table of contents</a> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.anchor' in that specification.
String.prototype.padStart() - JavaScript
// "foofoofabc" 'abc'.padstart(6,"123465"); // "123abc" 'abc'.padstart(8, "0"); // "00000abc" 'abc'.padstart(1); // "abc" fixed width string number conversion // javascript version of: (unsigned) // printf "%0*d" width num function leftfillnum(num, targetlength) { return num.tostring().padstart(targetlength, 0); } const num = 123; console.log(leftfillnum(num, 5)); // expected
output: "00123" specifications specification ecmascript (ecma-262)the definition of 'string.prototype.padstart' in that specification.
String.raw() - JavaScript
// all kinds of escape characters will be ineffective // and backslashes will be present in the
output string.
Symbol.asyncIterator - JavaScript
const myasynciterable = { async* [symbol.asynciterator]() { yield "hello"; yield "async"; yield "iteration!"; } }; (async () => { for await (const x of myasynciterable) { console.log(x); // expected
output: // "hello" // "async" // "iteration!" } })(); when creating an api, remember that async iterables are designed to represent something iterable — like a stream of data or a list —, not to completely replace callbacks and events in most situations.
Symbol.replace - JavaScript
symbol.replace writable no enumerable no configurable no examples using symbol.replace class customreplacer { constructor(value) { this.value = value; } [symbol.replace](string) { return string.replace(this.value, '#!@?'); } } console.log('football'.replace(new customreplacer('foo'))); // expected
output: "#!@?tball" specifications specification ecmascript (ecma-262)the definition of 'symbol.replace' in that specification.
Symbol.search - JavaScript
writable no enumerable no configurable no examples custom string search class caseinsensitivesearch { constructor(value) { this.value = value.tolowercase(); } [symbol.search](string) { return string.tolowercase().indexof(this.value); } } console.log('foobar'.search(new caseinsensitivesearch('bar'))); // expected
output: 3 specifications specification ecmascript (ecma-262)the definition of 'symbol.search' in that specification.
Symbol.split - JavaScript
property attributes of symbol.split writable no enumerable no configurable no examples custom reverse split class reversesplit { [symbol.split](string) { const array = string.split(' '); return array.reverse(); } } console.log('another one bites the dust'.split(new reversesplit())); // expected
output: [ "dust", "the", "bites", "one", "another" ] specifications specification ecmascript (ecma-262)the definition of 'symbol.split' in that specification.
WebAssembly.Global() constructor - JavaScript
const
output = document.getelementbyid('
output'); function asserteq(msg, got, expected) {
output.innerhtml += `testing ${msg}: `; if (got !== expected)
output.innerhtml += `fail!<br>got: ${got}<br>expected: ${expected}<br>`; else
output.innerhtml += `success!
WebAssembly.Global - JavaScript
const
output = document.getelementbyid('
output'); function asserteq(msg, got, expected) {
output.innerhtml += `testing ${msg}: `; if (got !== expected)
output.innerhtml += `fail!<br>got: ${got}<br>expected: ${expected}<br>`; else
output.innerhtml += `success!
WebAssembly.Module.exports() - JavaScript
= { imports: { imported_func: function(arg) { console.log(arg); } } }; onmessage = function(e) { console.log('module received from main thread'); var mod = e.data; webassembly.instantiate(mod, importobject).then(function(instance) { instance.exports.exported_func(); }); var exports = webassembly.module.exports(mod); console.log(exports[0]); }; the exports[0]
output looks like this: { name: "exported_func", kind: "function" } specifications specification webassembly javascript interfacethe definition of 'exports()' in that specification.
WebAssembly.Module.imports() - JavaScript
webassembly.compilestreaming(fetch('simple.wasm')) .then(function(mod) { var imports = webassembly.module.imports(mod); console.log(imports[0]); }); the
output looks like this: { module: "imports", name: "imported_func", kind: "function" } specifications specification webassembly javascript interfacethe definition of 'imports()' in that specification.
delete operator - JavaScript
var employee = {}; object.defineproperty(employee, 'name', {configurable: false}); console.log(delete employee.name); // returns false var, let, and const create non-configurable properties that cannot be deleted with the delete operator: var nameother = 'xyz'; // we can access this global property using: object.getownpropertydescriptor(window, 'nameother'); //
output: object {value: "xyz", // writable: true, // enumerable: true, // configurable: false} // since "nameother" is added using with the // var keyword, it is marked as "non-configurable" delete nameother; // return false in strict mode, this would have raised an exception.
void operator - JavaScript
void function iife() { console.log("executed!"); }(); //
output: "executed!" executing the above function without the void keyword will result in an uncaught syntaxerror.
continue - JavaScript
var i = 0; var j = 8; checkiandj: while (i < 4) { console.log('i: ' + i); i += 1; checkj: while (j > 4) { console.log('j: ' + j); j -= 1; if ((j % 2) == 0) continue checkj; console.log(j + ' is odd.'); } console.log('i = ' + i); console.log('j = ' + j); }
output: i: 0 // start checkj j: 8 7 is odd.
for await...of - JavaScript
responsesize += chunk.length; } console.log(`response size: ${responsesize} bytes`); // expected
output: "response size: 1071472" return responsesize; } getresponsesize('https://jsonplaceholder.typicode.com/photos'); iterating over sync iterables and generators for await...of loop also consumes sync iterables and generators.
for - JavaScript
var oitnode = document.getelementbyid(sid); /* initialization */ oitnode; /* condition */ nleft += oitnode.offsetleft, ntop += oitnode.offsettop, oitnode = oitnode.offsetparent /* final-expression */ ); /* semicolon */ console.log('offset position of \'' + sid + '\' element:\n left: ' + nleft + 'px;\n top: ' + ntop + 'px;'); } /* example call: */ showoffsetpos('content'); //
output: // "offset position of "content" element: // left: 0px; // top: 153px;" note: this is one of the few cases in javascript where the semicolon is mandatory.
return - JavaScript
function counter() { for (var count = 1; ; count++) { // infinite loop console.log(count + 'a'); // until 5 if (count === 5) { return; } console.log(count + 'b'); // until 4 } console.log(count + 'c'); // never appears } counter(); //
output: // 1a // 1b // 2a // 2b // 3a // 3b // 4a // 4b // 5a returning a function see also the article about closures.
MathML
authoring mathml suggestions and tips for writing mathml, including suggested mathml editors and how to integrate their
output into web content.
in - SVG: Scalable Vector Graphics
if no value is provided, the
output will only be available for re-use as the implicit input into the next filter primitive if that filter primitive provides no value for its in attribute.
result - SVG: Scalable Vector Graphics
if no value is provided, the
output will only be available for re-use as the implicit input into the next filter primitive if that filter primitive provides no value for its in attribute.
<feImage> - SVG: Scalable Vector Graphics
the <feimage> svg filter primitive fetches image data from an external source and provides the pixel data as
output (meaning if the external source is an svg image, it is rasterized.) usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <animatetransform>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes xlink attributes class style externalresourcesrequired specific attributes preserveaspectratio xlink:href dom interface this element implements the svgfeimageelement interface.
SVG Filters Tutorial - SVG: Scalable Vector Graphics
svg filter example <defs> <filter id="drop-shadow"> <fegaussianblur in="sourcealpha" stddeviation="3"/> </filter> </defs> <g id="ghost" style="filter: url(#drop-shadow);"/> <!--ghost drawing in here--> </g> this above example will not produced the desired
output.
lang - XPath
given this fragment of xml: <p xml:lang="en">i went up a floor.</p> <p xml:lang="en-gb">i took the lift.</p> <p xml:lang="en-us">i rode the elevator.</p> and this part of an xsl template: <xsl:value-of select="count(//p[lang('en')])" /> <xsl:value-of select="count(//p[lang('en-gb')])" /> <xsl:value-of select="count(//p[lang('en-us')])" /> <xsl:value-of select="count(//p[lang('de')])" /> the
output might be: 3 1 1 0 defined xpath 1.0 4.3 gecko support supported.
substring-after - XPath
examples xpath example
output substring-after('aa-bb','-') bb substring-after('aa-bb','a') a-bb substring-after('aa-bb','b') b substring-after('aa-bb','q') (empty string) defined xpath 1.0 4.2 gecko support supported.
substring-before - XPath
examples xpath example
output substring-before('aa-bb','-') aa substring-before('aa-bb','a') (empty string) substring-before('aa-bb','b') aa- substring-before('aa-bb','q') (empty string) defined xpath 1.0 4.2 gecko support supported.
The Netscape XSLT/XPath Reference - XSLT: Extensible Stylesheet Language Transformations
xsl:copy (supported) xsl:copy-of (supported) xsl:decimal-format (supported) xsl:element (supported) xsl:fallback (not supported) xsl:for-each (supported) xsl:if (supported) xsl:import (mostly supported) xsl:include (supported) xsl:key (supported) xsl:message (supported) xsl:namespace-alias (not supported) xsl:number (partially supported) xsl:otherwise (supported) xsl:
output (partially supported) xsl:param (supported) xsl:preserve-space (supported) xsl:processing-instruction xsl:sort (supported) xsl:strip-space (supported) xsl:stylesheet (partially supported) xsl:template (supported) xsl:text (partially supported) xsl:transform (supported) xsl:value-of (partially supported) xsl:variable (supported) xsl:when (supported) xsl:with-param (suppor...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
nt (supported) xsl:copy (supported) xsl:copy-of (supported) xsl:decimal-format (supported) xsl:element (supported) xsl:fallback (not supported) xsl:for-each (supported) xsl:if (supported) xsl:import (mostly supported) xsl:include (supported) xsl:key (supported) xsl:message (supported) xsl:namespace-alias (not supported) xsl:number (partially supported) xsl:otherwise (supported) xsl:
output (partially supported) xsl:param (supported) xsl:preserve-space (supported) xsl:processing-instruction xsl:sort (supported) xsl:strip-space (supported) xsl:stylesheet (partially supported) xsl:template (supported) xsl:text (partially supported) xsl:transform (supported) xsl:value-of (partially supported) xsl:variable (supported) xsl:when (supported) xsl:with-param (supported) axes ...
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
.getelementbyid("example").innerhtml = ""; mydom = fragment; // add the new content from the transformation document.getelementbyid("example").appendchild(fragment) } // xsl stylesheet: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:
output method="html" indent="yes" /> <xsl:param name="myorder" /> <xsl:template match="/"> <xsl:apply-templates select="/div//div"> <xsl:sort select="." data-type="number" order="{$myorder}" /> </xsl:apply-templates> </xsl:template> <xsl:template match="div"> <xsl:copy-of select="." /> </xsl:template> </xsl:stylesheet> ...
Basic Example - XSLT: Extensible Stylesheet Language Transformations
</myns:body> </myns:article> figure 5 : xslt stylesheet <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:myns="http://devedge.netscape.com/2002/de"> <xsl:
output method="html" /> <xsl:template match="/"> <html> <head> <title> <xsl:value-of select="/myns:article/myns:title"/> </title> <style type="text/css"> .mybox {margin:10px 155px 0 50px; border: 1px dotted #639ace; padding:0 5px 0 5px;} </style> </head> <body> <p class="mybox"> <span class="title"> ...
Compiling from Rust to WebAssembly - WebAssembly
create webpack.config.js and put the following in it: const path = require('path'); module.exports = { entry: "./index.js",
output: { path: path.resolve(__dirname, "dist"), filename: "index.js", }, mode: "development" }; now we need an html file; create index.html and give it the following contents: <!doctype html> <html> <head> <meta charset="utf-8"> <title>hello-wasm example</title> </head> <body> <script src="./index.js"></script> </body> </html> finally, create the index.js referenced i...
Using the WebAssembly JavaScript API - WebAssembly
const
output = document.getelementbyid('
output'); function asserteq(msg, got, expected) {
output.innerhtml += `testing ${msg}: `; if (got !== expected)
output.innerhtml += `fail!<br>got: ${got}<br>expected: ${expected}<br>`; else
output.innerhtml += `success!