Search completed in 1.08 seconds.
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
the html <
input> element is used to create interactive controls for web-based forms in order to accept data from the user; a wide variety of types of
input data and control widgets are available, depending on the device and user agent.
... the <
input> element is one of the most powerful and complex in all of html due to the sheer number of combinations of
input types and attributes.
... <
input> types how an <
input> works varies considerably depending on the value of its type attribute, hence the different types are covered in their own separate reference pages.
...And 181 more matches
Inputs and input sources - Web APIs
to that end, webxr provides support for a variety of kinds of
input devices.
... in this guide, we'll look at how to use webxr's
input device management features to determine what
input sources are available and how to then monitor those sources for
inputs in order to handle user interactivity with your virtual or augmented environment.
...
inputs in webxr fundamentally,
inputs in webxr fall into two basic categories: targeting and actions.
...And 97 more matches
InputEvent.inputType - Web APIs
the
inputtype read-only property of the
inputevent interface returns the type of change made to editible content.
... syntax var astring =
inputevent.
inputtype; value a domstring containing the type of
input that was made.
...for a complete list of the available
input types, see the attributes section of the
input events level 1 spec.
...And 5 more matches
XRInputSourceEvent.inputSource - Web APIs
the xr
inputsourceevent interface's read-only
inputsource property specifies the xr
inputsource which generated the
input event.
... this information lets you handle the event appropriately given the particulars of the user
input device being manipulated.
... syntax let
inputsource = xr
inputsourceevent.
inputsource; value an xr
inputsource object identifying the source of the user
input event.
...And 4 more matches
XRInputSourceEventInit.inputSource - Web APIs
the xr
inputsourceeventinit dictionary's
inputsource property is used when calling the xr
inputsourceevent() constructor to specify the xr
inputsource from which the newly-created event is being sent.
... of course, as a general rule, you won't need to create xr
inputsourceeventinit objects yourself.
... syntax let xr
inputsourceeventinit.
inputsource = xr
inputsource; let xr
inputsourceeventinit = {
inputsource: xr
inputsource }; let xr
inputsourceevent = new xr
inputsourceevent(type, {
inputsource: xr
inputsource }); value an xr
inputsource object indicating the source of the newly-created xr
inputsourceevent to be created.
...And 2 more matches
<input type="email"> - HTML: Hypertext Markup Language
<
input> elements of type email are used to let the user enter and edit an e-mail address, or, if the multiple attribute is specified, a list of e-mail addresses.
... the
input value is automatically validated to ensure that it's either empty or a properly-formatted e-mail address (or list of addresses) before the form can be submitted.
... on browsers that don't support
inputs of type email, a email
input falls back to being a standard text
input.
...And 48 more matches
<input type="number"> - HTML: Hypertext Markup Language
<
input> elements of type number are used to let the user enter a number.
... on browsers that don't support
inputs of type number, a number
input falls back to type text.
... events change and
input supported common attributes autocomplete, list, placeholder, readonly idl attributes list, value, valueasnumber methods select(), stepup(), stepdown() value any floating-point number, or empty.
...And 47 more matches
<input type="url"> - HTML: Hypertext Markup Language
<
input> elements of type url are used to let the user enter and edit a url.
... the
input value is automatically validated to ensure that it's either empty or a properly-formatted url before the form can be submitted.
... on browsers that don't support
inputs of type url, a url
input falls back to being a standard text
input.
...And 47 more matches
<input type="time"> - HTML: Hypertext Markup Language
<
input> elements of type time create
input fields designed to let the user easily enter a time (hours and minutes, and optionally seconds).
...support is good in modern browsers, with safari being the sole major browser not yet implementing it; in safari, and any other browsers that don't support <time>, it degrades gracefully to <
input type="text">.
...it also uses a 12- or 24-hour format for
inputting times, based on system locale.
...And 46 more matches
<input type="tel"> - HTML: Hypertext Markup Language
<
input> elements of type tel are used to let the user enter and edit a telephone number.
... unlike <
input type="email"> and <
input type="url"> , the
input value is not automatically validated to a particular format before the form can be submitted, because formats for telephone numbers vary so much around the world.
... despite the fact that
inputs of type tel are functionally identical to standard text
inputs, they do serve useful purposes; the most quickly apparent of these is that mobile browsers — especially on mobile phones — may opt to present a custom keypad optimized for entering phone numbers.
...And 44 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
<
input> elements of type datetime-local create
input controls that let the user easily enter both a date and a time, including the year, month, and day as well as the time in hours and minutes.
...in other browsers, these degrade gracefully to simple <
input type="text"> controls.
... because of the limited browser support for datetime-local, and the variations in how the
inputs work, it may currently still be best to use a framework or library to present these, or to use a custom
input of your own.
...And 42 more matches
<input type="search"> - HTML: Hypertext Markup Language
<
input> elements of type search are text fields designed for the user to enter search queries into.
... these are functionally identical to text
inputs, but may be styled differently by the user agent.
... events change and
input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, required, size.
...And 42 more matches
nsITextInputProcessor
dom/interfaces/base/nsitext
inputprocessor.idlscriptable this interface is a text
input events synthesizer and manages its composition and modifier state 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) the motivation of this interface is to provide better api than nsidomwindowutils to dispatch key events and create, modify, and commit composition in higher level.
... you can create an instance of this interface with the following code: var tip = components.classes["@mozilla.org/text-
input-processor;1"].
... createinstance(components.interfaces.nsitext
inputprocessor); next, you need to get the rights to create composition or dispatch keyboard events with begin
inputtransaction() or begin
inputtransactionfortests(): if (!tip.begin
inputtransaction(window, callback)) { return; } if begin
inputtransaction() or begin
inputtransactionfortests() returns false, it means that another instance of nsitext
inputprocessor has composition on the window or is dispatching an event.
...And 41 more matches
<input type="month"> - HTML: Hypertext Markup Language
<
input> elements of type month create
input fields that let the user enter a month and year allowing a month and year to be easily entered.
...in browsers that don't support month
inputs, the control degrades gracefully to a simple <
input type="text">, although there may be automatic validation of the entered text to ensure it's formatted as expected.
... events change and
input supported common attributes autocomplete, list, readonly, and step.
...And 39 more matches
<input type="text"> - HTML: Hypertext Markup Language
<
input> elements of type text create basic single-line text fields.
... events change and
input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes list, value methods select(), setrangetext() and setselectionrange().
... let thetext = mytext
input.value; if no validation constraints are in place for the
input (see validation for more details), the value may be an empty string ("").
...And 39 more matches
<input type="date"> - HTML: Hypertext Markup Language
<
input> elements of type="date" create
input fields that let the user enter a date, either with a textbox that validates the
input or a special date picker interface.
...the time and datetime-local
input types support time and date+time
input.
... the
input ui generally varies from browser to browser; see browser compatibility for further details.
...And 38 more matches
The HTML5 input types - Learn web development
previous overview: forms next in the previous article we looked at the <
input> element, covering the original values of the type attribute available since the early days of html.
... now we'll look at the functionality of newer form controls in detail, including some new
input types, which were added in html5 to allow collection of specific types of data.
... objective: to understand the newer
input type values available to create native form controls, and how to implement them using html.
...And 33 more matches
<input type="week"> - HTML: Hypertext Markup Language
<
input> elements of type week create
input fields allowing easy entry of a year plus the iso 8601 week number during that year (i.e., week 1 to 52 or 53).
...in non-supporting browsers, the control degrades gracefully to function identically to <
input type="text">.
... value a domstring representing a week and year, or empty events change and
input supported common attributes autocomplete, list, readonly, and step idl attributes value, valueasdate, valueasnumber, and list.
...And 31 more matches
HTMLInputElement - Web APIs
the html
inputelement interface provides special properties and methods for manipulating the options, layout, and presentation of <
input> 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
inputelement" target="_top"><rect x="331" y="65" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">html
inputelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties properti...
... properties that apply to any type of
input element that is not hidden name string: returns / sets the element's name attribute, containing a name that identifies the element when submitting the form.
...And 30 more matches
<input type="file"> - HTML: Hypertext Markup Language
<
input> elements with type="file" let the user choose one or more files from their device storage.
... events change and
input supported common attributes required additional attributes accept, capture, files, multiple idl attributes files and value dom interface html
inputelement properties properties that apply only to elements of type file methods select() value a file
input's value attribute contains a domstring that repr...
...the other files can be identified using the
input's html
inputelement.files property.
...And 27 more matches
<input type="password"> - HTML: Hypertext Markup Language
<
input> elements of type password provide a way for the user to securely enter a password.
... value a domstring representing a password, or empty events change and
input supported common attributes autocomplete,
inputmode, maxlength, minlength, pattern, placeholder, readonly, required, and size idl attributes selectionstart, selectionend, selectiondirection, and value methods select(), setrangetext(), and setselectionrange() value the value attribute contains a domstring whose value is the current contents of the text e...
... additional attributes in addition to the attributes that operate on all <
input> elements regardless of their type, password field
inputs support the following attributes: attribute description maxlength the maximum length the value may be, in utf-16 characters minlength the minimum length in characters that will be considered valid pattern a regular expression the value must match in order to be valid placeholder...
...And 26 more matches
<input type="range"> - HTML: Hypertext Markup Language
<
input> elements of type range let the user specify a numeric value which must be no less than a given value, and no more than another given value.
...this is typically represented using a slider or dial control rather than a text entry box like the number
input type.
... if the user's browser doesn't support type range, it will fall back and treat it as a text
input.
...And 25 more matches
<input type="image"> - HTML: Hypertext Markup Language
<
input> elements of type image are used to create graphical submit buttons, i.e.
... value <
input type="image"> elements do not accept value attributes.
... additional attributes in addition to the attributes shared by all <
input> elements, image button
inputs support the following attributes: attribute description alt alternate string to display when the image can't be shown formaction the url to which to submit the data formenctype the encoding method to use when submitting the form data formmethod the http method to use when submitting the form formnovalidate a boolean which, if present, indicates that the form shouldn't be validated before submission formtarget a string indicating a browsing context from where to load the results of submitting the form height the height,...
...And 22 more matches
<input type="color"> - HTML: Hypertext Markup Language
<
input> elements of type color provide a user interface element that lets a user specify a color, either by using a visual color picker interface or by entering the color into a text field in #rrggbb hexadecimal format.
... the element's presentation may vary substantially from one browser and/or platform to another—it might be a simple textual
input that automatically validates to ensure that the color information is entered in the proper format, or a platform-standard color picker, or some kind of custom color picker window.
... value a 7-character domstring specifying a <color> in lower-case hexadecimal notation events change and
input supported common attributes autocomplete and list idl attributes list and value methods select() value the value of an <
input> element of type color is always a domstring which contains a 7-character string specifying an rgb color in hexadecimal format.
...And 21 more matches
<input type="hidden"> - HTML: Hypertext Markup Language
<
input> elements of type hidden let web developers include data that cannot be seen or modified by users when a form is submitted.
...hidden
inputs are completely invisible in the rendered page, and there is no way to make it visible in the page's content.
... <
input id="prodid" name="prodid" type="hidden" value="xm234jq"> value a domstring representing the value of the hidden data you want to pass back to the server.
...And 21 more matches
<input type="submit"> - HTML: Hypertext Markup Language
<
input> elements of type submit are rendered as buttons.
... <
input type="submit" value="send request"> value a domstring used as the button's label events click supported common attributes type and value idl attributes value methods none value an <
input type="submit"> element's value attribute contains a domstring which is displayed as the button's label.
... <
input type="submit" value="send request"> if you don't specify a value, the button will have a default label, chosen by the user agent.
...And 19 more matches
<input type="checkbox"> - HTML: Hypertext Markup Language
<
input> elements of type checkbox are rendered by default as boxes that are checked (ticked) when activated, like you might see in an official government paper form.
... events change and
input supported common attributes checked idl attributes checked, indeterminate and value methods select() value a domstring representing the value of the checkbox.
...take the following example: <form> <div> <
input type="checkbox" id="subscribenews" name="subscribe" value="newsletter"> <label for="subscribenews">subscribe to newsletter?</label> </div> <div> <button type="submit">subscribe</button> </div> </form> in this example, we've got a name of subscribe, and a value of newsletter.
...And 17 more matches
nsIScriptableInputStream
xpcom/io/nsiscriptable
inputstream.idlscriptable this interface provides scriptable access to a nsi
inputstream instance.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview unsigned long available(); void close(); void init(in nsi
inputstream a
inputstream); string read(in unsigned long acount); acstring readbytes(in unsigned long acount); methods available() return the number of bytes currently available in the stream.
...init() wrap the given nsi
inputstream with this nsiscriptable
inputstream.
...And 13 more matches
<input type="button"> - HTML: Hypertext Markup Language
<
input> elements of type button are rendered as simple push buttons, which can be programmed to control custom functionality anywhere on a webpage as required when assigned an event handler function (typically for the click event).
... note: while <
input> elements of type button are still perfectly valid html, the newer <button> element is now the favored way to create buttons.
... value a domstring used as the button's label events click supported common attributes type, and value idl attributes value methods none value an <
input type="button"> elements' value attribute contains a domstring that is used as the button's label.
...And 13 more matches
nsIInputStream
xpcom/io/nsi
inputstream.idlscriptable this interface represents a readable stream of data.
... inherits from: nsisupports last changed in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) an
input stream may be "blocking" or "non-blocking" (see the isnonblocking() method).
... a blocking
input stream may suspend the calling thread in order to satisfy a call to close(), available(), read(), or readsegments().
...And 12 more matches
XRInputSource.targetRaySpace - Web APIs
the read-only xr
inputsource property targetrayspace returns an xrspace (typically an xrreferencespace) representing the position and orientation of the target ray in the virtual space.
...these values, interpreted in the context of the
input source's targetraymode, can be used both to fully interpret the device as an
input source.
... <<<--- needs diagram showing targetrayspace relative to gripspace and world space --->>> to obtain an xrspace representing the
input controller's position and orientation in virtual space, use the gripspace property.
...And 12 more matches
<input type="radio"> - HTML: Hypertext Markup Language
<
input> elements of type radio are generally used in radio groups—collections of radio buttons describing a set of related options.
... events change and
input supported common attributes checked and value idl attributes checked and value methods select() value the value attribute is a domstring containing the radio button's value.
... the resulting html looks like this: <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" name="contact" value="mail"> <label for="contactchoice3">mail</label> </div> <div> <button type="...
...And 11 more matches
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
the html keyboard
input element (<kbd>) represents a span of inline text denoting textual user
input from a keyboard, voice
input, or any other text entry device.
... <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.
... usage notes other elements can be used in tandem with <kbd> to represent more specific scenarios: nesting a <kbd> element within another <kbd> element represents an actual key or other unit of
input as a portion of a larger
input.
...And 11 more matches
nsIAsyncInputStream
xpcom/io/nsiasync
inputstream.idlscriptable please add a summary to this article.
... inherits from: nsi
inputstream last changed in gecko 1.7 if an
input stream is non-blocking, it may return ns_base_stream_would_block when read.
...if the stream implements nsiasync
inputstream, then the caller can use this interface to request an asynchronous notification when the stream becomes readable or closed (via the asyncwait() method).
...And 10 more matches
XRInputSource.targetRayMode - Web APIs
the read-only xr
inputsource property targetraymode indicates the method by which the target ray for the
input source should be generated and how it should be presented to the user.
... syntax let raymode = xr
inputsource.targetraymode; value a domstring taken from the xrtargetraymode enumerated type, indicating which method to use when generating and presenting the target ray to the user.
... the possible values are: gaze the user is using a gaze-tracking system (or gaze
input) which detects the direction in which the user is looking.
...And 10 more matches
XRInputSourceEvent - Web APIs
the webxr device api's xr
inputsourceevent interface describes an event which has occurred on a webxr user
input device such as a hand controller, gaze tracking system, or motion tracking system.
... more specifically, they represent a change in the state of an xr
inputsource.
... to learn more about handling
inputs in a webxr project, see the article
inputs and
input sources.
...And 10 more matches
XRInputSource - Web APIs
the webxr device api's xr
inputsource interface describes a single source of control
input which is part of the user's webxr-compatible virtual or augmented reality system.
... properties gamepad read only a gamepad object describing the state of the buttons and axes on the xr
input source, if it is a gamepad or comparable device.
... note: while xr
inputsource uses the gamepad interface from the gamepad api, this
input device is strictly associated with the webxr hardware and is not a general-purpose gaming device.
...And 9 more matches
inputmode - HTML: Hypertext Markup Language
the
inputmode global attribute is an enumerated attribute that hints at the type of data that might be entered by the user while editing the element or its contents.
...for when the page implements its own keyboard
input control.
... text (default value) standard
input keyboard for the user's current locale.
...And 9 more matches
HTMLInputElement.stepDown() - Web APIs
the html
inputelement.stepdown([n]) method decrements the value of a numeric type of <
input> element by the value of the step attribute or up to n multiples of the step attribute if a number is passed as the parameter.
... valid on all numeric, date, and time
input types that support the step attribute, includingdate, month, week, time, datetime-local, number, and range.
... given <
input id="mytime" type="time" max="17:00" step="900" value="17:00">, invoking mytime.step(3) will change the value to 16:15, decrementing the time by 3 * 900, or 45 minutes.
...And 8 more matches
InputEvent - Web APIs
the
inputevent interface represents an event notifying of editable content change.
...ht="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">uievent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#d4dde4" fill="none"/><line x1="201" y1="25" x2="231" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/
inputevent" target="_top"><rect x="231" y="1" width="100" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="281" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">
inputevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor
inputevent() cr...
...eates an
inputevent object.
...And 8 more matches
XRInputSourceArray - Web APIs
the interface xr
inputsourcearray represents a live list of webxr
input sources, and is used as the return value of the xrsession property
inputsources.
... each entry is an xr
inputsource representing one
input device connected to the webxr system.
... in addition to being able to access the
input sources in the list using standard array notation (that is, with index numbers insize square brackets), methods are available to allow the use of iterators and the foreach() method is also available.
...And 8 more matches
XRInputSourceEvent() - Web APIs
the xr
inputsourceevent() constructor creates and returns a new xr
inputsourceevent object describing an event (state change) which has occurred on a webxr user
input device represented by an xr
inputsource.
... syntax new
inputsourceevent = new xr
inputsourceevent(type, eventinitdict); parameters type a domstring indicating which of the
input source events the new object will represent.
... eventinitdict an object based on the xr
inputsourceeventinit dictionary which contains the values to assign to the new event's properties.
...And 8 more matches
User input and controls - Developer guides
modern web user
input goes beyond simple mouse and keyboard: think of touchscreens for example.
... this article provides recommendations for managing user
input and implementing controls in open web apps, along with faqs, real-world examples, and links to further information for anyone needing more detailed information on the underlying technologies.
... user
input and controls workflow the following diagram illustrates the typical workflow for implementing user
input mechanisms: first of all, you need to decide which
input mechanisms you want to cover in your application out of mouse, keyboard, finger touch and so on.
...And 8 more matches
<input type="reset"> - HTML: Hypertext Markup Language
<
input> elements of type "reset" are rendered as buttons, with a default click event handler that resets all of the
inputs in the form to their initial values.
... value a domstring used as the button's label events click supported common attributes type and value idl attributes value methods none value an <
input type="reset"> element's value attribute contains a domstring that is used as the button's label.
... <
input type="reset" value="reset the form"> if you don't specify a value, you get an button with the default label (typically "reset," but this will vary depending on the user agent): <
input type="reset"> using reset buttons <
input type="reset"> buttons are used to reset forms.
...And 8 more matches
XForms Input 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
inputmode - not supported for this control incremental - supported.
... mozilla extensions labelposition - only for boolean types: show the label before or after the checkbox (see below) type restrictions the
input element can be bound to a node containing simple content of any data type except xsd:base64binary, xsd:hexbinray or any data type derived from these.
... representations the xforms
input element can be represented by the following widgets for the spcified data types (or types derived from these data types): text field - the default widget when no type is specified or the data is of type xsd:string (xhtml/xul) checkbox - used for xsd:boolean instance data.
...And 7 more matches
XRInputSource.handedness - Web APIs
the read-only xr
inputsource property handedness indicates which of the user's hands the webxr
input source is associated with, or if it's not associated with a hand at all.
... syntax let hand = xr
inputsource.handedness; value a domstring indicating whether the
input controller is held in one of the user's hands, and if it is, which hand.
... the value, which comes from the xrhandedness enumerated type, is one of the following: none the
input controller is not associated with one of the user's hands.
...And 7 more matches
XRInputSourcesChangeEvent - Web APIs
the webxr device api interface xr
inputsourceschangeevent is used to represent the
inputsourceschange event sent to an xrsession when the set of available webxr
input controllers changes.
... constructor xr
inputsourceschangeevent() creates and returns a new xr
inputsourceschangeevent object configured as indicated by the given xr
inputsourceschangeeventinit object.
... the specified type must be
inputsourceschange, which is the only event that uses this interface.
...And 7 more matches
HTMLInputElement.setSelectionRange() - Web APIs
the html
inputelement.setselectionrange() method sets the start and end positions of the current text selection in an <
input> or <textarea> element.
... this method updates the html
inputelement.selectionstart, selectionend, and selectiondirection properties in one call.
... note that accordingly to the whatwg forms spec selectionstart, selectionend properties and setselectionrange method apply only to
inputs of types text, search, url, tel and password.
...And 6 more matches
HTMLInputElement.stepUp() - Web APIs
the html
inputelement.stepup() method increments the value of a numeric type of <
input> element by the value of the step attribute, or the default step value if the step attribute is not explicitly set.
...
input type default step value example step declaration date 1 (day) 7 day (one week) increments: <
input type="date" min="2019-12-25" step="7"> month 1 (month) 12 month (one year) increments: <
input type="month" min="2019-12" step="12"> week 1 (week) two week increments: <
input type="week" min="2019-w23" step="2"> time 60 (seconds) 900 second (15 minute) increments: <
input type="time" min="09:00" step="900"> datetime-local 1 (day) same day of the week: <
input type="datetime-local" min="019-12-25t19:30" step="7"> ...
... number 1 0.1 increments <
input type="number" min="0" step="0.1" max="10"> range 1 increments by 2: <
input type="range" min="0" step="2" max="10"> the method, when invoked, changes the form control's value by the value given in the step attribute, multiplied by the parameter, within the constraints set on the form control.
...And 6 more matches
InputDeviceCapabilities - Web APIs
the
inputdevicecapabilities interface of the
input device capabilities api provides information about the physical device or a group of related devices responsible for generating
input events.
... events caused by the same physical
input device get the same instance of this object, but the converse isn't true.
... for example, two mice with the same capabilities in a system may appear as a single
inputdevicecapabilities instance.
...And 5 more matches
XRInputSourceArray.values() - Web APIs
the xr
inputsourcearray method values() returns a javascript iterator that can walk over the list of xr
inputsource objects contained in the array, from first to last.
... syntax xr
inputsourcearray.values(); parameters none.
... return value a javascript iterator that can be used to walk through the list of xr
inputsource objects in the array, starting with the first entry (at index 0) and proceeding straight through the list.
...And 5 more matches
XRInputSourcesChangeEvent() - Web APIs
the xr
inputsourceschangeevent() constructor creates and returns a new xr
inputsourceschangeevent object, representing an update to the list of available webxr
input devices.
... syntax new
inputsourceschangeevent = new xr
inputsourceschangeevent(type, eventinitdict); parameters type a domstring indicating the type of event which has occurred.
... this string must always be
inputsourceschange.
...And 5 more matches
-moz-user-input - CSS: Cascading Style Sheets
in mozilla applications, -moz-user-
input determines if an element will accept user
input.
... /* keyword values */ -moz-user-
input: none; -moz-user-
input: enabled; -moz-user-
input: disabled; /* global values */ -moz-user-
input: inherit; -moz-user-
input: initial; -moz-user-
input: unset; for elements that normally take user
input, such as a <textarea>, the initial value of -moz-user-
input is enabled.
... note: -moz-user-
input was one of the proposals leading to the proposed css 3 user-
input property, which has not yet reached candidate recommendation (call for implementations).
...And 5 more matches
Input Controls - Archive of obsolete content
looking for a guide to using
input controls and forms on the web?
... text entry fields html has an
input element which can be used for text entry controls.
...textboxes accept many of the same attributes as html
input controls.
...And 4 more matches
JS_SetRegExpInput
set the pending regexp
input.
... syntax bool js_setregexp
input(jscontext *cx, js::handleobject obj, js::handlestring
input, bool multiline); name type description cx jscontext * the context.
...
input js::handlestring a pointer to the
input string.
...And 4 more matches
HTMLElement: input event - Web APIs
the
input event fires when the value of an <
input>, <select>, or <textarea> element has been changed.
... bubbles yes cancelable no interface
inputevent event handler property globaleventhandlers.on
input the event also applies to elements with contenteditable enabled, and to any element when designmode is turned on.
... for <
input> elements with type=checkbox or type=radio, the
input event should fire whenever a user toggles the control, per the html5 specification.
...And 4 more matches
XRInputSourceArray.entries() - Web APIs
the xr
inputsourcearray interface's entries() method returns a javascript iterator which can then be used to iterate over the key/value pairs in the
input source array.
... each item in the array is an xr
inputsource object.
... syntax let
inputsourceiterator = xr
inputsourcearray.entries(); for (let entry of xr
inputsourcearray.entries()) { /* ...
...And 4 more matches
XRInputSourceArray.forEach() - Web APIs
the xr
inputsourcearray method foreach() executes the specified callback once for each
input source in the array, starting at index 0 and progressing until the end of the list.
... syntax xr
inputsourcearray.foreach(callback, thisarg); parameters callback a function to execute once for each entry in the array xr
inputsourcearray.
... the callback accepts up to three parameters: currentvalue a xr
inputsource object which is the value of the item from within the xr
inputsourcearray which is currently being processed.
...And 4 more matches
XRInputSourceArray.keys() - Web APIs
the keys() method in the xr
inputsourcearray interface returns a javascript iterator which can then be used to iterate over the keys used to reference each item in the array of
input sources.
... syntax xr
inputsourcearray.keys(); parameters none.
... return value a javascript iterator that can be used to walk through the keys for each entry in the list of
input sources.
...And 4 more matches
XRSession.inputSources - Web APIs
the read-only
inputsources property of the xrsession interface returns an xr
inputsourcearray object which lists all controllers and
input devices which are expressly associated with the xr device and are currently available.
... these controllers may include handheld controllers, xr-equipped gloves, optically tracked hands, and gaze-based
input methods.
... keyboards, gamepads, and mice are not considered webxr
input sources.
...And 4 more matches
nsIMIMEInputStream
netwerk/base/public/nsimime
inputstream.idlscriptable the mime stream separates headers and a datastream.
... inherits from: nsi
inputstream last changed in gecko 1.3 implemented by: @mozilla.org/network/mime-
input-stream;1.
... to create an instance, use: var mime
inputstream = components.classes["@mozilla.org/network/mime-
input-stream;1"] .createinstance(components.interfaces.nsimime
inputstream); method overview void addheader(in string name, in string value); void setdata(in nsi
inputstream stream); attributes attribute type description addcontentlength boolean when true a "content-length" header is automatically added to the stream.
...And 3 more matches
nsITextInputProcessorCallback
dom/interfaces/base/nsitext
inputprocessor.idlscriptable a callback interface for nsitext
inputprocessor user 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) nsitext
inputprocessorcallback is defined for receiving requests and notifications to ime from gecko.
...s._hasfocus = false; break; case "notify-detached": this._hasfocus = false; this._hasrightstocompose = false; break; } return true; } catch (e) { return false; } }, setcomposition: function simpleime_setcomposition(atext, aclauses, acaret) { if (!this._tip) { this._tip = components.classes["@mozilla.org/text-
input-processor;1"].
... createinstance(components.interfaces.nsitext
inputprocessor); } if (!this._tip.begin
inputtransaction(window, this._callback)) { return false; } ...
...And 3 more matches
GlobalEventHandlers.oninput - Web APIs
the on
input property of the globaleventhandlers mixin is an eventhandler that processes
input events on the <
input>, <select>, and <textarea> elements.
... note: unlike on
input, the onchange event handler is not necessarily called for each alteration to an element's value.
... syntax target.on
input = functionref; value functionref is a function name or a function expression.
...And 3 more matches
validityState.badInput - Web APIs
the read-only bad
input property of a validitystate object indicates if the user has provided
input that the browser is unable to convert.
... for example, if you have a number
input element whose content is a string.
... note: while this is unsupported in internet explorer, any non-numeric value will be dismissed from the field if it is a number
input.
...And 3 more matches
XRInputSource.gripSpace - Web APIs
the read-only xr
inputsource property gripspace returns an xrspace whose native origin tracks the pose used to render virtual objects so they appear to be held in (or part of) the user's hand.
... syntax var xrspace = xr
inputsource.gripspace; value an xrspace object representing the position and orientation of the
input device in virtual space, suitable for rendering an image of the device into the scene.
... gripspace is null if the
input source is inherently untrackable.
...And 3 more matches
XRInputSource.profiles - Web APIs
the read-only xr
inputsource property profiles returns an array of strings, each describing a configuration profile for the
input source.
... syntax let profilelist = xr
inputsource.profiles; value an array of domstring objects, each describing one configuration profile for the
input device represented by the xr
inputsource object.
... each
input profile specifies the preferred visual representation and behavior of the
input source.
...And 3 more matches
XRSession.oninputsourceschange - Web APIs
the on
inputsourcechange attribute of the xrsession object is the event handler for the
inputsourcechange event, which is dispatched when session's list of active xr
input sources has changed.
... the list itself is accessible via xrsession.
inputsources.
... note: the xr
inputsource objects in xrsession.
inputsources array are "live", so values within them are updated in-place.
...And 3 more matches
nsIBinaryInputStream
xpcom/io/nsibinary
inputstream.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 nsibinaryoutputstream.
... inherits from: nsi
inputstream last changed in gecko 1.7 method overview pruint8 read8(); pruint16 read16(); pruint32 read32(); pruint64 read64(); unsigned long readarraybuffer(in pruint32 alength, in jsval aarraybuffer); prbool readboolean(); void readbytearray(in pruint32 alength, [array, size_is(alength), retval] out pruint8 abytes); void readbytes(in pruint32 alength, [size_is(alength), retval] out string astring); acstring readcstring(); double readdouble(); float readfloat(); a...
...string readstring(); void set
inputstream(in nsi
inputstream a
inputstream); methods read8() reads from the stream.
...And 2 more matches
nsITextInputProcessorNotification
dom/interfaces/base/nsitext
inputprocessorcallback.idlscriptable this interface of a request or notification to ime 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) this interface tells details of a request or notification to ime.
...so, nsitext
inputprocessorcallback won't be changed for keeping backward compatibility.
... when this is requested, the callback should commit composition synchronously, i.e., nsitext
inputprocessor.commitcomposition() should be called.
...And 2 more matches
The JavaScript input interpreter - Firefox Developer Tools
the expression you type is echoed under the
input prompt, followed by the result.
... if your
input does not appear to be complete when you press enter, then the console treats this as shift+enter , enabling you to finish your
input.
... for example, if you type: function foo() { and then enter, the console does not immediately execute the
input, but behaves as if you had pressed shift+enter , so you can finish entering the function definition.
...And 2 more matches
HTMLInputElement: search event - Web APIs
the search event is fired when a search is initiated usinng an <
input> element of type="search".
... bubbles yes cancelable no interface event event handler property onsearch there are several ways a search can be initiated, such as by pressing enter while the <
input> is focused, or, if the incremental attribute is present, after a ua-defined timeout elapses since the most recent keystroke (with new keystrokes resetting the timeout so the firing of the event is debounced).
... current ua implementations of <
input type="search"> have an additional control to clear the field.
...And 2 more matches
HTMLInputElement.webkitEntries - Web APIs
the read-only webkitentries property of the html
inputelement interface contains an array of file system entries (as objects based on filesystementry) representing files and/or directories selected by the user using an <
input> element of type file, but only if that selection was made using drag-and-drop: selecting a file in the dialog will leave the property empty (bug 1326031).
...this means the <
input> element was configured to let the user choose directories.
... syntax var entries = html
inputelement.webkitentries; value an array of objects based on filesystementry, each representing one file which is selected in the <
input> element.
...And 2 more matches
InputDeviceCapabilities API - Web APIs
the
inputdevicecapabilities api provides details about the underlying sources of
input events.
...
input device capabilities concepts and usage because dom events abstract device
input, they provide no way to learn what device or type of device fired an event.
... the
inputdevicecapabilities api addresses this problem by abstracting the capabilities of
input devices.
...And 2 more matches
InputEvent() - Web APIs
the
inputevent() constructor creates a new
inputevent.
... syntax event = new
inputevent(typearg,
inputeventinit); values typearg is a domstring representing the name of the event.
...
inputeventinitoptional is a
inputeventinit dictionary, having the following fields:
inputtype: (optional) a string specifying the type of change for editible content such as, for example, inserting, deleting, or formatting text.
...And 2 more matches
XRInputSourceArray.length - Web APIs
the read-only length property returns an integer value indicating the number of items in the
input source list represented by the xr
inputsourcearray object.
... syntax let
inputsourcecount = xr
inputsourcearray.length; value an integer value indicating the number of xr
inputsource objects representing webxr
input sources are includled in the array.
... examples in this example, a game that requires at least one
input source uses length to check this before proceeding to allow the user to play the game.
...And 2 more matches
RegExp.input ($_) - JavaScript
the non-standard
input property is a static property of regular expressions that contains the string against which a regular expression is matched.
... description the
input property is static, it is not a property of an individual regular expression object.
... instead, you always use it as regexp.
input or regexp.$_.
...And 2 more matches
nsScriptableInputStream
« xpcom api reference summary a component implementing nsiscriptable
inputstream.
... class id 7225c040-a9bf-11d3-a197-0050041caf44 contractid @mozilla.org/scriptable
inputstream;1 supported interfaces nsiscriptable
inputstream, nsi
inputstream remarks this component should be accessed via the xpcom component manager.
... example code const nsiscriptable
inputstream = components.interfaces.nsiscriptable
inputstream; function consumestream(
inputstream) { var factory = components.classes["@mozilla.org/scriptable
inputstream;1"]; var sis = factory.createinstance(nsiscriptable
inputstream); sis.init(
inputstream); try { while (true) { var chunk = sis.read(512); if (chunk.length == 0) break; // ok, chunk now contains a portion of the stream's data.
... } } catch (e) { dump("error: failed reading from stream:\n" + e + "\n"); } } see also nsiscriptable
inputstream ...
nsIConverterInputStream
xpcom/io/nsiconverter
inputstream.idlscriptable a unichar
input stream that wraps an
input stream.
... 1.0 66 introduced gecko 1.8 inherits from: nsiunichar
inputstream last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/intl/converter-
input-stream;1.
... to create an instance, use: var converter
inputstream = components.classes["@mozilla.org/intl/converter-
input-stream;1"] .createinstance(components.interfaces.nsiconverter
inputstream); method overview void init(in nsi
inputstream astream, in string acharset, in long abuffersize, in prunichar areplacementchar); constants constant value description default_replacement_character 0xfffd default replacement character value.
...void init( in nsi
inputstream astream, in string acharset, in long abuffersize, in prunichar areplacementchar ); parameters astream the source stream which is read and converted.
nsIInputStreamCallback
xpcom/io/nsiasync
inputstream.idlscriptable this is a companion interface for nsiasync
inputstream.asyncwait().
... inherits from: nsisupports last changed in gecko 1.7 method overview void on
inputstreamready(in nsiasync
inputstream astream); methods on
inputstreamready() called to indicate that the stream is either readable or closed.
... void on
inputstreamready( in nsiasync
inputstream astream ); parameters astream the stream whose nsiasync
inputstream.asyncwait() method was called.
... see also nsiasync
inputstream.asyncwait() ...
AudioNode.numberOfInputs - Web APIs
the numberof
inputs property of the audionode interface returns the number of
inputs feeding the node.
... source nodes are defined as nodes having a numberof
inputs property with a value of 0.
... syntax var num
inputs = audionode.numberof
inputs; 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
inputs); // 0 console.log(gainnode.numberof
inputs); // 1 console.log(audioctx.destination.numberof
inputs); // 1 specifications specification status comment web audio apithe definition of 'numberof
inputs' in that specification.
HTMLInputElement.select() - Web APIs
the html
inputelement.select() method selects all the text in a <textarea> element or in an <
input> element that includes a text field.
... syntax element.select(); example click the button in this example to select all the text in the <
input> element.
... html <
input type="text" id="text-box" size="20" value="hello world!"> <button onclick="selecttext()">select text</button> javascript function selecttext() { const
input = document.getelementbyid('text-box');
input.focus();
input.select(); } result notes calling element.select() will not necessarily focus the
input, so it is often used with htmlelement.focus().
... in browsers where it is not supported, it is possible to replace it with a call to html
inputelement.setselectionrange() with parameters 0 and the
input's value length: <
input onclick="this.select();" value="sample text" /> <!-- equivalent to --> <
input onclick="this.setselectionrange(0, this.value.length);" value="sample text" /> specifications specification status comment html living standardthe definition of 'select' in that specification.
HTMLInputElement.setRangeText() - Web APIs
the html
inputelement.setrangetext() method replaces a range of text in an <
input> or <textarea> element with a new string.
... html <
input type="text" id="text-box" size="30" value="this text has not been updated."> <button onclick="selecttext()">update text</button> javascript function selecttext() { const
input = document.getelementbyid('text-box');
input.focus();
input.setrangetext('already', 14, 17, 'select'); } result specifications specification status comment html living standardthe d...
...efinition of 'html
inputelement.setselectionrange()' in that specification.
... living standard no change html5the definition of 'html
inputelement.setselectionrange()' in that specification.
InputDeviceCapabilities - Web APIs
the
inputdevicecapabilities() constructor creates a new
inputdevicecapabilities object provides information about the physical device responsible for generating a touch event.
... syntax var
inputdevicecapabilities = new
inputdevicecapabilities([
inputdevicecapabilitiesinit]) returns an instance of the
inputdevicecapabilities interface.
... parameters
inputdevicecapabilitiesinit optional a dictionary object containing a set of device capabilities.
... specifications specification status comment
inputdevicecapabilities draft initial definition.
InputEvent.data - Web APIs
the data read-only property of the
inputevent interface returns a domstring with the inserted characters.
... syntax var astring =
inputevent.data; value a domstring.
... examples in the following simple example we've set up an event listener on the
input event so that when any change is made to the contents of the <
input> element (either by typing or pasting), the text that was added is retrieved via the
inputevent.data property and reported in the paragraph below the
input.
... <p>some text to copy and paste.</p> <
input type="text"> <p class="result"></p> var editable = document.queryselector('
input') var result = document.queryselector('.result'); editable.addeventlistener('
input', (e) => { result.textcontent = "
inputted text: " + e.data; }); specifications specification status comment
input events level 2the definition of 'data' in that specification.
InputEvent.dataTransfer - Web APIs
the datatransfer read-only property of the
inputevent interface returns a datatransfer object containing information about richtext or plaintext data being added to or removed from editible content.
... syntax var datatransfer =
inputevent.datatransfer value a datatransfer object.
... examples in the following simple example we've set up an event listener on the
input event so that when any content is pasted into the contenteditable <p> element, its html source is retrieved via the
inputevent.datatransfer.getdata() method and reported in the paragraph below the
input.
...nt-style: italic; color: red">exciting: italic red text!</span></p> <p>boring normal text ;-(</p> <hr> <p contenteditable="true">go on, try pasting some content into this editable paragraph and see what happens!</p> <p class="result"></p> var editable = document.queryselector('p[contenteditable]'); var result = document.queryselector('.result') var datatransferobj; editable.addeventlistener('
input', (e) => { result.textcontent = e.datatransfer.getdata('text/html'); }); specifications specification status comment
input events level 2the definition of 'datatransfer' in that specification.
XRInputSourceEvent.frame - Web APIs
the read-only xr
inputsourceevent property frame specifies an xrframe object representing the event frame during which a webxr user
input occurred.
... syntax let
inputframe = xr
inputsourceevent.frame; value an xrframe indicating the event frame at which the user
input event described by the object took place.
... examples this code shows a handler for the selectstart event which gets the target ray's pose from the frame, mapping the pose representing the ray (event.
inputsource.targetrayspace) to the overall reference space myrefspace.
... xrsession.onselectstart = event => { let targetraypose = event.frame.getpose(event.
inputsource.targetrayspace, myrefspace); if (targetraypose) { checkandhandlehit(targetraypose.transform); } }; specifications specification status comment webxr device apithe definition of 'xr
inputsourceevent.frame' in that specification.
XRInputSourceEventInit.frame - Web APIs
the xr
inputsourceeventinit dictionary's property frame specifies an xrframe providing information about the timestamp at which the new
input source event took place, as well as access to the xrframe method getpose() which can be used to map the coordinates of any xrreferencespace to the space in which the event took place.
... of course, as a general rule, you won't need to create xr
inputsourceeventinit objects yourself.
... syntax xr
inputsourceeventinit.frame = xrframe; let xr
inputsourceeventinit = { frame: xrframe }; let xr
inputsourceevent = new xr
inputsourceevent(type, { frame: xrframe }); value an xrframe indicating the time at which the event took place, and providing a getpose() method which can be used to map reference spaces to the world reference space.
... let event = new xr
inputsourceevent("select", { frame: eventframe,
inputsource: source }; if (event) { xrsession.dispatchevent(event); } specifications specification status comment webxr device apithe definition of 'xr
inputsourceeventinit.frame' in that specification.
XRInputSourceEventInit - Web APIs
the xr
inputsourceeventinit dictionary is used when calling the xr
inputsourceevent() constructor to provide configuration options for the newly-created xr
inputsourceevent object to take on.
... properties the xr
inputsourceeventinit dictionary inherits properties from the eventinit dictionary.
...
inputsource an xr
inputsource object representing the
input device from which the event is being sent.
... specifications specification status comment webxr device apithe definition of 'xr
inputsourceeventinit' in that specification.
XRInputSourcesChangeEvent.added - Web APIs
the read-only xr
inputsourceschangeevent property added is a list of zero or more
input sources, each identified using an xr
inputsource object, which have been newly made available for use.
... syntax let added
inputs = xr
inputsourceschangeevent.added; value an array of zero or more xr
inputsource objects, each representing one
input device added to the xr system.
... examples the example below creates a handler for the
inputsourceschange event that processes the lists of added and removed from the webxr system.
... xrsession.on
inputsourcescchange = event => { for (let
input of event.added) { if (
input.targetraymode == "tracked-pointer") { addedpointerdevice(
input); } } for (let
input of event.removed) { if (
input.targetraymode == "tracked-pointer") { removedpointerdevice(
input); } } }; specifications specification status comment webxr device apithe definition of 'xr
inputsourceschangeevent.added' in that specification.
XRInputSourcesChangeEvent.removed - Web APIs
the read-only xr
inputsourceschangeevent property removed is an array of zero or more xr
inputsource objects representing the
input sources which have been removed from the xrsession.
... syntax removed
inputs = xr
inputsourceschangeevent.removed; value an array of zero or more xr
inputsource objects, each representing one
input device removed from the xr system.
... examples the example below creates a handler for the
inputsourceschange event that processes the lists of added and removed from the webxr system.
... xrsession.on
inputsourcescchange = event => { for (let
input of event.added) { if (
input.targetraymode == "tracked-pointer") { addedpointerdevice(
input); } } for (let
input of event.removed) { if (
input.targetraymode == "tracked-pointer") { removedpointerdevice(
input); } } }; specifications specification status comment webxr device apithe definition of 'xr
inputsourceschangeevent.removed' in that specification.
XRInputSourcesChangeEventInit - Web APIs
the xr
inputsourceschangeeventinit dictionary is used to provide options to the xr
inputsourceschangeevent() constructor in order to set the initial state of the new xr
inputsourceschangeevent object.
... properties added read only an array of zero or more xr
inputsource objects, each representing one
input device which is newly available to use.
... removed read only an array of zero or more xr
inputsource objects representing the
input devices which are no longer available.
... examples <tbd> specifications specification status comment webxr device apithe definition of 'xr
inputsourceschangeeventinit' in that specification.
XRSession: inputsourceschange event - Web APIs
the
inputsourceschange event is sent to an xrsession when the set of available webxr
input devices changes.
... the received event, of type xr
inputsourceschangeevent, contains a list of any newly added and/or removed
input devices.
... bubbles yes cancelable no interface xr
inputsourceschangeevent event handler property on
inputsourceschange the event object contains lists of the newly-added and/or removed
input devices in its added and removed properties.
... examples specifications specification status comment webxr device apithe definition of '
inputsourceschange event' in that specification.
HTMLElement: beforeinput event - Web APIs
the dom before
input event fires when the value of an <
input>, <select>, or <textarea> element is about to be modified.
... bubbles yes cancelable yes interface
inputevent event handler property none sync / async sync composed yes default action update the dom element examples this example logs current value of the element immediately before replacing that value with the new one applied to the <
input> element.
... html <
input placeholder="enter some text" name="name"/> <p id="values"></p> javascript const
input = document.queryselector('
input'); const log = document.getelementbyid('values');
input.addeventlistener('before
input', updatevalue); function updatevalue(e) { log.textcontent = e.target.value; } result specifications specification status ui eventsthe definition of 'before
input event' in that specification.
HTMLInputElement.labels - Web APIs
the html
inputelement.labels read-only property returns a nodelist of the <label> elements associated with the <
input> element.
... syntax var labelelements =
input.labels; return value a nodelist containing the <label> elements associated with the <
input> element.
... example html <label id="label1" for="test">label 1</label> <
input id="test"/> <label id="label2" for="test">label 2</label> javascript window.addeventlistener("domcontentloaded", function() { const
input = document.getelementbyid("test"); for(var i = 0; i <
input.labels.length; i++) { console.log(
input.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html living standardthe definition of 'labels' in that specification.
HTMLInputElement.mozGetFileNameArray() - Web APIs
the html
inputelement.mozgetfilenamearray() method returns an array of the names of the files that were selected by the user on an html
input element.
... syntax
inputelement.mozgetfilenamearray(alength, afilenames); parameters alength if specified, will receive the number of file names in the returned array.
... example var numfiles = 0; var filearray = {};
inputelement.mozgetfilenamearray(numfiles, filearray); ...
HTMLInputElement.mozSetFileNameArray() - Web APIs
the html
inputelement.mozsetfilenamearray() method sets the names of the files that selected on an html
input element.
... syntax
inputelement.mozsetfilenamearray(afilenames, alength); parameters afilenames is the array of file names to apply to the element.
... example var filearray = {"/foo/bar.txt", "/foo/foosball.txt"};
inputelement.mozsetfilenamearray(filearray, filearray.length); ...
HTMLInputElement.multiple - Web APIs
the html
inputelement.multiple property indicates if an
input can have more than one value.
... firefox currently only supports multiple for <
input type="file">.
... example // file
input is a <
input type=file multiple> let file
input = document.getelementbyid('myfile
input'); if (file
input.multiple == true) { for (let i = 0; i < file
input.files.length; i++) { // loop file
input.files } // only one file available } else { let file = file
input.files.item(0); } ...
HTMLInputElement.webkitdirectory - Web APIs
the html
inputelement.webkitdirectory is a property that reflects the webkitdirectory html attribute and indicates that the <
input> element should let the user select directories instead of files.
... syntax html
inputelement.webkitdirectory = boolvalue value a boolean; true if the <
input> element should allow picking only directories or false if only files should be selectable.
... 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].
InputEvent.getTargetRanges() - Web APIs
the gettargetranges() property of the
inputevent interface returns an array of static ranges that will be affected by a change to the dom if the
input event is not canceled.
... syntax var staticranges[] =
inputevent.gettargetranges() parameters none.
... specifications specification status comment
input events level 2the definition of 'gettargetranges()' in that specification.
MouseEvent.mozInputSource - Web APIs
the mouseevent.moz
inputsource read-only property on mouseevent provides information indicating the type of device that generated the event.
... syntax var source = instanceofmouseevent.moz
inputsource; return value the following values are possible.
... constant name value desription moz_source_unknown 0 the
input device is unknown.
XRInputSourcesChangeEvent.session - Web APIs
the xr
inputsourceschangeevent property session specifies the xrsession to which the
input source list change event applies.
... syntax let
inputssession = xr
inputsourceschangeevent.session; value an xrsession indicating the webxr session to which the
input source list change applies.
... specifications specification status comment webxr device apithe definition of 'xr
inputsourceschangeevent.session' in that specification.
XRInputSourcesChangeEventInit.added - Web APIs
the xr
inputsourceschangeeventinit property added specifies a list of
input sources, each identified using an xr
inputsource object, which the represented
inputsourceschange event is to indicate are newly available for use.
... syntax let
inputsourceseventinit = { session: xrsession, added: [newdevice1, ..., newdevicen], removed: [removeddevice1, ..., newdevicen], }; my
inputsourceschangeevent = new xr
inputsourceschangeeventinit("
inputsourceschange",
inputsourceseventinit); my
inputsourceschangeevent = new xr
inputsourceschangeeventinit("
inputsourceschange", { session: xrsession, added: addeddevicelist, removed: removeddevicelist }); value an array of zero or more xr
inputsource objects, each representing one
input device added to the xr system.
... specifications specification status comment webxr device apithe definition of 'xr
inputsourceschangeeventinit.added' in that specification.
XRInputSourcesChangeEventInit.removed - Web APIs
the xr
inputsourceschangeeventinit property removed is an array of zero or more xr
inputsource objects, each representing one
input source which has been removed from the xrsession.
... syntax let
inputsourceseventinit = { session: xrsession, added: [newdevice1, ..., newdevicen], removed: [removeddevice1, ..., newdevicen], }; my
inputsourceschangeevent = new xr
inputsourceschangeeventinit("
inputsourceschange",
inputsourceseventinit); my
inputsourceschangeevent = new xr
inputsourceschangeeventinit("
inputsourceschange", { session: xrsession, added: addeddevicelist, removed: removeddevicelist }); value an array of zero or more xr
inputsource objects, each representing one
input device removed from the xr system.
... specifications specification status comment webxr device apithe definition of 'xr
inputsourceschangeeventinit.removed' in that specification.
XRInputSourcesChangeEventInit.session - Web APIs
the xr
inputsourceschangeeventinit property session specifies the xrsession to which the
input source list change event applies.
... syntax let
inputsourceseventinit = { session: xrsession, added: [newdevice1, ..., newdevicen], removed: [removeddevice1, ..., newdevicen], }; my
inputsourceschangeevent = new xr
inputsourceschangeeventinit("
inputsourceschange",
inputsourceseventinit); my
inputsourceschangeevent = new xr
inputsourceschangeeventinit("
inputsourceschange", { session: xrsession, added: addeddevicelist, removed: removeddevicelist }); value an xrsession indicating the webxr session to which the
input source list change applies.
... specifications specification status comment webxr device apithe definition of 'xr
inputsourceschangeeventinit.session' in that specification.
<input type="datetime"> - HTML: Hypertext Markup Language
the html <
input type="datetime"> was a control for entering a date and time (hour, minute, second, and fraction of a second) as well as a timezone.
... instead, browsers are implementing (and developers are encouraged to use) <
input type="datetime-local">.
... the format of the date and time value used by this
input type is described in format of a valid global date and time string in date and time formats used in html.
oninput - Archive of obsolete content
« xul reference home on
input type: script code this event is sent when a user enters text in a textbox.
...--> <script language="javascript"> function setlabel(txtbox){ document.getelementbyid('lbl').value = txtbox.value; } </script> <label id="lbl"/> <textbox on
input="setlabel(this);"/> this is similar to the onkeypress event used in html documents.
inputField - Archive of obsolete content
« xul reference
inputfield type: textbox element in mozilla, the xul textbox is implemented as a wrapper around an html
input element.
... this read only property holds a reference to this inner
input element.
Input method editor - MDN Web Docs Glossary: Definitions of Web-related terms
an
input method editor (ime) is a program that provides a specialized user interface for text
input.
...
input method editors are used in many situations: to enter chinese, japanese, or korean text using a latin keyboard to enter latin text using a numeric keypad to enter text on a touch screen using handwriting recognition ...
nsIFileInputStream
netwerk/base/nsifilestreams.idlscriptable an
input stream that allows you to read from a file.
... inherits from: nsi
inputstream last changed in gecko 1.7 method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constant value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed.
HTMLInputElement: invalid event - Web APIs
in this example, when an invalid event fires because of an invalid value in the
input, the invalid value is logged.
... html <form action="#"> <ul> <li><label>enter an integer between 1 and 10: <
input type="number" min="1" max="10" required></label></li> <li><
input type="submit" value="submit"></li> </ul> </form><p id="log"></p> javascript const
input = document.queryselector('
input') const log = document.getelementbyid('log')
input.addeventlistener('invalid', logvalue) function logvalue(e) { log.textcontent += e.target.value } result specifications specification status comment html living standardthe definition of 'invalid event' in that specification.
InputEvent.isComposing - Web APIs
the
inputevent.iscomposing read-only property returns a boolean value indicating if the event is fired after compositionstart and before compositionend.
... syntax var bool = event.iscomposing; example var
inputevent = new
inputevent('synthetic
input', false); console.log(
inputevent.iscomposing); // return false specifications specification status comment document object model (dom) level 3 events specificationthe definition of '
inputevent.iscomposing' in that specification.
MIDIInput - Web APIs
use the midi
input interface of the web midi api to access and pass messages to a midi
input port.
... event handlers midi
input.onmidimessage when the current port receives a midimessage it triggers a call to this event handler.
nsIAutoCompleteInput
toolkit/components/autocomplete/public/nsiautocomplete
input.idlscriptable this interface monitors the
input in a text field and displays an autocomplete panel at the appropriate time.
MIDIInputMap - Web APIs
the midi
inputmap read-only interface of the web midi api provides a map-like interface to the currently available midi
input 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.
... 140 audiodestinationnode api, audiodestinationnode, interface, reference, web audio api audiodestinationnode has no output (as it is the output, no more audionode can be linked after it in the audio graph) and one
input.
... the number of channels in the
input must be between 0 and the maxchannelcount value or an exception is raised.
...And 142 more matches
UI pseudo-classes - Learn web development
an <
input type="checkbox"> with the checked attribute set, or an <option> element with the selected attribute set).
... styling
inputs based on whether they are required or not one of the most basic concepts with regards to client-side form validation is whether a form
input is required (it has to be filled in before the form can be submitted) or optional.
... <
input>, <select>, and <textarea> elements have a required attribute available which, when set, means that you have to fill in that control before the form will successfully submit.
...And 47 more matches
Client-side form validation - Learn web development
even if your form is validating correctly and preventing malformed
input on the client-side, a malicious user can still alter the network request.
... minlength and maxlength: specifies the minimum and maximum length of textual data (strings) min and max: specifies the minimum and maximum values of numerical
input types type: specifies whether the data needs to be a number, an email address, or some other specific preset type.
... note: there are several errors that will prevent the form from being submitted, including a bad
input, patternmismatch, rangeoverflow or rangeunderflow, stepmismatch, toolong or tooshort, typemismatch, valuemissing, or a customerror.
...And 46 more matches
HTML documentation index - HTML: Hypertext Markup Language
6 date and time formats used in html date, element, format, html, iso 8601,
input, reference, string, time, week, datetime, datetime-local, del, ins, month, month-year, week-year certain html elements use date and/or time values.
... 9 autocapitalize autocapitalize, global attributes, html, reference the autocapitalize global attribute is an enumerated attribute that controls whether and how text
input is automatically capitalized as it is entered/edited by the user.
... 11 contenteditable editing, global attributes, html, reference, text editing, contenteditable, text entry, text
input the contenteditable global attribute is an enumerated attribute indicating if the element should be editable by the user.
...And 43 more matches
IME handling guide
introduction ime is an abbreviation of
input method editor.
... ime is a helper application of a user's text
input.
...preedit string), suggests a list of what the user attempts to
input, commits composition string as a selected item off the list and commits composition string without any conversion.
...And 42 more matches
XPCOM Stream Guide
if we think of the water as data, then the spout represents an
input stream: a controller for data coming out of something.
...we even have streams that take
input from other streams and transform the data within them to something more useful.
... each of these implements nsi
inputstream.
...And 37 more matches
Basic native form controls - Learn web development
you've already met some form elements, including <form>, <fieldset>, <legend>, <textarea>, <label>, <button>, and <
input>.
... this article covers: the common
input types button, checkbox, file, hidden, image, password, radio, reset, submit, and text.
...if you want a more advanced reference, you should consult our html forms element reference, and in particular our extensive <
input> types reference.
...And 36 more matches
StringView - Archive of obsolete content
|*| http://www.gnu.org/licenses/lgpl-3.0.html |*| \*/ function stringview (v
input, sencoding /* optional (default: utf-8) */, noffset /* optional */, nlength /* optional */) { var ftaview, awhole, araw, fputoutptcode, fgetoutptchrsize, ninptlen, nstartidx = isfinite(noffset) ?
...ringview.pututf16charcode; fgetoutptchrsize = stringview.getutf16charlength; ftaview = uint16array; break encswitch; case "utf-32": ftaview = uint32array; ntranscrtype &= 14; break encswitch; default: /* case "ascii", or case "binarystring" or unknown cases */ ftaview = uint8array; ntranscrtype &= 14; } typeswitch: switch (typeof v
input) { case "string": /* the
input argument is a primitive string: a new buffer will be created.
... */ ntranscrtype &= 7; break typeswitch; case "object": classswitch: switch (v
input.constructor) { case stringview: /* the
input argument is a stringview: a new buffer will be created.
...And 33 more matches
Border-image generator - CSS: Cascading Style Sheets
9/b9fff72dab.png" data-stateid="border5"/> <img class="image" src="https://udn.realityripple.com/samples/fb/c0b285d3da.svg" data-stateid="border6"/> </div> </div> <div id="load-actions" class="group section"> <div id="toggle-gallery" data-action="hide"> </div> <div id="load-image" class="button"> upload image </div> <
input id="remote-url" type="text" placeholder="load an image from url"/> <div id="load-remote" class="button"> </div> </div> <div id="general-controls" class="group section"> <div class="name"> control box </div> <div class="separator"></div> <div class="property"> <div class="name">scale</div> <div class="...
...ui-
input-slider" data-topic="scale" data-unit="%" data-max="300" data-sensivity="10"> </div> </div> <div class="separator"></div> <div class="property"> <div class="name">draggable</div> <div class="ui-checkbox" data-topic='drag-subject'></div> </div> <div class="property right"> <div class="name">section height</div> <div class="ui-
input-slider" data-topic="preview-area-height" data-min="400" data-max="1000"> </div> </div> </div> <div id="preview_section" class="group section"> <div id="subject"> <div class="guideline" data-axis="y" data-topic="...
... <div class="ui-dropdown border-repeat" data-topic="image-repeat-y" data-selected="2"> <div data-value="1">repeat</div> <div data-value="1">stretch</div> <div data-value="1">round</div> </div> </div> <div class="property"> <div class="ui-
input-slider" data-topic="font-size" data-info="em size" data-unit="px" data-value="12" data-sensivity="3"> </div> </div> <div class="property"> <div class="ui-
input-slider" data-topic="preview-width" data-info="width" data-unit=" px" data-min="10" data-max="10000" data-sensivity="3...
...And 33 more matches
HTML attribute reference - HTML: Hypertext Markup Language
attribute list attribute name elements description accept <form>, <
input> list of types the server accepts, typically a file type.
... alt <applet>, <area>, <img>, <
input> alternative text in case an image can't be displayed.
... autocapitalize global attribute sets whether
input is automatically capitalized when entered by user autocomplete <form>, <
input>, <select>, <textarea> indicates whether controls in this form can by default have their values automatically completed by the browser.
...And 33 more matches
Advanced form styling - Learn web development
to recap what we said in the previous article, we have: 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"> the ugly: some elements can't be styled thoroughly using css.
... <
input type="color"> date-related controls such as <
input type="datetime-local"> <
input type="range"> <
input type="file"> <progress> and <meter> let's first talk about the appearance property, which is pretty useful for making all of the above more stylable.
... for example, let's take the following controls: <form> <p> <label for="search">search: </label> <
input id="search" name="search" type="search"> </p> <p> <label for="text">text: </label> <
input id="text" name="text" type="text"> </p> <p> <label for="date">date: </label> <
input id="date" name="date" type="datetime-local"> </p> <p> <label for="radio">radio: </label> <
input id="radio" name="radio" type="radio"> </p> <p> <label for="checkbox">checkbox: </labe...
...And 28 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
newtodo: displays the <
input> field and add button for adding a new todo.
... if you click on the
input at the top of our app, you'll see a thick, dashed outline around that
input.
... we'd also like to add some usability features, like disabling the save button when required fields are empty, giving focus to certain html elements or auto-selecting contents when a text
input receives focus.
...And 28 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.
... each
input or output is composed of one or more audio channels, which together represent a specific audio layout.
...le below: mono 0: m: mono stereo 0: l: left 1: r: right quad 0: l: left 1: r: right 2: sl: surround left 3: sr: surround right 5.1 0: l: left 1: r: right 2: c: center 3: lfe: subwoofer 4: sl: surround left 5: sr: surround right up-mixing and down-mixing when the number of channels doesn't match between an
input and an output, up- or down-mixing happens according the following rules.
...And 28 more matches
Key Values - Web APIs
toggles the capital character lock on and off for subsequent
input.
...allows issuing special command
inputs.
...removes the currently selected
input.
...And 26 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 25 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
linear-gradient generator html content <div id="container"> <div id="gradient-container" data-alpha="true"> </div> <div id="controls"> <div class="section"> <div class="title"> active point </div> <div class="property"> <div class="ui-
input-slider" data-topic="point-position" data-info="position" data-unit="px" data-min="-1000" data-value="0" data-max="1000" data-sensivity="5"></div> <div id="delete-point" class="button"> delete point </div> </div> <div class="ui-color-picker" data-topic="picker"></div> </div> <div class="section"> <div class="title"> active axis </div> ...
...); background: -o-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); } .ui-color-picker .alpha { border: 1px solid #ccc; background: url("images/alpha_mask.png"); } .ui-color-picker .slider-picker { width: 2px; height: 100%; margin: 0 0 0 -2px; border: 1px solid #777; background-color: #fff; position: relative; top: -1px; } /*
input hsv and rgb */ .ui-color-picker .info { width: 200px; margin: 5px; float: left; } .ui-color-picker .info * { float: left; } .ui-color-picker .
input { width: 64px; margin: 5px 2px; float: left; } .ui-color-picker .
input .name { height: 20px; width: 30px; text-align: center; font-size: 14px; line-height: 18px; float: left; } .ui-color-picker .
input input { width: 30px; height: 1...
...8px; margin: 0; padding: 0; border: 1px solid #ddd; text-align: center; float: right; -moz-user-select: text; -webkit-user-select: text; -ms-user-select: text; } .ui-color-picker .
input[data-topic="lightness"] { display: none; } .ui-color-picker[data-mode='hsl'] .
input[data-topic="value"] { display: none; } .ui-color-picker[data-mode='hsl'] .
input[data-topic="lightness"] { display: block; } .ui-color-picker .
input[data-topic="alpha"] { margin-top: 10px; width: 93px; } .ui-color-picker .
input[data-topic="alpha"] > .name { width: 60px; } .ui-color-picker .
input[data-topic="alpha"] >
input { float: right; } .ui-color-picker .
input[data-topic="hexa"] { width: auto; float: right; margin: 6px 8px 0 0; } .ui-color-picker .
input[data-topic="hexa"] > .name { display: none; } ...
...And 25 more matches
NetUtil.jsm
method overview nsiasyncstreamcopier asynccopy(nsi
inputstream asource, nsioutputstream asink, [optional] acallback) void asyncfetch(asource, acallback) nsichannel newchannel(awhattoload, [optional] aorigincharset, [optional] nsiuri abaseuri) nsiuri newuri(atarget, [optional] aorigincharset, [optional] nsiuri abaseuri) string read
inputstreamtostring(a
inputstream, acount, aoptions) attributes attribut...
... methods asynccopy() the asynccopy() method performs a simple asynchronous copy of data from a source
input stream to a destination output stream.
... nsiasyncstreamcopier asynccopy( asource, asink, acallback ); parameters asource the
input stream from which to read the source data.
...And 23 more matches
Background audio processing using AudioWorklet - Web APIs
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 i...
... this is the barest framework and actually has no effect until code is added into process() to do something with those
inputs and outputs.
... which brings us to talking about those
inputs and outputs.
...And 23 more matches
Index - Archive of obsolete content
907
inputtooltiptext xul attributes, xul reference no summary!
...a change event is fired in different ways for different xul
input elements as listed below: 966 onclick xul attributes, xul reference no summary!
... 972 on
input xul attributes, xul reference no summary!
...And 22 more matches
Index
157 nsscriptable
inputstream components, components:frozen, xpcom, xpcom api reference a component implementing nsiscriptable
inputstream.
... 188 imgiencoder interfaces, interfaces:scriptable, needshelp, xpcom, xpcom interface reference possible values for
input format (note that not all image formats support saving alpha channels): 189 imgiloader interfaces, interfaces:scriptable, needscontent, xpcom api reference, xpcom interface reference implemented by @mozilla.org/image/loader;1 as a service: 190 imgirequest interfaces, interfaces:scriptable, needscontent cancels this request as in nsirequest.cancel(); furth...
... 337 nsiasync
inputstream interfaces, interfaces:scriptable, needscontent, streams, xpcom api reference, xpcom interface reference if an
input stream is non-blocking, it may return ns_base_stream_would_block when read.
...And 22 more matches
Border-radius generator - CSS: Cascading Style Sheets
a-y="top"> </div> <div id="bottom-right" class="radius-container" data-x="right" data-y="bottom"> </div> <div id="bottom-left" class="radius-container" data-x="left" data-y="bottom"> </div> <div id="radius-ui-sliders"> <div id="tlr" class="ui-
input-slider" data-topic="top-left" data-unit=" px" data-sensivity="2"></div> <div id="tlw" class="ui-
input-slider" data-topic="top-left-w" data-unit=" px" data-sensivity="2"></div> <div id="tlh" class="ui-
input-slider" data-topic="top-left-h" data-unit=" px" data-sensivity="2"></div> ...
... <div id="trr" class="ui-
input-slider" data-topic="top-right" data-unit=" px" data-sensivity="2"></div> <div id="trw" class="ui-
input-slider" data-topic="top-right-w" data-unit=" px" data-sensivity="2"></div> <div id="trh" class="ui-
input-slider" data-topic="top-right-h" data-unit=" px" data-sensivity="2"></div> <div id="brr" class="ui-
input-slider" data-topic="bottom-right" data-unit=" px" data-sensivity="2"></div> <div id="brw" class="ui-
input-slider" data-topic="bottom-right-w" data-unit=" px" data-sensivity="2"></div> <div id="brh" class="ui-
input-s...
...lider" data-topic="bottom-right-h" data-unit=" px" data-sensivity="2"></div> <div id="blr" class="ui-
input-slider" data-topic="bottom-left" data-unit=" px" data-sensivity="2"></div> <div id="blw" class="ui-
input-slider" data-topic="bottom-left-w" data-unit=" px" data-sensivity="2"></div> <div id="blh" class="ui-
input-slider" data-topic="bottom-left-h" data-unit=" px" data-sensivity="2"></div> </div> </div> </div> </div> <div id="controls" class="group section"> <div class="group section"> <div id="dimensions"> <div class="ui-
input-slider" data-topic="width"...
...And 22 more matches
Box-shadow generator - CSS: Cascading Style Sheets
<div id="colorpicker" class="group"> <div id="gradient" class="gradient"> <div id="gradient_picker"> </div> </div> <div id="hue" data-topic="hue" class="hue"> <div id="hue_selector"> </div> </div> <div class="info"> <div class="
input" data-topic="hue" data-title='h:' data-action="hsv"></div> <div class="
input" data-topic="saturation" data-title='s:' data-action="hsv"></div> <div class="
input" data-topic="value" data-title='v:' data-action="hsv"></div> </div> <div class="alpha"> <div id="alpha" data-topic="alpha"> ...
... <div id="alpha_selector"> </div> </div> </div> <div class="info"> <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" da...
...sition x </div> <div class="ui-slider-btn-set" data-topic="posx" data-type="sub"></div> <div class="ui-slider" data-topic="posx" data-min="-500" data-max="500" data-step="1"> </div> <div class="ui-slider-btn-set" data-topic="posx" data-type="add"></div> <div class="ui-slider-
input" data-topic="posx" data-unit="px"></div> </div> <div class="slidergroup"> <div class="ui-slider-name"> position y </div> <div class="ui-slider-btn-set" data-topic="posy" data-type="sub"></div> <div class="ui-slider" data-topic="posy" data-min="-500" data-max=...
...And 21 more matches
Color picker tool - CSS: Cascading Style Sheets
ata-mode="hsl"></div> <div id="picker-samples" sample-id="master"></div> <div id="controls"> <div id="delete"> <div id="trash-can"></div> </div> <div id="void-sample" class="icon"></div> </div> </div> <div id="canvas" data-tutorial="drop"> <div id="zindex" class="ui-
input-slider" data-topic="z-index" data-info="z-index" data-max="20" data-sensivity="10"></div> </div> </div> css /* * 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; -ms-user-select: none; user-select: none; } .ui-color-picker...
...r .alpha { border: 1px solid #ccc; background: url("https://mdn.mozillademos.org/files/5705/alpha.png"); } .ui-color-picker .alpha-mask { width: 100%; height: 100%; background: url("https://mdn.mozillademos.org/files/6089/alpha_mask.png"); } .ui-color-picker .slider-picker { width: 2px; height: 100%; border: 1px solid #777; background-color: #fff; position: relative; top: -1px; } /*
input hsv and rgb */ .ui-color-picker .info { width: 200px; margin: 5px; float: left; } .ui-color-picker .info * { float: left; } .ui-color-picker .
input { width: 64px; margin: 5px 2px; float: left; } .ui-color-picker .
input .name { height: 20px; width: 30px; text-align: center; font-size: 14px; line-height: 18px; float: left; } .ui-color-picker .
input input { width: 30px; height: 1...
...8px; margin: 0; padding: 0; border: 1px solid #ddd; text-align: center; float: right; -moz-user-select: text; -webkit-user-select: text; -ms-user-select: text; } .ui-color-picker .
input[data-topic="lightness"] { display: none; } .ui-color-picker[data-mode='hsl'] .
input[data-topic="value"] { display: none; } .ui-color-picker[data-mode='hsl'] .
input[data-topic="lightness"] { display: block; } .ui-color-picker .
input[data-topic="alpha"] { margin-top: 10px; width: 93px; } .ui-color-picker .
input[data-topic="alpha"] > .name { width: 60px; } .ui-color-picker .
input[data-topic="alpha"] >
input { float: right; } .ui-color-picker .
input[data-topic="hexa"] { width: auto; float: right; margin: 6px 8px 0 0; } .ui-color-picker .
input[data-topic="hexa"] > .name { display: none; } ...
...And 21 more matches
SVG documentation index - SVG: Scalable Vector Graphics
after applying the kernelmatrix of the <feconvolvematrix> element to the
input image to yield a number and applied the divisor attribute, the bias attribute is added to each component.
... 60 divisor filters, svg, svg attribute the divisor attribute specifies the value by which the resulting number of applying the kernelmatrix of a <feconvolvematrix> element to the
input image color value is divided to yield the destination color value.
... 65 edgemode filters, needscompattable, needsexample, svg, svg attribute the edgemode attribute determines how to extend the
input image as necessary with color values so that the matrix operations can be applied when the kernel is positioned at or near the edge of the
input image.
...And 19 more matches
Adding a new todo form: Vue events, methods, and models - Learn web development
what we really need next is the ability to allow our users to enter their own todo items into the app, and for that we'll need a text <
input>, an event to fire when the data is submitted, a method to fire upon submission to add the data and rerender the list, and a model to control the data.
...we need a <form> with a <label>, an <
input>, and a <button>.
... update your template as follows: <template> <form> <label for="new-todo-
input"> what needs to be done?
...And 18 more matches
filter - CSS: Cascading Style Sheets
filter: url(resources.svg#c1) filter functions blur() the blur() fucntion applies a gaussian blur to the
input image.
...-align: left; vertical-align: top; width:25%; height:auto; } #img3 { height:100%; } <svg style="position: absolute; top: -99999px" xmlns="http://www.w3.org/2000/svg"> <filter id="svgblur" x="-5%" y="-5%" width="110%" height="110%"> <fegaussianblur in="sourcegraphic" stddeviation="5"/> </filter> </svg> brightness() the brightness() function applies a linear multiplier to the
input image, making it appear more or less bright.
...a value of 100% leaves the
input unchanged.
...And 18 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
21 argument codingscripting, glossary, javascript an argument is a value (primitive or object) passed as
input to a function.
... 146 first cpu idle glossary, lighthouse, performance, web performance first cpu idle measures when a page is minimally interactive, or when the window is quiet enough to handle user
input.
...generally, it occurs when most, but not necessarily all visible ui elements are interactive, and the user interface responds, on average, to most user
input within 50ms.
...And 17 more matches
How to structure a web form - Learn web development
here is a little example: <form> <fieldset> <legend>fruit juice size</legend> <p> <
input type="radio" name="size" id="size_1" value="small"> <label for="size_1">small</label> </p> <p> <
input type="radio" name="size" id="size_2" value="medium"> <label for="size_2">medium</label> </p> <p> <
input type="radio" name="size" id="size_3" value="large"> <label for="size_3">large</label> </p> </fieldset> </form> note: you can find this exam...
...take this example, which we saw in the previous article: <label for="name">name:</label> <
input type="text" id="name" name="user_name"> with the <label> associated correctly with the <
input> via its for attribute (which contains the <
input> element's id attribute), a screenreader will read out something like "name, edit text".
... <label for="name"> name: <
input type="text" id="name" name="user_name"> </label> even in such cases however, it is considered best practice to set the for attribute to ensure all assistive technologies understand the relationship between label and widget.
...And 17 more matches
React interactivity: Events and state - Learn web development
instead, we can write a function in <app /> that will expect some data from our form as an
input, then pass that function to <form /> as a prop.
...update it as follows: function handlesubmit(e) { e.preventdefault(); props.addtask("say hello!"); } clicking on the "add" button in your browser will prove that the addtask() callback function works, but it'd be nice if we could get the alert to show us what we're typing in our
input field!
...now that we're dealing with user
input and data updates, however, we need something more.
...And 17 more matches
Your first form - Learn web development
the controls can be single or multi-line text fields, dropdown boxes, buttons, checkboxes, or radio buttons, and are mostly created using the <
input> element, although there are some other elements to learn about too.
...we will use the following html elements: <form>, <label>, <
input>, <textarea>, and <button>.
... the <label>, <
input>, and <textarea> elements our contact form is not complex: the data entry portion contains three text fields, each with a corresponding <label>: the
input field for the name is a single-line text field.
...And 16 more matches
Using files from web applications - Web APIs
this selection can be done by either using an html <
input type="file"> element or by drag and drop.
... accessing selected file(s) consider this html: <
input type="file" id="
input" multiple> the file api makes it possible to access a filelist containing file objects representing the files selected by the user.
... the multiple attribute on the
input element allows the user to select multiple files.
...And 16 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
| ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -e <encryptfilename> -o <opfilename> \n"); fprintf(stderr, "commands:\n\n"); fprintf(stderr, "%s %s\n --for generating cert request (for ca also)\n\n", progname, "-g -s <subject> -r <csr>"); fprintf(stderr, "%s %s\n --to
input and store cert (for ca also)\n\n", progname, "-a -n <nickname> -t <trust> -c <cert> [ -r <csr> -u <issuernickname> [-x <\"\">] -m <serialnumber> ]"); fprintf(stderr, "%s %s\n --to put cert in header\n\n", progname, "-h -n <nickname> -b <headerfilename> [-v <\"\">]"); fprintf(stderr, "%s %s\n --to find public key from cert in header and encrypt\n\n", ...
... fprintf(stderr, "%-30s - db directory path\n\n", "-d <dbdirpath>"); fprintf(stderr, "%-30s - db password [optional]\n\n", "-p <dbpwd>"); 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", "-...
... name is missing\n", progname, dbdir); validationfailed = pr_true; } if (!headerfilename) { pr_fprintf(pr_stderr, "%s -e -d %s -n %s -b : header file name is not found\n", progname, dbdir, nicknamestr); validationfailed = pr_true; } if (!infilename) { pr_fprintf(pr_stderr, "%s -e -d %s -n %s -b %s -i :
input file name is not found\n", progname, dbdir, nicknamestr, headerfilename); validationfailed = pr_true; } if (!encryptedfilename) { pr_fprintf(pr_stderr, "%s -e -d %s -n %s -b %s -i %s -e : encrypt file name is not found\n", progname, dbdir, nicknamestr, headerfilename, infilename); validationfailed = pr_true; } ...
...And 15 more matches
sample2
name> | ", "-b <headerfilename> -i <ipfilename> -e <encryptfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -e <encryptfilename> -o <opfilename> \n"); fprintf(stderr, "commands:\n\n"); fprintf(stderr, "%s %s\n --for generating cert request (for ca also)\n\n", progname, "-g -s <subject> -r <csr>"); fprintf(stderr, "%s %s\n --to
input and store cert (for ca also)\n\n", progname, "-a -n <nickname> -t <trust> -c <cert> [ -r <csr> -u <issuernickname> [-x <\"\">] -m <serialnumber> ]"); fprintf(stderr, "%s %s\n --to put cert in header\n\n", progname, "-h -n <nickname> -b <headerfilename> [-v <\"\">]"); fprintf(stderr, "%s %s\n --to find public key from cert in header and encrypt\n\n", progname, "-e -b <headerfilename> -i <ipfilenam...
..., "-v -b <headerfilename> -i <ipfilename> "); fprintf(stderr, "options:\n\n"); fprintf(stderr, "%-30s - db directory path\n\n", "-d <dbdirpath>"); fprintf(stderr, "%-30s - db password [optional]\n\n", "-p <dbpwd>"); 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>"); ...
...ol validationfailed = pr_false; if (!nicknamestr) { pr_fprintf(pr_stderr, "%s -e -d %s -n : nick name is missing\n", progname, dbdir); validationfailed = pr_true; } if (!headerfilename) { pr_fprintf(pr_stderr, "%s -e -d %s -n %s -b : header file name is not found\n", progname, dbdir, nicknamestr); validationfailed = pr_true; } if (!infilename) { pr_fprintf(pr_stderr, "%s -e -d %s -n %s -b %s -i :
input file name is not found\n", progname, dbdir, nicknamestr, headerfilename); validationfailed = pr_true; } if (!encryptedfilename) { pr_fprintf(pr_stderr, "%s -e -d %s -n %s -b %s -i %s -e : encrypt file name is not found\n", progname, dbdir, nicknamestr, headerfilename, infilename); validationfailed = pr_true; } if (validationfailed) { fprintf(stderr, "\nusage: %s %s \n\n", progname, "-e -d <dbdirp...
...And 15 more matches
File I/O - Archive of obsolete content
this article describes local file
input/output in chrome javascript.
... creating temporary files to create a temporary file, use nsifile.createunique(): components.utils.import("resource://gre/modules/fileutils.jsm"); var file = fileutils.getfile("tmpd", ["suggestedname.tmp"]); file.createunique(components.interfaces.nsifile.normal_file_type, fileutils.perms_file); // do whatever you need to the created file alert(file.path); user
input via nsifilepicker the file picker component, nsifilepicker, can be used to open standard open / save dialogs.
...so therefore for the first parameter, file, you can pass an nsifile object or a string (such as a jar path) see: netutil.asyncfetch: components.utils.import("resource://gre/modules/netutil.jsm"); netutil.asyncfetch(file, function(
inputstream, status) { if (!components.issuccesscode(status)) { // handle error!
...And 14 more matches
WAI-ARIA basics - Learn web development
html5 provides special
input types to render such controls: <
input type="date"> <
input type="range"> these are not well-supported across browsers, and it is also difficult to style them, making them not very useful for integrating with website designs.
...as an example, aria-required="true" specifies that a form
input needs to be filled in to be valid, whereas aria-labelledby="label" allows you to put an id on an element, then reference it as being the label for anything else on the page, including multiple elements, which is not possible using <label for="
input">.
... states — special properties that define the current conditions of elements, such as aria-disabled="true", which specifies to a screenreader that a form
input is currently disabled.
...And 14 more matches
Accessibility API cross-reference
in tagged pdf n/a n/a expressed with aria-labelledby if visible on screen or aria-label otherwise <caption> (for tables), <figcaption> (for figures), and <label> with a for attribute (for
input elements) a <toc> or <l> may contain a <caption> as its first item <caption> or <lbl> a cell in a table cell n/a table_cell cell <td> td not what you think - this is for the damn paperclip character n/a n/a n/a for graphics representing data chart n/a figure ?
... a checkbox; aria has two kinds: use checkbox if you need to express 'mixed' state (some of the descendents are true, some are false), otherwise use switch or (preferred in html) <
input type=checkbox>, which are true/false only.
... checkbutton check_box check_box checkbox or switch <
input type=checkbox> pretty obvious what this is for clock n/a n/a timer <time> column of cells in a table - how would the user specifically point to this, as opposed to the column header or cells?
...And 14 more matches
Index
create a context handle while providing all the parameters required for the operation, then call an “update” function multiple times to pass subsets of the
input to nss.
... -a use ascii format or allow the use of ascii format for
input and output.
...if options -m|-g is used and -c crl-script-file is not specified, crlutil will read script data from standard
input.
...And 14 more matches
Pointer events - Web APIs
however, since many devices support other types of pointing
input devices, such as pen/stylus and touch surfaces, extensions to the existing pointing device event models are needed.
...they are designed to create a single dom event model to handle pointing
input devices such as a mouse, pen/stylus or touch (such as one or more fingers).
... the events needed to handle generic pointer
input are analogous to mouse events (mousedown/pointerdown, mousemove/pointermove, etc.).
...And 14 more matches
Reading from Files - Archive of obsolete content
reading data from a file involves getting a reference to a file and then creating an
input stream to read from it.
... an
input stream provides a means of reading bytes, strings or other values from the file.
... while there is only one method to create an
input stream, it provides a number of options to control exactly how reading is performed.
...And 13 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
disabled while not appropriate for all elements, you can use the disabled attribute to temporarily disable
input to an element that is normally operable by the user.
...to respond to mouse and keyboard
inputs in html, the onclick event handler is typically used to respond to mouse clicks, and the onkeypress event handler for keyboard
input.
...apart from menuitem elements, it can be used with buttons and other
input controls.
...And 12 more matches
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.
... objective: to understand the non-<
input> form features, and how to implement them using html.
... multi-line text fields a multi-line text field is specified using a <textarea> element, rather than using the <
input> element.
...And 12 more matches
Looping code - Learn web development
we already met this in the previous article when we looked at switch statements — when a case is met in a switch statement that matches the
input expression, the break statement immediately exits the switch statement and moves onto the code after it.
...first, some simple html — a text <
input> allowing us to enter a name to search for, a <button> element to submit a search, and a <p> element to display the results in: <label for="search">search by contact name: </label> <
input id="search" type="text"> <button>search</button> <p></p> now on to the javascript: const contacts = ['chris:2232322', 'sarah:3453456', 'bill:7654322', 'mary:9998769', 'dianne:9384975']; const para = document.queryselector('p'); const
input = document.queryselector('
input'); const btn = document.queryselector('...
...button'); btn.addeventlistener('click', function() { let searchname =
input.value.tolowercase();
input.value = '';
input.focus(); for (let i = 0; i < contacts.length; i++) { let splitcontact = contacts[i].split(':'); if (splitcontact[0].tolowercase() === searchname) { para.textcontent = splitcontact[0] + '\'s number is ' + splitcontact[1] + '.'; break; } else { para.textcontent = 'contact not found.'; } } }); hidden code 3 <!doctype html> <html> <head> <meta charset="utf-8"> <title>simple contact search example</title> <style> </style> </head> <body> <label for="search">search by contact name: </label> <
input id="search" type="text"> <button>search</button> <p></p> <script> const contacts = ['chris:223232...
...And 12 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.
... my legs are made of cardboard and i am married to a fish.</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...
...And 11 more matches
Encrypt Decrypt_MAC_Using Token
" "); 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.
...railer, iv_trailer); break; case mac: strcpy(header, mac_header); strcpy(trailer, mac_trailer); break; case pad: strcpy(header, pad_header); strcpy(trailer, pad_trailer); break; } rv = filetoitem(&filedata, file); nonbody = (char *)filedata.data; if (!nonbody) { pr_fprintf(pr_stderr, "unable to read data from
input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and remove them.
...And 11 more matches
AudioWorkletProcessor.process - Web APIs
important: currently, audio data blocks are always 128 frames long—that is, they contain 128 32-bit floating-point samples for each of the
inputs' channels.
... 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.
...for example,
inputs[n][m][i] will access n-th
input, m-th channel of that
input, and i-th sample of that channel.
...And 11 more matches
Constraint validation - Developer guides
html5 introduced new mechanisms for forms: it added new semantic types for the <
input> element and constraint validation to ease the work of checking the form content on the client side.
...therefore, like with html4, you need to also validate
input constraints on the server side, in a way that is consistent with what is done on the client side.
... intrinsic and basic constraints in html5, basic constraints are declared in two ways: by choosing the most semantically appropriate value for the type attribute of the <
input> element, e.g., choosing the email type automatically creates a constraint that checks whether the value is a valid e-mail address.
...And 11 more matches
HTML attribute: multiple - HTML: Hypertext Markup Language
valid for the email and file
input types and the <select>, the manner by which the user opts for multiple values depends on the form control.
...for the file
input type, the native messaging the browser provides differs.
... in firefox, the file
input reads "no files selected" when the attribute is present and "no file selected" when not, when no files are selected.
...And 11 more matches
<label> - HTML: Hypertext Markup Language
associating a <label> with an <
input> element offers some major advantages: the label text is not only visually associated with its corresponding text
input; it is programmatically associated with it too.
... this means that, for example, a screenreader will read out the label when the user is focused on the form
input, making it easier for an assistive technology user to understand what data should be entered.
... you can click the associated label to focus/activate the
input, as well as the
input itself.
...And 11 more matches
Encrypt Decrypt MAC Keys As Session Objects
" "); 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 gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slo...
...railer, iv_trailer); break; case mac: strcpy(header, mac_header); strcpy(trailer, mac_trailer); break; case pad: strcpy(header, pad_header); strcpy(trailer, pad_trailer); break; } rv = filetoitem(&filedata, file); nonbody = (char *)filedata.data; if (!nonbody) { pr_fprintf(pr_stderr, "unable to read data from
input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and remove them */ if ((body = strstr(nonbody, header)) != null) { char *trail = null; nonbody = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(nonbody, '\r'); /* maybe this is a mac file */ if (body) trail =...
...And 10 more matches
Encrypt and decrypt MAC using token
" "); 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 gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slo...
...railer, iv_trailer); break; case mac: strcpy(header, mac_header); strcpy(trailer, mac_trailer); break; case pad: strcpy(header, pad_header); strcpy(trailer, pad_trailer); break; } rv = filetoitem(&filedata, file); nonbody = (char *)filedata.data; if (!nonbody) { pr_fprintf(pr_stderr, "unable to read data from
input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and remove them */ if ((body = strstr(nonbody, header)) != null) { char *trail = null; nonbody = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(nonbody, '\r'); /* maybe this is a mac file */ if (body) trail =...
...And 10 more matches
NSS Sample Code Sample_3_Basic Encryption and MACing
ecify db directory path\n\n", "-d <dbdirpath>"); fprintf(stderr, "%-20s specify 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(stde...
...rr, "%-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.
...railer, iv_trailer); break; case mac: strcpy(header, mac_header); strcpy(trailer, mac_trailer); break; case pad: strcpy(header, pad_header); strcpy(trailer, pad_trailer); break; } rv = filetoitem(&filedata, file); nonbody = (char *)filedata.data; if (!nonbody) { pr_fprintf(pr_stderr, "unable to read data from
input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and remove them */ if ((body = strstr(nonbody, header)) != null) { char *trail = null; nonbody = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(nonbody, '\r'); /* maybe this is a mac file */ if (body) trail =...
...And 10 more matches
Necko walkthrough
nsdocshell as an example client of the nsihttpchannel api nsdocshell::loaduri(string) create nsiuri from string nsdocshell::loaduri(nsiuri) creates 2 nsi
inputstream for read response from; passes them with uri to ...
...d pool) some other things nshttpchannel::connect might to a speculativeconnect (pre open tcp socket) nshttpchannel::continueconnect some cache stuff nshttpchannel::setuptransaction creates new nshttptransaction, and inits it with mrequesthead (the request headers) and muploadstream (which was created from the request data in channel setup) gets an nsiasync
inputstream (for the response; corresponds to the nspipe
inputstream for the response stream pipe) passes it to ns
inputstreampump nshttpchannel::ghttphandler->initiatetransaction (called from connect) this is the global nshttphandler object, which adds the transaction to the nshttpconnectionmgr (one of these per nshttphandler).
... dispatches the nsconnevent to the socket thread back to the context of nshttpchannel::continueconnect: ns
inputstreampump->asyncread this pump calls nsiasync
inputstream::asyncwait (the
input for the response stream pipe created with the nshttptransaction, i.e.
...And 10 more matches
imgIEncoder
1.0 66 introduced gecko 1.8 inherits from: nsiasync
inputstream last changed in gecko 1.9 (firefox 3) method overview void addimageframe( [array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in 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); voi...
...d 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 endianness)
input_format_rgba 1
input is rgb each pixel is represented by four bytes: r, g, and b (in that order, regardless of host endianness).
... post-multiplied alpha 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.
...And 10 more matches
nsIScriptableIO
ed to get a reference as with other components: var scriptableio = components.classes["@mozilla.org/io/scriptable-io;1"] .getservice(); scriptableio.getfile("profile", "cookies.txt"); method overview nsifile getfile(in astring alocation, in astring afilename); nsifile getfilewithpath(in astring afilepath); nsisupports new
inputstream(in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize); nsisupports newoutputstream(in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize, [optional] in unsigned long apermissions); ...
...the file does not have to exist already; this method simply creates the file reference which may then be passed to the new
inputstream() or newoutputstream() method to open the file for reading or writing.
... new
inputstream() retrieves a stream from which data can be read.
...And 10 more matches
nsIZipReader
pattern); nsiutf8stringenumerator findentries(in string apattern); obsolete since gecko 10 nsiprincipal getcertificateprincipal(in autf8string aentryname); nsiprincipal getcertificateprincipal(in string aentryname); obsolete since gecko 10 nsizipentry getentry(in autf8string zipentry); nsizipentry getentry(in string zipentry); obsolete since gecko 10 nsi
inputstream get
inputstream(in autf8string zipentry); nsi
inputstream get
inputstream(in string zipentry); obsolete since gecko 10 nsi
inputstream get
inputstreamwithspec(in autf8string ajarspec, in autf8string zipentry); nsi
inputstream get
inputstreamwithspec(in autf8string ajarspec, in string zipentry); obsolete since gecko 10 boolean hasentry(in autf8string zipentry); ...
...subsequent attempts to extract() files or read from its
input stream will result in an error.
...if aentryname is an entry in the jar, get
inputstream() must be called after parsemanifest.
...And 10 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
we can allow the user to control these using range
inputs on the interface: <label for="attack">attack</label> <
input name="attack" id="attack" type="range" min="0" max="1" value="0.2" step="0.1" /> <label for="release">release</label> <
input name="release" id="release" type="range" min="0" max="1" value="0.5" step="0.1" /> now we can create some variables over in javascript and have them change when the
input values are updated: let attacktime = 0...
....2; const attackcontrol = document.queryselector('#attack'); attackcontrol.addeventlistener('
input', function() { attacktime = number(this.value); }, false); let releasetime = 0.5; const releasecontrol = document.queryselector('#release'); releasecontrol.addeventlistener('
input', function() { releasetime = number(this.value); }, false); the final playsweep() function now we can expand our playsweep() function.
...in our case when is controlled by our
inputs.
...And 10 more matches
ARIA: textbox role - Accessibility
the textbox role is used to identify an element that allows the
input of free-form text.
... whenever possible, rather than using this role, use an <
input> element with type="text", for single-line
input, or a <textarea> element for multi-line
input.
... the default is a single line
input, in which return or enter submits the form; in this case, it is preferable to use an html <
input> with type="text".
...And 10 more matches
textbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an
input field where the user can enter text.
... it is similar to the html
input element.
... attributes cols, decimalplaces, disabled, emptytext, hidespinbuttons, increment, label, max, maxlength, min, multiline, newlines, onblur, onchange, onfocus, on
input, placeholder, preference, readonly, rows, searchbutton, size, spellcheck, tabindex, timeout, type, value, wrap, wraparound properties accessibletype, clickselectsall, decimalplaces, decimalsymbol, defaultvalue, disabled, editor, emptytext, increment,
inputfield, label, max, maxlength, min, placeholder, readonly, searchbutton, selectionend, selectionstart, size, spinbuttons, tabindex, textlength, timeout, type, value, valuenumber, wraparound me...
...And 9 more matches
Desktop mouse and keyboard controls - Game development
we could write our own keycode object containing the key codes, for example: var keyboardhelper = { left: 37, up: 38, right: 39, down: 40 }; that way instead of using the codes to compare the
input in the handler functions we could do something like this, which is arguably easier to remember: if(event.keycode == keyboardhelper.left) { leftpressed = true; } note: you can also find a list if the different keycodes and what keys they relate to in the keycode reference page.
...in phaser the buttons you create will take any type of
input, whether it's a touch on mobile or a click on desktop.
...we can assign actions directly to the buttons: this.buttonshoot = this.add.button(this.world.width*0.5, 0, 'button-alpha', null, this); this.buttonshoot.on
inputdown.add(this.shootingpressed, this); this.buttonshoot.on
inputup.add(this.shootingreleased, this); the button used for shooting works perfectly fine on both the mobile and desktop approach.
...And 9 more matches
Mobile touch controls - Game development
there's no multitouch or gestures — everything is handled by single pointer
inputs.
... you can add more pointers to the game by using; this.game.
input.addpointer up to ten pointers can be managed simultaneously.
... the most recently used pointer is available in the this.game.
input.activepointer object — the most recent finger active on the screen.
...And 9 more matches
Styling web forms - Learn web development
these include the following elements: <form> <fieldset> and <legend> single-line text <
input>s (e.g.
... type text, url, email...), except for <
input type="search">.
... 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.
...And 9 more matches
Beginning our React todo list - Learn web development
the jsx copy the following snippet to your clipboard, then paste it into app.js so that it replaces the existing app() function: function app(props) { return ( <div classname="todoapp stack-large"> <h1>todomatic</h1> <form> <h2 classname="label-wrapper"> <label htmlfor="new-todo-
input" classname="label__lg"> what needs to be done?
... </label> </h2> <
input type="text" id="new-todo-
input" classname="
input input__lg" name="text" autocomplete="off" /> <button type="submit" classname="btn btn__primary btn__lg"> add </button> </form> <div classname="filters btn-group stack-exception"> <button type="button" classname="btn toggle-btn" aria-pressed="true"> <span classname="visually-hidden">show </span> <span>all</span> <span classname="visually-hidden"> tasks</span> </button> <button type="button" classname="btn toggle-btn" aria-pressed="false"> <span classname="visually-hidden">show </span> <span>active</span> <span classname="v...
...pan>completed</span> <span classname="visually-hidden"> tasks</span> </button> </div> <h2 id="list-heading"> 3 tasks remaining </h2> <ul role="list" classname="todo-list stack-large stack-exception" aria-labelledby="list-heading" > <li classname="todo stack-small"> <div classname="c-cb"> <
input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-label" htmlfor="todo-0"> eat </label> </div> <div classname="btn-group"> <button type="button" classname="btn"> edit <span classname="visually-hidden">eat</span> </button> <button type="button" classname="btn btn__d...
...And 9 more matches
Componentizing our Svelte app - Learn web development
newtodo.svelte: the text
input and button that allow you to enter a new todo item.
... put the following contents inside this file: <script> export let todo </script> <div class="stack-small"> <div class="c-cb"> <
input type="checkbox" id="todo-{todo.id}" on:click={() => todo.completed = !todo.completed} checked={todo.completed} /> <label for="todo-{todo.id}" class="todo-label">{todo.name}</label> </div> <div class="btn-group"> <button type="button" class="btn"> edit <span class="visually-hidden">{todo.name}</span> </button> <button type="button" class="btn btn__danger" ...
...when entering editing mode we'll show an <
input> field to allow us to edit the current todo name, with two buttons to confirm or cancel our changes.
...And 9 more matches
Enc Dec MAC Output Public Key as CSR
"-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 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 output file.\n\n", ""); exit(-1); } /* map option letter enumerated commad type */ static commandtype option2command(const char* c) { switch (*c) { case 'g': return gen_csr; case 'e': return encrypt; case 'd': return decrypt; default: return unknown; } } /* * wrap the symkey using public key */ secstatus wrapkey(pk11symkey* key, seckeypublickey *pubkey, secitem **wrappedkey) { secstatus rv; secitem *data = (secitem *)port_zalloc(sizeof(secitem)); if (!data) { pr_fprintf(pr_stderr, "error while allocating memory\n"); rv = secfailure; goto cleanup; } data->len = seckey_publickeystrength(pubkey); data->data = (unsigned char*)p...
... case pad: header = pad_header; trailer = pad_trailer; break; case lab: header = lab_header; trailer = lab_trailer; break; default: pr_close(file); return secfailure; } rv = filetoitem(&filedata, file); nonbody = (char *)filedata.data; if (!nonbody) { pr_fprintf(pr_stderr, "unable to read data from
input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and remove them */ char *trail = null; if ((body = strstr(nonbody, header)) != null) { char *trail = null; nonbody = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(nonbody, '\r'); /* maybe this is a mac file */ if (b...
...And 9 more matches
EncDecMAC using token object - sample 3
ration\n\n", "-c "); fprintf(stderr, "%-20s specify 'b' for decrypt 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 fil...
...er); strcpy(trailer, mackey_trailer); break; case iv: strcpy(header, iv_header); strcpy(trailer, iv_trailer); break; case mac: strcpy(header, mac_header); strcpy(trailer, mac_trailer); break; case pad: strcpy(header, pad_header); strcpy(trailer, pad_trailer); break; } rv = filetoitem(&filedata, file); nonbody = (char *)filedata.data; if (!nonbody) { pr_fprintf(pr_stderr, "unable to read data from
input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and remove them */ if ((body = strstr(nonbody, header)) != null) { char *trail = null; nonbody = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(nonbody, '\r'); /* maybe this is a mac file */ if (body) trail = strstr(++body, trailer); if (trail != null) { *trail = '\0'; } else { pr_fprintf(pr_stderr, ...
..."
input has header but no trailer\n"); port_free(filedata.data); return secfailure; } } else { body = nonbody; } cleanup: pr_close(file); hextobuf(body, item, ishexdata); return secsuccess; } /* * encryptandmac */ secstatus encryptandmac(prfiledesc *infile, prfiledesc *headerfile, prfiledesc *encfile, pk11symkey *ek, pk11symkey *mk, unsigned char *iv, unsigned int ivlen, prbool ascii) { secstatus rv; unsigned char ptext[blocksize]; unsigned int ptextlen; unsigned char mac[digestsize]; unsigned int maclen; unsigned int nwritten; unsigned char encbuf[blocksize]; unsigned int encbuflen; secitem noparams = { sibuffer, null, 0 }; pk11context *ctxmac = null; pk11context *ctxenc = null; unsigned int pad[1]; secitem paditem; unsigned int paddinglength; static unsigned int firsttime = 1; int j; ctxmac = ...
...And 9 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 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.
...once the sound has been sufficiently processed for the intended effect, it can be linked to the
input of a destination (audiocontext.destination), which sends the sound to the speakers or headphones.
...And 9 more matches
Cognitive accessibility - Accessibility
input assistance guideline 3.3 helps to ensure accurate data entry, stating "help users avoid and correct mistakes." while we all make mistakes, some people are more likely to make mistakes, less likely to notice a mistake, or have a harder time correcting a mistake once they make one.
...
input assistance guidelines aim to reduce the likelihood that users, especially those with disabilities, make a mistake, and, if they do make a mistake, increase the likelihood that they see and comprehend the error message and can successfully fix any errors.
...if multiple errors are present, provide a summary, with each error linking to the related
input.
...And 9 more matches
::placeholder - CSS: Cascading Style Sheets
the ::placeholder css pseudo-element represents the placeholder text in an <
input> or <textarea> element.
... syntax ::placeholder accessibility concerns color contrast contrast ratio placeholder text typically has a lighter color treatment to indicate that it is a suggestion for what kind of
input will be valid, and is not actual
input of any kind.
... it is important to ensure that the contrast ratio between the color of the placeholder text and the background of the
input is high enough that people experiencing low vision conditions will be able to read it while also making sure there is enough of a difference between the placeholder text and
input text color that users do not mistake the placeholder for
inputed data.
...And 9 more matches
Anatomy of a video game - Game development
present, accept, interpret, calculate, repeat the goal of every video game is to present the user(s) with a situation, accept their
input, interpret those signals into actions, and calculate a new situation resulting from those acts.
... some games drive this cycle by user
input.
...these games present two images to the user; they accept their click (or touch); they interpret the
input as a success, failure, pause, menu interaction, etc.; finally, they calculate an updated scene resulting from that
input.
...And 8 more matches
CSS and JavaScript accessibility best practices - Learn web development
form elements elements to allow users to
input data into websites: <div> <label for="name">enter your name</label> <
input type="text" id="name" name="name"> </div> you can see some good example css in our form-css.html example (see it live also).
... most of the css you'll write for forms will be for sizing the elements, lining up labels and
inputs, and getting them looking neat and tidy.
...think carefully about whether you need a complex non-standard form widget, or whether a text
input would do.
...And 8 more matches
HTML forms in legacy browsers - Learn web development
and html5 <
input> types don't fail when not supported: they fall back to type=text.
... html
input types the
input types added in html5 are all useable, even in ancient browsers, because the way they degrade is highly predictable.
... if a browser does not know the value of the type attribute of an <
input> element, it will fall back as if the value were text.
...And 8 more matches
Getting started with HTML - Learn web development
active learning: creating your first html element edit the line below in the
input area by wrapping it with the tags <em> and </em>.
...</textarea> <div class="controls"> <
input id="reset" type="button" value="reset" /> <
input id="solution" type="button" value="show solution" /> </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 ...
...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(); }); var htmlsolution = '<em>this is my text.</em>'; var solutionentry = htmlsolution; textarea.addeventlistener('
input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; v...
...And 8 more matches
A first splash into JavaScript - Learn web development
we'll tell you if your guess was too high or too low.</p> <div class="form"> <label for="guessfield">enter a guess: </label><
input type="text" id="guessfield" class="guessfield"> <
input type="submit" value="submit guess" class="guesssubmit"> </div> <div class="resultparas"> <p class="guesses"></p> <p class="lastresult"></p> <p class="loworhi"></p> </div> <script> // your javascript goes here let randomnumber = math.floor(math.random() * 100) + 1; const guesses = document.queryselec...
...phs in our html, and are used to insert values into the paragraphs later on in the code (note how they are inside a <div> element, which is itself used to select all three later on for resetting, when we restart the game): <div class="resultparas"> <p class="guesses"></p> <p class="lastresult"></p> <p class="loworhi"></p> </div> the next two constants store references to the form text
input and submit button and are used to control submitting the guess later on.
... <label for="guessfield">enter a guess: </label><
input type="text" id="guessfield" class="guessfield"> <
input type="submit" value="submit guess" class="guesssubmit"> our final two variables store a guess count of 1 (used to keep track of how many guesses the player has had), and a reference to a reset button that doesn't exist yet (but will later).
...And 8 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
replace the existing <ul> element with the following simplified version to get an idea of how it works: <ul> {#each todos as todo, index (todo.id)} <li> <
input type="checkbox" checked={todo.completed}/> {index}.
...replace your existing <ul> block with the following: <!-- todos --> <ul role="list" class="todo-list stack-large" aria-labelledby="list-heading"> {#each todos as todo (todo.id)} <li class="todo"> <div class="stack-small"> <div class="c-cb"> <
input type="checkbox" id="todo-{todo.id}" checked={todo.completed}/> <label for="todo-{todo.id}" class="todo-label"> {todo.name} </label> </div> <div class="btn-group"> <button type="button" class="btn"> edit <span class="visually-hidden">{todo.name}</span> </button> <button type="button" class="btn btn__danger"> ...
...let's add a handler to the on:click event of the checkbox
input to toggle the completed value.
...And 8 more matches
nss tech note1
this was written to be a generic decoder, that includes both der (distinguished encoding rules) and ber (basic encoding rules).† it handles both streaming and non-streaming
input.
...it can only decode der .† it does not handle streaming
input, and requires that all
input be present before beginning to decode.
... decoder templates : the sec_asn1template structure tells the decoder what to do with the
input data.
...And 8 more matches
Using the CSS Painting API - Web APIs
registerpaint('csspaintfunctionname', class { static get
inputproperties() { return ['propertyname1', '--custompropertyname2']; } static get
inputarguments() { return ['<color>']; } static get contextoptions() { return {alpha: true}; } paint(drawingcontext, elementsize, stylemap) { // paint code goes here.
...to be able to access properties, we include the static
inputproperties() method, which provides live access to css properties, including regular properties and custom properties, and returns an array of property names.
... we'll take a look at
inputarguments in the last section.
...And 8 more matches
HTMLTextAreaElement - Web APIs
autocapitalize string: returns / sets the element's capitalization behavior for user
input.
... autocomplete autofocus boolean: returns / sets the element's autofocus attribute, indicating that the control should have
input focus when the page loads cols unsigned long: returns / sets the element's cols attribute, indicating the visible width of the text area.
...
inputmode maxlength long: returns / sets the element's maxlength attribute, indicating the maximum number of characters the user can enter.
...And 8 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 8 more matches
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 rendering the scene from that position, looking in the direction the user is currently facing.
... xr
inputsource represents any
input device the user can use to perform targeted actions within the same virtual space as the viewer.
...And 8 more matches
Using XMLHttpRequest - Web APIs
plainescape : escape; for (var nitem = 0; nitem < otarget.elements.length; nitem++) { ofield = otarget.elements[nitem]; if (!ofield.hasattribute("name")) { continue; } sfieldtype = ofield.nodename.touppercase() === "
input" ?
...is); } return function (oformelement) { if (!oformelement.action) { return; } new submitrequest(oformelement); }; })(); </script> </head> <body> <h1>sending forms with pure ajax</h1> <h2>using the get method</h2> <form action="register.php" method="get" onsubmit="ajaxsubmit(this); return false;"> <fieldset> <legend>registration example</legend> <p> first name: <
input type="text" name="firstname" /><br /> last name: <
input type="text" name="lastname" /> </p> <p> <
input type="submit" value="submit" /> </p> </fieldset> </form> <h2>using the post method</h2> <h3>enctype: application/x-www-form-urlencoded (default)</h3> <form action="register.php" method="post" onsubmit="ajaxsubmit(this); return false;"> <fieldset> <legend>registr...
...ation example</legend> <p> first name: <
input type="text" name="firstname" /><br /> last name: <
input type="text" name="lastname" /> </p> <p> <
input type="submit" value="submit" /> </p> </fieldset> </form> <h3>enctype: text/plain</h3> <form action="register.php" method="post" enctype="text/plain" onsubmit="ajaxsubmit(this); return false;"> <fieldset> <legend>registration example</legend> <p> your name: <
input type="text" name="user" /> </p> <p> your message:<br /> <textarea name="message" cols="40" rows="8"></textarea> </p> <p> <
input type="submit" value="submit" /> </p> </fieldset> </form> <h3>enctype: multipart/form-data</h3> <form action="register.php" method="post" enctype="multipart/form-dat...
...And 8 more matches
HTML attribute: min - HTML: Hypertext Markup Language
the min attribute defines the minimum value that is acceptable and valid for the
input containing the attribute.
...if a value is specified for min that isn't a valid number, the
input has no minimum value.
... valid for the numeric
input types, including the date, month, week, time, datetime-local, number and range types, and the <meter> element, the min attribute is a number that specifies the most negative value a form control to be considered valid.
...And 8 more matches
HTML attribute: step - HTML: Hypertext Markup Language
valid for the numeric
input types, including the date, month, week, time, datetime-local, number and range types, the step attribute is a number that specifies the granularity that the value must adhere to or the keyword any.
...if not explicitly included, step defaults to 1 for number and range, and 1 unit type (minute, week, month, day) for the date/time
input types.
... the default stepping value for number
inputs is 1, allowing only integers to be entered, unless the stepping base is not an integer.
...And 8 more matches
Reading textual data - Archive of obsolete content
converting read data if you read data from nsiscriptable
inputstream as described on the file i/o code snippets page, you can convert it to utf-8 // sstream is nsiscriptable
inputstream var str = sstream.read(4096); var utf8converter = components.classes["@mozilla.org/intl/utf8converterservice;1"].
... getservice(components.interfaces.nsiutf8converterservice); var data = utf8converter.converturispectoutf8 (str, "utf-8"); gecko 1.8 and newer reading strings starting with gecko 1.8 (seamonkey 1.0, firefox 1.5), you can use nsiconverter
inputstream to read strings from a stream (nsi
inputstream).
...using utf-8 for this example: */ "utf-8"; const replacementchar = components.interfaces.nsiconverter
inputstream.default_replacement_character; var is = components.classes["@mozilla.org/intl/converter-
input-stream;1"] .createinstance(components.interfaces.nsiconverter
inputstream); is.init(fis, charset, 1024, replacementchar); now you can read string from is: var str = {}; var numchars = is.readstring(4096, str); if (numchars != 0 /* eof */) var read_string = str.value; to read the entire stream and do something with the data: var str = {}; while (is.readstring(4096, str) != 0) { processdata(str.value); } don't forget to close the stream when you're done wit...
...And 7 more matches
Images, media, and form elements - Learn web development
many form controls are added to your page by way of the <
input> element — this defines simple form fields such as text
inputs, through to more complex fields added in html5 such as color and date pickers.
... there are some additional elements, such as <textarea> for multiline text
input, and also elements used to contain and label parts of forms such as <fieldset> and <legend>.
... styling text
input elements elements that allow for text
input, such as <
input type="text">, specific types such as <
input type="email">, and the <textarea> element are quite easy to style and tend to behave just like other boxes on your page.
...And 7 more matches
Advanced text formatting - Learn web development
thought, or piece of additional background information.</dd> <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.
...a light brown color.</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; } 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...
...And 7 more matches
Useful string methods - Learn web development
="playable-code" style="height: 290px; width: 95%"> const list = document.queryselector('.output ul'); list.innerhtml = ''; let greetings = ['happy birthday!', 'merry christmas my love', 'a happy christmas to all the family', 'you\'re all i want for christmas', 'get well soon']; for (let i = 0; i < greetings.length; i++) { let
input = greetings[i]; // your conditional test needs to go inside the parentheses // in the line below, replacing what's currently there if (greetings[i]) { let listitem = document.createelement('li'); listitem.textcontent =
input; list.appendchild(listitem); } } </textarea> <div class="playable-buttons"> <
input id="reset" type="button" value="reset"> <
input id="solution" type=...
...ent.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];' + '\n if (greetings[i].indexof(\'christmas\') !== -1) {' + '\n let result =
input;' + '\n let listitem = document.createelement(\'li\');' + '\n listitem.textcontent = result;' + '\n list.appendchild(listitem);' + '\n }' + '\n}'; let solutionentry = jssolution; textarea.addeventlistener('
input', updatecode); window.addeventlistener('load', updatecode); // stop tab...
...a good way to do this is to: convert the whole of the string contained in the
input variable to lower case and store it in a new variable.
...And 7 more matches
Starting our Svelte Todo list app - Learn web development
</label> </h2> <
input type="text" id="todo-0" autocomplete="off" class="
input input__lg" /> <button type="submit" disabled="" class="btn btn__primary btn__lg"> add </button> </form> <!-- filter --> <div class="filters btn-group stack-exception"> <button class="btn toggle-btn" aria-pressed="true"> <span class="visually-hidden">show</span> <span>all</span> <span class="vi...
... <!-- todos --> <ul role="list" class="todo-list stack-large" aria-labelledby="list-heading"> <!-- todo-1 (editing mode) --> <li class="todo"> <div class="stack-small"> <form class="stack-small"> <div class="form-group"> <label for="todo-1" class="todo-label"> new name for 'create a svelte starter app' </label> <
input type="text" id="todo-1" autocomplete="off" class="todo-text" /> </div> <div class="btn-group"> <button class="btn todo-cancel" type="button"> cancel <span class="visually-hidden">renaming create a svelte starter app</span> </button> <button class="btn btn__primary todo-edit" type="submit"> save ...
... <span class="visually-hidden">new name for create a svelte starter app</span> </button> </div> </form> </div> </li> <!-- todo-2 --> <li class="todo"> <div class="stack-small"> <div class="c-cb"> <
input type="checkbox" id="todo-2" checked/> <label for="todo-2" class="todo-label"> create your first component </label> </div> <div class="btn-group"> <button type="button" class="btn"> edit <span class="visually-hidden">create your first component</span> </button> <button type="button" class="btn btn__danger"> delete <span class="visually-hidden">create your first component</span> </but...
...And 7 more matches
Styling Vue components with CSS - Learn web development
; } h1, h2 { margin-bottom: 0; } ul { list-style: none; padding: 0; } button { border: none; margin: 0; padding: 0; width: auto; overflow: visible; background: transparent; color: inherit; font: inherit; line-height: normal; -webkit-font-smoothing: inherit; -moz-osx-font-smoothing: inherit; -webkit-appearance: none; } button::-moz-focus-inner { border: 0; } button,
input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; } button,
input { /* 1 */ overflow: visible; }
input[type="text"] { border-radius: 0; } body { width: 100%; max-width: 68rem; margin: 0 auto; font: 1.6rem/1.25 "helvetica neue", helvetica, arial, sans-serif; background-color: #f5f5f5; color: #4d4d4d; -moz-osx-font-smoothi...
... before: after: noticeable changes include the removal of the list bullets, background color changes, and changes to the base button and
input styles.
...these styles do a few things — adding some styling to buttons and
inputs, and customizing the #app element and its children.
...And 7 more matches
Handling common accessibility problems - Learn web development
the elements that have this capability are the common ones that allow user to interact with web pages, namely links, <button>s, and form elements like <
input>.
... you can then press enter/return to follow a focused link or press a button (we've included some javascript to make the buttons alert a message), or start typing to enter text in a text
input (other form elements have different controls, for example the <select> element can have its options displayed and cycled between using the up and down arrow keys).
...it is a good idea to double up focus and hover styles, so your users get that visual clue that a control will do something when activated, whether they are using mouse or keyboard: a:hover,
input:hover, button:hover, select:hover, a:focus,
input:focus, button:focus, select:focus { font-weight: bold; } note: if you do decide to remove the default focus styling using css, make sure you replace it with something else that fits in with your design better — it is a very valuable accessiblity tool, and should not be removed.
...And 7 more matches
nsIAnnotationService
setpageannotationstring() this method sets an annotation for given uri by taking a string as
input value, overwriting any previous annotation with the same url/name.
... setitemannotationstring() this method sets an annotation for given item by taking a string as
input value, overwriting any previous annotation with the same url/name.
... setpageannotationint32() this method sets an annotation for given uri, just like setpageannotationstring(), but takes an int32 as an
input.
...And 7 more matches
The HTML DOM API - Web APIs
htmlbrelement htmlbaseelement htmlbodyelement htmlbuttonelement htmlcanvaselement htmldlistelement htmldataelement htmldatalistelement htmldetailselement htmldialogelement htmldirectoryelement htmldivelement htmlelement htmlembedelement htmlfieldsetelement htmlformelement htmlhrelement htmlheadelement htmlheadingelement htmlhtmlelement htmliframeelement htmlimageelement html
inputelement htmllielement htmllabelelement htmllegendelement htmllinkelement htmlmapelement htmlmediaelement htmlmenuelement htmlmetaelement htmlmeterelement htmlmodelement htmlolistelement htmlobjectelement htmloptgroupelement htmloptionelement htmloutputelement htmlparagraphelement htmlparamelement htmlpictureelement htmlpreelement htmlprogresselement htmlquoteelement htmlscrip...
... barprop navigator window deprecated web app and browser integration interfaces external obsolete web app and browser integration interfaces applicationcache plugin pluginarray form support interfaces these interfaces provide structure and functionality required by the elements used to create and manage forms, including the <form> and <
input> elements.
... eventsource examples in this example, an <
input> element's
input event is monitored in order to update the state of a form's "submit" button based on whether or not a given field currently has a value.
...And 7 more matches
A simple RTCDataChannel sample - Web APIs
first, we have a couple of buttons for establishing and closing the connection: <button id="connectbutton" name="connectbutton" class="buttonleft"> connect </button> <button id="disconnectbutton" name="disconnectbutton" class="buttonright" disabled> disconnect </button> then there's a box which contains the text
input box into which the user can type a message to transmit, with a button to send the entered text.
... <div class="messagebox"> <label for="message">enter a message: <
input type="text" name="message" id="message" placeholder="message text"
inputmode="latin" size=60 maxlength=120 disabled> </label> <button id="sendbutton" name="sendbutton" class="buttonright" disabled> send </button> </div> finally, there's the little box into which we'll insert the messages.
... function startup() { connectbutton = document.getelementbyid('connectbutton'); disconnectbutton = document.getelementbyid('disconnectbutton'); sendbutton = document.getelementbyid('sendbutton'); message
inputbox = document.getelementbyid('message'); receivebox = document.getelementbyid('receivebox'); // set event listeners for user interface widgets connectbutton.addeventlistener('click', connectpeers, false); disconnectbutton.addeventlistener('click', disconnectpeers, false); sendbutton.addeventlistener('click', sendmessage, false); } this is quite straightforward.
...And 7 more matches
Rendering and the WebXR frame animation callback - Web APIs
webxr frames your frame rendering callback function receives as
input two parameters: the time to which the frame corresponds, and an xrframe object describing the state of the scene as of that time.
...it receives as
input the time at which the frame being drawn and an xrframe object providing details about the state of the scene for the frame you need to render.
...two of the most common are handling of user
inputs and performing updates to the positions of objects (or the viewer) based on known factors, such as those user control states or known animation paths of the objects in the scene.
...And 7 more matches
Controlling multiple parameters with ConstantSourceNode - Web APIs
for example, perhaps you have a set of oscillators, and two of them need to share the same, configurable volume, or you have a filter that's been applied to certain
inputs but not to all of them.
... the diagram below shows how this works; an
input value, n, is set as the value of the constantsourcenode.offset property.
... as a result, every time you change n (the value of the
input audioparam, the values of the two gainnodes' gain properties and the value of the stereopannernode's pan propertry are all set to n as well.
...And 7 more matches
XRTargetRayMode - Web APIs
the webxr device api enumerated type xrtargetraymode describes the method by an
input controller's targeting ray is being produced.
... values gaze the user is using a gaze-tracking system (or gaze
input) which detects the direction in which the user is looking.
... screen the direction of the target ray is indicated using a tap on a touch screen, mouse, or other tactile
input device.
...And 7 more matches
Understandable - Accessibility
3.2.2 on
input (a) when data is
inputted into a control, or a setting is changed, context should not be changed unexpectedly.
... globaleventhandlers.on
input is useful here.
... guideline 3.3 —
input assistance: help users avoid and correct mistakes this guideline centers around helping users enter correct information when required with the minimum of mistakes.
...And 7 more matches
font - CSS: Cascading Style Sheets
</p> <form action="createshorthand()"> <div class="cf"> <div class="setpropcont"> font-style<br/> <
input type="radio" id="font-style-none" name="font_style" checked="" value="" onchange="setcss()"> <label for="font-style-none">none</label><br/> <
input type="radio" id="font-style-normal" name="font_style" value="normal" onchange="setcss()"> <label for="font-style-normal">normal</label><br/> <
input type="radio" id="font-style-italic" name="font_style" value="italic" onchange="s...
...etcss()"> <label for="font-style-italic">italic</label><br/> <
input type="radio" id="font-style-oblique" name="font_style" value="oblique" onchange="setcss()"> <label for="font-style-oblique">oblique</label> </div> <div class="setpropcont"> font-variant<br> <
input type="radio" id="font-variant-none" name="font_variant" checked="" value=" " onchange="setcss()"> <label for="font-variant-none">none</label><br/> <
input type="radio" id="font-variant-normal" name="font_variant" value="normal" onchange="setcss()"> <label for="font-variant-normal">normal</label><br/> <
input type="radio" id="font-variant-small-caps" name="font_variant" value="small-caps" onchange="setcss()"> <label for="font-variant-small-caps">small-caps</labe...
...l> </div> <div class="setpropcont"> font-weight<br/> <
input type="radio" id="font-weight-none" name="font_weight" value="" onchange="setcss()"> <label for="font-weight-none">none</label><br/> <
input type="radio" id="font-weight-normal" checked="" name="font_weight" value="400" onchange="setcss()"> <label for="font-weight-normal">normal</label><br/> <
input type="radio" id="font-weight-bold" name="font_weight" value="700" onchange="setcss()"> <label for="font-weight-bold">bold</label> </div> <div class="setpropcont"> font-size<br/> <
input type="radio" id="font-size-12px" name="font_size" value="12px" onchange="setcss()"> <label for="font-size-12px">12px</label><br/> <
input type="r...
...And 7 more matches
HTML attribute: accept - HTML: Hypertext Markup Language
the accept property is an attribute of the file <
input> type.
... for instance, there are a number of ways microsoft word files can be identified, so a site that accepts word files might use an <
input> like this: <
input type="file" id="docpicker" accept=".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"> whereas if you're accepting a media file, you may want to be include any format of that media type: <
input type="file" id="soundfile" accept="audio/*"> <
input type="file" id="videofile" accept="video/*"> <
input type="file" id="imagefile...
... examples when set on a file
input type, the native file picker that opens up should only enable selecting files of the correct file type.
...And 7 more matches
HTML attribute: readonly - HTML: Hypertext Markup Language
if the readonly attribute is specified on an
input element, because the user can not edit the
input, the element does not participate in constraint validation.
... the readonly attribute is supported by text, search, url, tel, email, password, date, month, week, time, datetime-local, and number<
input> types and the <textarea> form control elements.
... if present on any of these
input types and elements, the :read-only pseudo class will match.
...And 7 more matches
Index - Archive of obsolete content
160
inputtooltiptext xul attributes, xul reference no summary!
...a change event is fired in different ways for different xul
input elements as listed below: 219 onclick xul attributes, xul reference no summary!
... 233 on
input xul attributes, xul reference no summary!
...And 6 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
attributes accesskey, autocompletepopup, autocompletesearch, autocompletesearchparam, completedefaultindex, completeselectedindex,crop, disableautocomplete, disabled, disablekeynavigation, enablehistory, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching,
inputtooltiptext, label, maxlength, maxrows, minresultsforpopup, nomatch, onchange, on
input, onsearchcomplete, ontextentered, ontextreverted, open, readonly,showcommentcolumn, showimagecolumn, size, tabindex, tabscrolling, timeout, type, value properties accessibletype, completedefaultindex, controller, crop, disableautocomplete, disablekeynavigation, disabled, editable, focused, forcecomplet...
...e, highlightnonmatches, ignoreblurwhilesearching,
inputfield, label, maxlength, maxrows, minresultsforpopup, open, popup, popupopen, searchcount, searchparam, selectionend, selectionstart, showcommentcolumn, showimagecolumn,size, tabindex, tabscrolling, textlength, textvalue, timeout, type, value methods getsearchat, onsearchcomplete, ontextentered, ontextreverted, select, setselectionrange examples <textbox type="autocomplete" autocompletesearch="history"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
...
inputtooltiptext type: string the tooltip text for the textbox.
...And 6 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
attributes accesskey, alwaysopenpopup, autocompletesearch, autocompletesearchparam, autofill, autofillaftermatch, autofill, completedefaultindex, crop, disableautocomplete, disableautocomplete, disabled, disablehistory, enablehistory, focused, forcecomplete, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, ignoreblurwhilesearching,
inputtooltiptext, label, maxlength, maxrows, minresultsforpopup, minresultsforpopup, nomatch, onchange, onerrorcommand, on
input, onsearchcomplete, ontextcommand, ontextentered, ontextrevert, ontextreverted, open, readonly, searchsessions, showcommentcolumn, showcommentcolumn, showpopup, size, tabindex, tabscrolling, tabscrolling, timeout, type, useraction, value properties accessible, a...
...lwaysopenpopup, autofill, autofillaftermatch, completedefaultindex, crop, disableautocomplete, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching,
inputfield, issearching, iswaiting, label, maxlength, maxrows, minresultsforpopup, nomatch, open, popup, popupopen, resultspopup, searchcount, searchparam, searchsessions, selectionend, selectionstart, sessioncount, showcommentcolumn, showpopup, size, tabindex, tabscrolling, textlength, textvalue, timeout, type, useraction, value methods addsession, clearresults, getdefaultsession, getresultat, getresultcount, getresultvalueat, getsession, getsessionbyname, getsessionresultat, getsessionstatusat, getsessionvalueat, removesession, select, setselectionrange, syncsessions examples (example needed) ...
... autofillaftermatch obsolete since gecko 1.9.1 type: boolean if set to true, the entire text of the best match will be displayed at the end of the
input.
...And 6 more matches
CSS - Archive of obsolete content
it-linesthe -ms-hyphenate-limit-lines css property is a microsoft extension specifying the maximum number of consecutive lines in an element that may be ended with a hyphenated word.-ms-hyphenate-limit-zonethe -ms-hyphenate-limit-zone css property is a microsoft extension specifying the width of the hyphenation zone.-ms-ime-alignthe -ms-ime-align css property is a microsoft extension aligning the
input method editor (ime) candidate window box relative to the element on which the ime composition is active.
...however, those elements' ancestors have this pseudo-class applied to them.:-moz-system-metric()this page was auto-generated because a user created a sub-page to this page.::-ms-browsethe ::-ms-browse css pseudo-element is a microsoft extension that represents the button that opens the file picker of <
input type="file">.::-ms-checkthe ::-ms-check css pseudo-element is a microsoft extension that represents checkboxes and radio button groups created by <
input type="checkbox"> and <
input type="radio">.::-ms-clearthe ::-ms-clear css pseudo-element creates a clear button at the edge of an <
input type="text"> text control that clears the current value.
...a slider control is one possible representation of <
input type="range">.::-ms-fill-upperthe ::-ms-fill-upper css pseudo-element is a microsoft extension that represents the upper portion of the track of a slider control; that is, the portion corresponding to values greater than the value currently selected by the thumb.
...And 6 more matches
Manipulating documents - Learn web development
active learning: a dynamic shopping list to round off the article, we'd like to set you a little challenge — we want to make a simple shopping list example that allows you to dynamically add items to the list using a form
input and button.
... when you add an item to the
input and press the button: the item should appear in the list.
... the
input should be emptied and focused ready for you to enter another item.
...And 6 more matches
Ember app structure and componentization - Learn web development
to start with, delete the contents of application.hbs and replace them with the following: <section class="todoapp"> <h1>todos</h1> <
input class="new-todo" aria-label="what needs to be done?" placeholder="what needs to be done?" autofocus > </section> note: aria-label provides a label for assistive technology to make use of — for example, for a screenreader to read out.
... this is useful in such cases where we have an <
input> being used with no corresponding html text that could be turned into a label.
...update the application.hbs file again so its content looks like this: <section class="todoapp"> <h1>todos</h1> <
input class="new-todo" aria-label="what needs to be done?" placeholder="what needs to be done?" autofocus > <section class="main"> <
input id="mark-all-complete" class="toggle-all" type="checkbox"> <label for="mark-all-complete">mark all as complete</label> <ul class="todo-list"> <li> <div class="view"> <
input aria-label="toggle the com...
...And 6 more matches
nsIHTMLEditor
ng atagname); nsidomelement getselectioncontainer(); void ignorespuriousdragevent(in boolean aignorespuriousdragevent); void increasefontsize(); void indent(in astring aindent); void insertelementatselection(in nsidomelement aelement, in boolean adeleteselection); void insertfromdrop(in nsidomevent aevent); void inserthtml(in astring a
inputstring); void inserthtmlwithcontext(in astring a
inputstring, in astring acontextstr, in astring ainfostr, in astring aflavor, in nsidomdocument asourcedoc, in nsidomnode adestinationnode, in long adestinationoffset, in boolean adeleteselection); void insertlinkaroundselection(in nsidomelement aanchorelement); boolean isanonymouselement(in nsidomelement aelement); ...
...special
input value for links: use "href" to get a link node (an "a" tag with the "href" attribute set) return value the new element created.
... getelementorparentbytagname() return the
input node or a parent matching the given atagname, starting the search at the supplied node.
...And 6 more matches
Constraint validation API - Web APIs
concepts and usage certain html form controls, such as <
input>, <select> and <textarea>, can restrict the format of allowable values, using attributes like required and pattern to set basic constraints.
...therefore, you need to also validate
input values on the server side, in a way that is consistent with what is done on the client side.
... 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 html
inputelement htmlobjectelement htmloutputelement htmlselectelement htmltextareaelement properties validity a read-only property that returns a validitystate object, whose properties represent validation errors for the value of that element.
...And 6 more matches
PerformanceEventTiming - Web APIs
auxclick before
input click compositionend compositionstart compositionupdate contextmenu dblclick dragend dragenter dragleave dragover dragstart drop
input keydown keypress keyup mousedown mouseenter mouseleave mouseout mouseover mouseup pointerover pointerenter pointerdown pointerup pointercancel pointerout pointerleave gotpointercapture lostpointercapture touchstart touchend touchcancel properties performanceeventtiming.processingstart returns the time at which event dispatch started.
... examples the following example shows how to use the api for all events: const observer = new performanceobserver(function(list) { const perfentries = list.getentries().foreach(entry => { // full duration const
inputduration = entry.duration; //
input delay (before processing event) const
inputdelay = entry.processingstart - entry.starttime; // synchronous event processing time (between start and end dispatch).
... const
inputsyncprocessingtime = entry.processingend - entry.processingstart; }); }); // register observer for event.
...And 6 more matches
XRSession - Web APIs
inputsources read only returns a list of this session's xr
inputsources, each representing an
input device used to control the camera and/or scene.
...
inputsourceschange an event of type xr
inputsourceschangeevent sent to the xrsession when the list of active xr
input sources has changed.
... also available through the on
inputsourceschange event handler property.
...And 6 more matches
ime-mode - CSS: Cascading Style Sheets
the ime-mode css property controls the state of the
input method editor (ime) for text fields.
... values auto no change is made to the current
input method editor state.
... active the
input method editor is initially active; text entry is performed through it unless the user specifically dismisses it.
...And 6 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
caret-color the color to use when drawing the caret (sometimes referred to as the text
input cursor) within the element.
... this is only useful in elements that are editable, such as <
input> and <textarea> or elements whose html contenteditable attribute is set.
...it's generally used as a focus indicator, to show which element will receive
input events.
...And 6 more matches
HTML attribute: required - HTML: Hypertext Markup Language
the boolean required attribute which, if present, indicates that the user must specify a value for the
input before the owning form can be submitted.
... the required attribute is supported by text, search, url, tel, email, password, date, month, week, time, datetime-local, number, checkbox, radio, file, <
input> types along with the <select> and <textarea> form control elements.
... if present on any of these
input types and elements, the :required pseudo class will match.
...And 6 more matches
<form> - HTML: Hypertext Markup Language
instead, use the accept attribute on <
input type=file> elements.
... autocomplete indicates whether
input elements can by default have their values automatically completed by the browser.
...this value can be overridden by a formaction attribute on a <button>, <
input type="submit">, or <
input type="image"> element.
...And 6 more matches
Regular expressions - JavaScript
use the constructor function when you know the regular expression pattern will be changing, or you don't know the pattern and are getting it from another source, such as user
input.
...yre.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' ].
... ['dbbd', 'bb', index: 1,
input: 'cdbbdbsbz'] index the 0-based index of the match in the
input string.
...And 6 more matches
edgeMode - SVG: Scalable Vector Graphics
the edgemode attribute determines how to extend the
input image as necessary with color values so that the matrix operations can be applied when the kernel is positioned at or near the edge of the
input image.
... two elements are using this attribute: <feconvolvematrix> and <fegaussianblur> feconvolvematrix for <feconvolvematrix>, edgemode determines how to extend the
input image as necessary with color values so that the matrix operations can be applied when the kernel is positioned at or near the edge of the
input image.
... value duplicate | wrap | none default value duplicate animatable yes duplicate this value indicates that the
input image is extended along each of its borders as necessary by duplicating the color values at the given edge of the
input image.
...And 6 more matches
passwords - Archive of obsolete content
so: given a form at http://www.example.com/login with the following html: <form action="http://login.example.com/foo/authenticate.cgi"> <div>please log in.</div> <label>username:</label> <
input type="text" name="uname"> <label>password:</label> <
input type="password" name="pword"> </form> the corresponding values for the credential (excluding username and password) should be: url: "http://www.example.com" formsubmiturl: "http://login.example.com" usernamefield: "uname" passwordfield: "pword" note that for both url and formsubmiturl, the portion of the url after the h...
... usernamefield string the value of the name attribute for the user name
input field in a form.
... passwordfield string the value of the name attribute for the password
input field in a form.
...And 5 more matches
places/bookmarks - Archive of obsolete content
examples creating a new bookmark let { bookmark, save } = require("sdk/places/bookmarks"); // create a new bookmark instance, unsaved let bookmark = bookmark({ title: "mozilla", url: "http://mozilla.org" }); // attempt to save the bookmark instance to the bookmarks database // and store the emitter let emitter = save(bookmark); // listen for events emitter.on("data", function (saved,
inputitem) { // on a "data" event, an item has been updated, passing in the // latest snapshot from the server as `saved` (with properties // such as `updated` and `id`), as well as the initial
input // item as `
inputitem` console.log(saved.title ===
inputitem.title); // true console.log(saved !==
inputitem); // true console.log(
inputitem === bookmark); // true }).on("end", function (save...
...ditems,
inputitems) { // similar to "data" events, except "end" is an aggregate of // all progress events, with ordered arrays as `saveditems` // and `
inputitems` }); creating several bookmarks with a new group let { bookmark, group, save } = require("sdk/places/bookmarks"); let group = group({ title: "guitars" }); let bookmarks = [ bookmark({ title: "ran", url: "http://ranguitars.com", group: group }), bookmark({ title: "ibanez", url: "http://ibanez.com", group: group }), bookmark({ title: "esp", url: "http://espguitars.com", group: group }) ]; // save `bookmarks` array -- notice we don't have `group` in the array, // although it needs to be saved since all bookmarks are children // of `group`.
... save(bookmarks).on("data", function (saved,
input) { // a data event is called once for each item saved, as well // as implicit items, like `group` console.log(
input === group || ~bookmarks.indexof(
input)); // true }).on("end", function (saves,
inputs) { // like the previous example, the "end" event returns an // array of all of our updated saves.
...And 5 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
if you want to also make your add-on extractionless then you may need "step 3" if you're loading files with nsifile
inputstream or something similar, or a jar: uri might work.
...the first is to use the nsizipreader interface which permits continuing to use nsi
inputstreams, etc.
...re a constant with your id components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid(myaddonid,function(addon) { var file = services.io.newuri("resource://myaddon/filename.ext",null,null) .queryinterface(components.interfaces.nsifileurl) .file; var stream = components.classes["@mozilla.org/network/file-
input-stream;1"] .createinstance(components.interfaces.nsifile
inputstream) .queryinterface(components.interfaces.nsiseekablestream); stream.init(file, 0x01, 0444, 0); // read-only, read by owner/group/others, normal behavior /* do stuff */ }); this bit of code is paraphrased and probably not to be recommended as-is, but it should work.
...And 5 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
listing 13: reading the contents of a binary file file.initwithpath('c:\\temp\\temp.txt'); var filestream = components.classes['@mozilla.org/network/file-
input-stream;1'] .createinstance(components.interfaces.nsifile
inputstream); filestream.init(file, 1, 0, false); var binarystream = components.classes['@mozilla.org/binary
inputstream;1'] .createinstance(components.interfaces.nsibinary
inputstream); binarystream.set
inputstream(filestream); var array = binarystream.readbytearray(filestream.available()); binarystream.clos...
...e(); filestream.close(); alert(array.map( function(aitem) {return aitem.tostring(16); } ).join(' ').touppercase( )); when we initialized nsifile
inputstream, we set the second and third parameters to initialize it in read-only mode.
...here, we're outputting a text file consisting of the ascii characters "xul." when we initialized nsifile
inputstream, we set the second and third parameters to initialize it in write-only mode.
...And 5 more matches
HTML: A good basis for accessibility - Learn web development
"200"> <a href="#" align="center">home</a> </td> <td width="200"> <a href="#" align="center">our team</a> </td> <td width="200"> <a href="#" align="center">projects</a> </td> <td width="200"> <a href="#" align="center">contact</a> </td> <td width="300"> <form width="300"> <
input type="search" name="q" placeholder="search query" width="300"> </form> </td> <td width="100"> <button width="100">go!</button> </td> </tr> <!-- spacer row --> <tr id="spacer" height="10"> <td> </td> </tr> <!-- main content and aside row --> <tr id="main"> <td id="content" colspan="4" bgcolor="...
... you can then press enter/return to follow a focused link or press a button (we've included some javascript to make the buttons alert a message), or start typing to enter text in a text
input.
...s://developer.mozilla.org">mozilla developer network</a>.</p> <h2>buttons</h2> <p> <button data-message="this is from the first button">click me!</button> <button data-message="this is from the second button">click me too!</button> <button data-message="this is from the third button">and me!</button> </p> <h2>form</h2> <form> <div> <label for="name">fill in your name:</label> <
input type="text" id="name" name="name"> </div> <div> <label for="age">enter your age:</label> <
input type="text" id="age" name="age"> </div> <div> <label for="mood">choose your mood:</label> <select id="mood" name="mood"> <option>happy</option> <option>sad</option> <option>angry</option> <option>worried</option> </select> </div> </form> this means...
...And 5 more matches
HTML: A good basis for accessibility - Learn web development
"200"> <a href="#" align="center">home</a> </td> <td width="200"> <a href="#" align="center">our team</a> </td> <td width="200"> <a href="#" align="center">projects</a> </td> <td width="200"> <a href="#" align="center">contact</a> </td> <td width="300"> <form width="300"> <
input type="search" name="q" placeholder="search query" width="300"> </form> </td> <td width="100"> <button width="100">go!</button> </td> </tr> <!-- spacer row --> <tr id="spacer" height="10"> <td> </td> </tr> <!-- main content and aside row --> <tr id="main"> <td id="content" colspan="4" bgcolor="...
... you can then press enter/return to follow a focused link or press a button (we've included some javascript to make the buttons alert a message), or start typing to enter text in a text
input.
...s://developer.mozilla.org">mozilla developer network</a>.</p> <h2>buttons</h2> <p> <button data-message="this is from the first button">click me!</button> <button data-message="this is from the second button">click me too!</button> <button data-message="this is from the third button">and me!</button> </p> <h2>form</h2> <form> <div> <label for="name">fill in your name:</label> <
input type="text" id="name" name="name"> </div> <div> <label for="age">enter your age:</label> <
input type="text" id="age" name="age"> </div> <div> <label for="mood">choose your mood:</label> <select id="mood" name="mood"> <option>happy</option> <option>sad</option> <option>angry</option> <option>worried</option> </select> </div> </form> this means...
...And 5 more matches
Making decisions in your code — conditionals - Learn web development
overview: building blocks next in any programming language, the code needs to make decisions and carry out actions accordingly depending on different
inputs.
... in such a case, switch statements are your friend — they take a single expression/value as an
input, and then look through a number of choices until they find one that matches that value, executing the corresponding code that goes along with it.
...we also have a function called update(), which takes two colors as parameters (
inputs).
...And 5 more matches
Client-side storage - Learn web development
add the following lines to your javascript file: // create needed constants const rememberdiv = document.queryselector('.remember'); const forgetdiv = document.queryselector('.forget'); const form = document.queryselector('form'); const name
input = document.queryselector('#entername'); const submitbtn = document.queryselector('#submitname'); const forgetbtn = document.queryselector('#forgetname'); const h1 = document.queryselector('h1'); const personalgreeting = document.queryselector('.personal-greeting'); next up, we need to include a small event listener to stop the form from actually submitting itself when the submit button is ...
...the comments explain in detail what each bit does, but in essence here we are taking the name the user has entered into the text
input box and saving it in web storage using setitem(), then running a function called namedisplaycheck() that will handle updating the actual website text.
... add this to the bottom of your code: // run function when the 'say hello' button is clicked submitbtn.addeventlistener('click', function() { // store the entered name in web storage localstorage.setitem('name', name
input.value); // run namedisplaycheck() to sort out displaying the // personalized greetings and updating the form display namedisplaycheck(); }); at this point we also need an event handler to run a function when the "forget" button is clicked — this is only displayed after the "say hello" button has been clicked (the two form states toggle back and forth).
...And 5 more matches
Arrays - Learn web development
t:14.99' 'trousers:31.99' 'shoes:23.99'; for (let i = 0; i <= 0; i++) { // number 2 // number 3 // number 4 // number 5 let itemtext = 0; const listitem = document.createelement('li'); listitem.textcontent = itemtext; list.appendchild(listitem); } totalbox.textcontent = 'total: $' + total.tofixed(2); </textarea> <div class="playable-buttons"> <
input id="reset" type="button" value="reset"> <
input id="solution" type="button" value="show solution"> </div> const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('cli...
...y = products[i].split(\':\');\n let name = subarray[0];\n let price = number(subarray[1]);\n total += price;\n let itemtext = name + \' — $\' + price;\n\n let listitem = document.createelement(\'li\');\n listitem.textcontent = itemtext;\n list.appendchild(listitem);\n}\n\ntotalbox.textcontent = \'total: $\' + total.tofixed(2);'; let solutionentry = jssolution; textarea.addeventlistener('
input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; ...
... to complete the app, we need you to: add a line below the // number 1 comment that adds the current value entered into the search
input to the start of the array.
...And 5 more matches
Accessibility in React - Learn web development
exploring the keyboard usability problem start by clicking on the
input at the top of our app, as if you're going to add a new task.
... you'll see a thick, dashed outline around that
input.
...press the tab key, and you will see the outline appear around the "add" button beneath the
input.
...And 5 more matches
Creating our first Vue component - Learn web development
<template> <div> <
input type="checkbox" id="todo-item" checked="false" /> <label for="todo-item">my todo item</label> </div> </template> using todoitem inside our app this is all fine, but we haven’t added the component to our app yet, so there’s no way to test it and see if everything is working.
...you can think of props as being similar to
inputs in a function.
... your component’s template section should now look like this: <template> <div> <
input type="checkbox" id="todo-item" checked="false" /> <label for="todo-item">{{label}}</label> </div> </template> go back to your browser and you'll see the todo item rendered as before, but without a label (oh no!).
...And 5 more matches
nsIOutputStream
method overview void close(); void flush(); boolean isnonblocking(); unsigned long write(in string abuf, in unsigned long acount); unsigned long writefrom(in nsi
inputstream afromstream, in unsigned long acount); unsigned long writesegments(in nsreadsegmentfun areader, in voidptr aclosure, in unsigned long acount); native code only!
... exceptions thrown ns_base_stream_would_block if writing to the output stream would block the calling thread (non-blocking mode only) writefrom() this method copies data from an nsi
inputstream to this nsioutputstream.
... note: this method is defined by this interface in order to allow the output stream to efficiently copy the data from the
input stream into its internal buffer (if any).
...And 5 more matches
nsIPipe
xpcom/io/nsipipe.idlscriptable this interface represents an in-process buffer that can be read using nsi
inputstream and written using nsioutputstream.
... inherits from: nsisupports last changed in gecko 1.6 method overview void init(in boolean nonblocking
input, in boolean nonblockingoutput, in unsigned long segmentsize, in unsigned long segmentcount, in nsimemory segmentallocator); attributes attribute type description
inputstream nsiasync
inputstream the pipe's
input end, which also implements nsisearchable
inputstream.
...void init( in boolean nonblocking
input, in boolean nonblockingoutput, in unsigned long segmentsize, in unsigned long segmentcount, in nsimemory segmentallocator ); parameters nonblocking
input true specifies non-blocking
input stream behavior.
...And 5 more matches
AudioProcessingEvent - Web APIs
the web audio api audioprocessingevent represents events that occur when a scriptprocessornode
input buffer is ready to be processed.
... playbacktime read only double the time when the audio will be played, as defined by the time of audiocontext.currenttime
inputbuffer read only audiobuffer the buffer containing the
input audio data to be processed.
... the number of channels is defined as a parameter, numberof
inputchannels, of the factory method audiocontext.createscriptprocessor().
...And 5 more matches
BaseAudioContext.createScriptProcessor() - Web APIs
syntax var scriptprocessor = audioctx.createscriptprocessor(buffersize, numberof
inputchannels, numberofoutputchannels); parameters buffersize the buffer size in units of sample-frames.
... numberof
inputchannels integer specifying the number of channels for this node's
input, defaults to 2.
... note: it is invalid for both numberof
inputchannels and numberofoutputchannels to be zero.
...And 5 more matches
HTMLFormElement - Web APIs
named
inputs are added to their owner form instance as properties, and can overwrite native properties if they share the same name (e.g.
... a form with an
input named action will have its action property return that
input instead of the form's action html attribute).
... for example: <
input name="id"> will take precedence over <form id="…">.
...And 5 more matches
Recording a media element - Web APIs
" for " + (lengthinms/1000) + " seconds..."); let stopped = new promise((resolve, reject) => { recorder.onstop = resolve; recorder.onerror = event => reject(event.name); }); let recorded = wait(lengthinms).then( () => recorder.state == "recording" && recorder.stop() ); return promise.all([ stopped, recorded ]) .then(() => data); } startrecording() takes two
input parameters: a mediastream to record from and the length in milliseconds of the recording to make.
... line 2 creates the mediarecorder that will handle recording the
input stream.
...the rejection handler receives as
input the name of the error that occurred.
...And 5 more matches
Using Touch Events - Web APIs
today, most web content is designed for keyboard and mouse
input.
... however, devices with touch screens (especially portable devices) are mainstream and web applications can either directly process touch-based
input by using touch events or the application can use interpreted mouse events for the application
input.
... a disadvantage to using mouse events is that they do not support concurrent user
input, whereas touch events support multiple simultaneous
inputs (possibly at different locations on the touch surface), thus enhancing user experiences.
...And 5 more matches
ValidityState.typeMismatch - Web APIs
the read-only typemismatch property of a validitystate object indicates if the value of an <
input>, after having been edited by the user, does not conform to the constraints set by the element's type attribute.
... the email
input type expects one or more valid email addresses, depending on whether the multiple attribute is present.
...if the value of the email
input is not an empty string, a single valid e-mail address, or one or more comma separated email address if the multiple attribute is present, there is a typemismatch.
...And 5 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
mouse_speed a multiplier used to scale the
inputs from the mouse used for pitch and yaw control.
... setup and utility functions next, we declare the variables and constants used throughout the application, starting with those used to store webgl and webxr specific information: let polyfill = null; let xrsession = null; let xr
inputsources = null; let xrreferencespace = null; let xrbutton = null; let gl = null; let animationframerequestid = 0; let shaderprogram = null; let programinfo = null; let buffers = null; let texture = null; let mouseyaw = 0; let mousepitch = 0; this is followed by a set of constants, mostly to contain various vectors and matrices used while rendering the scene.
... function logglerror(where) { let err = gl.geterror(); if (err) { console.error(`webgl error returned by ${where}: ${err}`); } } this takes as its only
input a string, where, which is used to indicate what part of the program generated the error, since similar errors can have in multiple situations.
...And 5 more matches
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.
... since our scripts are playing audio in response to a user
input event (a click on a play button, for instance), we're in good shape and should have no problems from autoplay blocking.
...we have a play button that changes to a pause button when the track is playing: <button data-playing="false" role="switch" aria-checked="false"> <span>play/pause</span> </button> before we can play our track we need to connect our audio graph from the audio source/
input node to the destination.
...And 5 more matches
:valid - CSS: Cascading Style Sheets
the :valid css pseudo-class represents any <
input> or other <form> element whose contents validate successfully.
... /* selects any valid <
input> */
input:valid { background-color: powderblue; } this pseudo-class is useful for highlighting correct fields for the user.
... syntax :valid examples indicating valid and invalid form fields in this example, we use structures like this, which include extra <span>s to generate content on; we'll use these to provide indicators of valid/invalid data: <div> <label for="fname">first name *: </label> <
input id="fname" name="fname" type="text" required> <span></span> </div> to provide these indicators, we use the following css:
input + span { position: relative; }
input + span::before { position: absolute; right: -20px; top: 5px; }
input:invalid { border: 2px solid red; }
input:invalid + span::before { content: '✖'; color: red; }
input:valid + span::before { content: '✓'; color: green; } we set the <span>s to position: relative so that we can position the generated content relative to...
...And 5 more matches
Event reference
submit the submit button is pressed printing events event name fired when beforeprint the print dialog is opened afterprint the print dialog is closed text composition events event name fired when compositionstart the composition of a passage of text is prepared (similar to keydown for a keyboard
input, but works with other
inputs such as speech recognition).
... media events event name fired when audioprocess the
input buffer of a scriptprocessornode is ready to be processed.
... storage events change (see non-standard events) storage update events checking downloading error noupdate obsolete updateready value change events broadcast checkboxstatechange hashchange
input radiostatechange readystatechange valuechange uncategorized events invalid message message open show less common and non-standard events abortable fetch events event name fired when abort a dom request is aborted, i.e.
...And 5 more matches
Content categories - Developer guides
they are: <a>, <abbr>, <address>, <article>, <aside>, <audio>, <b>,<bdo>, <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).
... some elements belong to this category only under specific conditions: <audio>, if the controls attribute is present <img>, if the usemap attribute is present <
input>, if the type attribute is not in the hidden state <menu>, if the type attribute is in the toolbar state <object>, if the usemap attribute is present <video>, if the controls attribute is present palpable content content is palpable when it's neither empty or hidden; it is content that is rendered and is substantive.
...And 5 more matches
HTML attribute: pattern - HTML: Hypertext Markup Language
the pattern attribute is an attribute of the text, tel, email, url, password, and search
input types.
... the pattern attribute, when specified, is a regular expression which the
input's value must match in order for the value to pass constraint validation.
... some of the
input types supporting the pattern attribute, notably the email and url
input types, have expected value syntaxes that must be matched.
...And 5 more matches
Miscellaneous - Archive of obsolete content
var focusedcontrol; window.addeventlistener("load", function(e) { onwindowload(e); }, false); function onwindowload() { gbrowser.addeventlistener("load", onpageload, true); } function onpageload() { pagedoc = document.commanddispatcher.focusedwindow.document; var
inputlist = pagedoc.getelementsbytagname('
input'); for (var i=1; i<
inputlist.length; i++) {
inputlist.item(i).
... addeventlistener("focus", function(e) {onfocus
input(e);}, false);
inputlist.item(i).
... addeventlistener("blur", function(e) {onblur
input(e);}, false); } } function onfocus
input(focusevent) { focusedcontrol = focusevent.originaltarget; } function onblur
input(blurevent) { focusedcontrol = null; } or var element = document.commanddispatcher.focusedelement; inserting text at the cursor function inserttext(element, snippet) { var selectionend = element.selectionstart + snippet.length; var currentvalue = element.value; var beforetext = currentvalue.substring(0, element.selectionstart); var aftertext = currentvalue.substring(element.selectionend, currentvalue.length); element.value = beforetext + snippet + aftertext; element.focus(); //put the cursor after the inserted text element.setselectionrange(selectionend, selectionend); } inserttext(documen...
...And 4 more matches
Website security - Learn web development
the process of modifying user data so that it can't be used to run scripts or otherwise affect the execution of server code is known as
input sanitization.
... many web frameworks automatically sanitize user
input from html forms by default.
... this vulnerability is present if user
input that is passed to an underlying sql statement can change the meaning of the statement.
...And 4 more matches
Ember interactivity: Events, classes and state - Learn web development
creating todos for our card-header / todo
input, we'll want to be able to submit our typed in todo task when we press the enter key and have it appear in the todos list.
... we want to be able to capture the text typed into the
input.
... add the new line shown below to your header.hbs file: <
input class='new-todo' aria-label='what needs to be done?' placeholder='what needs to be done?' autofocus {{on 'keydown' this.onkeydown}} > this new attribute is inside double curly braces, which tells you it is part of ember's dynamic templating syntax.
...And 4 more matches
Componentizing our React app - Learn web development
go back to src/app.js, copy the first <li> from inside the unordered list, and paste it into todo.js so that it reads like this: export default function todo() { return ( <li classname="todo stack-small"> <div classname="c-cb"> <
input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-label" htmlfor="todo-0"> eat </label> </div> <div classname="btn-group"> <button type="button" classname="btn"> edit <span classname="visually-hidden">eat</span> </button> <button type="button" classname="btn btn__danger"> delete <span class...
... putting all that together, your todo() function should read like this: export default function todo(props) { return ( <li classname="todo stack-small"> <div classname="c-cb"> <
input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-label" htmlfor="todo-0"> {props.name} </label> </div> <div classname="btn-group"> <button type="button" classname="btn"> edit <span classname="visually-hidden">{props.name}</span> </button> <button type="button" classname="btn btn__danger"> ...
...change the defaultchecked attribute on the <
input /> so that its value is equal to the completed prop.
...And 4 more matches
Vue conditional rendering: editing existing todos - Learn web development
copy the following code into that file: <template> <form class="stack-small" @submit.prevent="onsubmit"> <div> <label class="edit-label">edit name for "{{label}}"</label> <
input :id="id" type="text" autocomplete="off" v-model.lazy.trim="newlabel" /> </div> <div class="btn-group"> <button type="button" class="btn" @click="oncancel"> cancel <span class="visually-hidden">editing {{label}}</span> </button> <button type="submit" class="btn btn__primary"> save <span class="visually-hidden">edit for {{label}}</span> ...
... if (this.newlabel && this.newlabel !== this.label) { this.$emit("item-edited", this.newlabel); } }, oncancel() { this.$emit("edit-cancelled"); } } }; </script> <style scoped> .edit-label { font-family: arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #0b0c0c; display: block; margin-bottom: 5px; }
input { display: inline-block; margin-top: 0.4rem; width: 100%; min-height: 4.4rem; padding: 0.4rem 0.8rem; border: 2px solid #565656; } form { display: flex; flex-direction: row; flex-wrap: wrap; } form > * { flex: 0 0 100%; } </style> note: walk through the above code then read the below description to make sure you understand everything the component is doing before moving on.
...we create a form with an <
input> field for editing the name of our to-do.
...And 4 more matches
Focus management with Vue refs - Learn web development
you should see a focus outline on the
input for adding new to-do items.
... vue lifecycle methods next, we need to move focus to the edit form’s <
input> element when the "edit" button is clicked.
... in todoitemeditform.vue, attach ref="label
input" to the <
input> element, like so: <
input :id="id" ref="label
input" type="text" autocomplete="off" v-model.lazy.trim="newname" /> next, add a mounted() property just inside your component object — note that this should not be put inside the methods property, but rather at the same hierarchy level as props, data(), and methods.
...And 4 more matches
Handling common HTML and CSS problems - Learn web development
html5 form elements also exhibit fallback qualities — html5 introduced some special <
input> types for
inputting specific information into forms, such as times, dates, colors, numbers, etc.
...supporting platforms provide special ui widgets when these
input types are used, such as a calendar widget for entering dates.
... 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> <div> <label for="date">enter a date:</label> <
input id="date" type="date"> </div> <div> <label for...
...And 4 more matches
Accessibility information for UI designers and developers
see also: understanding sc 1.4.3: contrast the focus indicator users who navigate by keyboard (or other specialised
input methods), rely on focus styles to see where they are on the page.
...this includes form elements like
inputs and select boxes, but also buttons.
... for form elements, it should be clear what kind of
input is expected.
...And 4 more matches
nsIDOMWindowUtils
focused
inputtype string the type of the currently-focused html <
input> element, if one is focused.
...on gtk2, users can use "simple ime" which only supports dead key
inputting.
... composition_attr_raw
input 0x02 synthesize a text event to the window.
...And 4 more matches
nsISelectionPrivate
allowadjacent specifies whether the returned ranges are allowed to touch the
input range rather than merely overlapping it.
... resultcount returns the number of ranges that overlap (or touch) the
input range.
... results returns the ranges that overlap (or touch) the
input range.
...And 4 more matches
XPCOM Interface Reference
accessibletextnsiaccessibletextchangeeventnsiaccessibletreecachensiaccessiblevaluensiaccessiblewin32objectnsialertsservicensiannotationobservernsiannotationservicensiappshellnsiappshellservicensiappstartupnsiappstartup_mozilla_2_0nsiapplicationcachensiapplicationcachechannelnsiapplicationcachecontainernsiapplicationcachenamespacensiapplicationcacheservicensiapplicationupdateservicensiarraynsiasync
inputstreamnsiasyncoutputstreamnsiasyncstreamcopiernsiasyncverifyredirectcallbacknsiauthinformationnsiauthmodulensiauthpromptnsiauthprompt2nsiauthpromptadapterfactorynsiauthpromptcallbacknsiauthpromptprovidernsiauthpromptwrappernsiautocompletecontrollernsiautocomplete
inputnsiautocompleteitemnsiautocompletelistenernsiautocompleteobservernsiautocompleteresultnsiautocompletesearchnsibadcertlistener2nsibid...
...ikeyboardnsibinary
inputstreamnsibinaryoutputstreamnsiblocklistpromptnsiblocklistservicensiboxobjectnsibrowserboxobjectnsibrowserhistorynsibrowsersearchservicensicrlinfonsicrlmanagernsicachensicachedeviceinfonsicacheentrydescriptornsicacheentryinfonsicachelistenernsicachemetadatavisitornsicacheservicensicachesessionnsicachevisitornsicachingchannelnsicancelablensicategorymanagernsichannelnsichanneleventsinknsichannelpolicynsicharsetresolvernsichromeframemessagemanagernsichromeregistrynsiclassinfonsiclipboardnsiclipboardcommandsnsiclipboarddragdrophooklistnsiclipboarddragdrophooksnsiclipboardhelpernsiclipboardownernsicollectionnsicommandcontrollernsicommandlinensicommandlinehandlernsicommandlinerunnernsicomponentmanagernsicomponentregistrarnsicompositionstringsynthesizernsiconsolelistenernsiconsol...
...emessagensiconsoleservicensicontainerboxobjectnsicontentframemessagemanagernsicontentprefnsicontentprefcallback2nsicontentprefobservernsicontentprefservicensicontentprefservice2nsicontentsecuritypolicynsicontentsniffernsicontentviewnsicontentviewmanagernsicontentviewernsicontrollernsicontrollersnsiconverter
inputstreamnsiconverteroutputstreamnsicookiensicookie2nsicookieacceptdialognsicookieconsentnsicookiemanagernsicookiemanager2nsicookiepermissionnsicookiepromptservicensicookieservicensicookiestoragensicrashreporternsicryptohmacnsicryptohashnsicurrentcharsetlistenernsicyclecollectorlistenernsidbchangelistenernsidbfolderinfonsidnslistenernsidnsrecordnsidnsrequestnsidnsservicensidomcanvasrenderingcontext2dnsidomchromewindownsidomclientrectnsidomdesktopnotificationnsidomdesktopnotificationcenterns...
...And 4 more matches
FileList - Web APIs
an object of this type is returned by the files property of the html <
input> element; this lets you access the list of files selected with the <
input type="file"> element.
... note: prior to gecko 1.9.2, the
input element only supported a single file being selected at a time, meaning that the filelist would contain only one file.
... starting with gecko 1.9.2, if the
input element's multiple attribute is true, the filelist may contain multiple files.
...And 4 more matches
Using IndexedDB - Web APIs
> <div class="note"> <p> works and tested with: </p> <div id="compat"> </div> </div> <div id="msg"> </div> <form id="register-form"> <table> <tbody> <tr> <td> <label for="pub-title" class="required"> title: </label> </td> <td> <
input type="text" id="pub-title" name="pub-title" /> </td> </tr> <tr> <td> <label for="pub-biblioid" class="required"> bibliographic id:<br/> <span class="note">(isbn, issn, etc.)</span> </label> </td> <td> <
input type="text" id="pub-biblioid" name="pub-biblioid"...
.../> </td> </tr> <tr> <td> <label for="pub-year"> year: </label> </td> <td> <
input type="number" id="pub-year" name="pub-year" /> </td> </tr> </tbody> <tbody> <tr> <td> <label for="pub-file"> file image: </label> </td> <td> <
input type="file" id="pub-file"/> </td> </tr> <tr> <td> <label for="pub-file-url"> online-file image url:<br/> <span class="note">(same origin url)</span> </label> </td> <td> ...
... <
input type="text" id="pub-file-url" name="pub-file-url"/> </td> </tr> </tbody> </table> <div class="button-pane"> <
input type="button" id="add-button" value="add publication" /> <
input type="reset" id="register-form-reset"/> </div> </form> <form id="delete-form"> <table> <tbody> <tr> <td> <label for="pub-biblioid-to-delete"> bibliographic id:<br/> <span class="note">(isbn, issn, etc.)</span> </label> </td> <td> <
input type="text" id="pub-biblioid-to-delete" name="pub-biblioid-to-delete" /> </td> </tr> <tr> <td> ...
...And 4 more matches
KeyboardEvent.key - Web APIs
if the key produces a character key that would result in a character being inserted into possibly an <
input>, <textarea> or an element with htmlelement.contenteditable set to true, the before
input and
input event types are fired in that order.
...tnclearconsole = document.getelementbyid('btn-clear-console'); function logmessage(message) { document.getelementbyid("console-log").innerhtml += message + "<br>"; } textarea.addeventlistener('keydown', (e) => { if (!e.repeat) logmessage(`key "${e.key}" pressed [event: keydown]`); else logmessage(`key "${e.key}" repeating [event: keydown]`); }); textarea.addeventlistener('before
input', (e) => { logmessage(`key "${e.data}" about to be
input [event: before
input]`); }); textarea.addeventlistener('
input', (e) => { logmessage(`key "${e.data}"
input [event:
input]`); }); textarea.addeventlistener('keyup', (e) => { logmessage(`key "${e.key}" released [event: keyup]`); }); btnclearconsole.addeventlistener('click', (e) => { let child = consolelog.firstchild; while (chi...
...ld) { consolelog.removechild(child); child = consolelog.firstchild; } }); result note: on browsers that don't fully implement the
inputevent interface which is used for the before
input and
input events, you may get incorrect output on those lines of the log output.
...And 4 more matches
MediaDevices.ondevicechange - Web APIs
syntax mediadevices.ondevicechange = eventhandler; value a function you provide which accepts as
input a event object describing the devicechange event that occurred.
...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...
...And 4 more matches
SubtleCrypto.deriveKey() - Web APIs
basekey is a cryptokey representing the
input to the derivation algorithm.
...they can then use this shared secret as a symmetric key to secure their communication, or can use the secret as an
input to derive such a key (for example, using the hkdf algorithm).
...it's designed to derive key material from some high-entropy
input, such as the output of an ecdh key agreement operation.
...And 4 more matches
Using the Web Speech API - Web APIs
the <select> element is initially empty, but is populated with <option>s via javascript (see later on.) <h1>speech synthesiser</h1> <p>enter some text in the
input below and press return to hear it.
... change voices using the dropdown menu.</p> <form> <
input type="text" class="txt"> <div> <label for="rate">rate</label><
input type="range" min="0.5" max="2" value="1" step="0.1" id="rate"> <div class="rate-value">1</div> <div class="clearfix"></div> </div> <div> <label for="pitch">pitch</label><
input type="range" min="0" max="2" value="1" step="0.1" id="pitch"> <div class="pitch-value">1</div> <div class="clearfix"></div> </div> <select> </select> </form> javascript let's investigate the javascript that powers this app.
... var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('.txt'); var voiceselect = document.queryselector('select'); var pitch = document.queryselector('#pitch'); var pitchvalue = document.queryselector('.pitch-value'); var rate = document.queryselector('#rate'); var ratevalue = document.queryselector('.rate-value'); var voices = []; populating the select element to populate the <select> element with the different voice options t...
...And 4 more matches
XRHandedness - Web APIs
the webxr enumerated type xrhandedness provides values which identify which of a user's hands is being used to operate a particular
input controller attached to the xr
input device being used.
... xrhandedness is used as the value of the the xr
inputsource property handedness.
... values none the
input controller is not associated with one of the user's hands.
...And 4 more matches
ARIA: search role - Accessibility
<form role="search"> <!-- search
input --> </form> description the search role is a landmark.
...while there is a
input of type search, there is html element that defines a search landmark.
... examples <form id="search" role="search"> <label for="search-
input">search this site</label> <
input type="search" id="search-
input" name="search" spellcheck="false"> <
input value="submit" type="submit"> </form> accessibility concerns landmark roles are intended to be used sparingly, to identify larger overall sections of the document.
...And 4 more matches
The HTML autocomplete attribute - HTML: Hypertext Markup Language
the html autocomplete attribute is available on <
input> elements that take a text or numeric value as
input, <textarea> elements, <select> elements, and <form> elements.
... if an <
input>, <select> or <textarea> element has no autocomplete attribute, then browsers use the autocomplete attribute of the element's form owner, which is either the <form> element that the element is a descendant of, or the <form> whose id is specified by the form attribute of the element.
... in order to provide autocompletion, user-agents might require <
input>/<select>/<textarea> elements to: have a name and/or id attribute be descendants of a <form> element the form to have a submit button values "off" the browser is not permitted to automatically enter or select a value for this field.
...And 4 more matches
<button>: The Button element - HTML: Hypertext Markup Language
autofocus html5 this boolean attribute specifies that the button should have
input focus when the page loads.
... multipart/form-data: use to submit <
input> elements with their type attributes set to file.
... this attribute is also available on <
input type="image"> and <
input type="submit"> elements.
...And 4 more matches
<textarea> - HTML: Hypertext Markup Language
the <textarea> element also accepts several attributes common to form <
input>s, such as autocomplete, autofocus, disabled, placeholder, readonly, and required.
...the form owner is either the <form> element that this <textarea> element is a descendant of or the form element whose id is specified by the form attribute of the
input element.
... autofocus this boolean attribute lets you specify that a form control should have
input focus when the page loads.
...And 4 more matches
Assertions - JavaScript
boundary-type assertions characters meaning ^ matches the beginning of
input.
... $ matches the end of
input.
... matching the beginning of
input using a ^ control character use ^ for matching at the beginning of
input.
...And 4 more matches
How to turn off form autocompletion - Web security
by default, browsers remember information that the user submits through <
input> fields on websites.
... note that the wcag 2.1 success criterion 1.3.5: identify
input purpose does not require that autocomplete/autofill actually work - merely that form fields that relate to specific personal user information are programmatically identified.
... disabling autocompletion to disable autocompletion in forms, you can set the autocomplete attribute to "off": autocomplete="off" you can do this either for an entire form, or for specific
input elements in a form: <form method="post" action="/form" autocomplete="off"> […] </form> <form method="post" action="/form"> […] <div> <label for="cc">credit card:</label> <
input type="text" id="cc" name="cc" autocomplete="off"> </div> </form> setting autocomplete="off" on fields has two effects: it tells the browser not to save data
inputted by the user for later autocompletion on similar forms,...
...And 4 more matches
Inline options - Archive of obsolete content
<!-- boolean stored as an integer --> <setting pref="extensions.myaddon.boolint" type="boolint" title="boolean 3" on="1" off="2"/> <!-- integer example --> <setting pref="extensions.myaddon.int" type="integer" title="integer"/> <!-- string examples --> <setting pref="extensions.myaddon.text" type="string" title="text"/> <setting pref="extensions.myaddon.password" type="string" title="password"
inputtype="password"/> <!-- color example --> <setting pref="extensions.myaddon.color" type="color" title="color"/> <!-- file and directory examples --> <setting pref="extensions.myaddon.file" type="file" title="file"/> <setting pref="extensions.myaddon.directory" type="directory" title="directory"/> <!-- list example (this example would be stored as an integer) --> <setting pref="extensions.myaddon...
... value="true" label="enabled"/> </radiogroup> </setting> <!-- button example - not tied to a preference, but attached to a command --> <setting title="do something" type="control"> <button id="myaddon-button" label="click me" oncommand="alert('thank you!');"/> </setting> setting element changed notifications most of the setting elements (it might be all i havent really looked), support on
inputchanged attribute.
... so like for the type="file", once a user browses and picks a file, when it updates the label it will trigger the on
inputchanged attribute.
...And 3 more matches
Adding windows and dialogs - Archive of obsolete content
others unprivileged javascript can also use the window.prompt function to receive text
input from the user.
... the prompt service has a very rich set of functions that allow different kinds of
inputs, such as text, passwords, usernames and passwords, and checkboxes that can be used for "never ask this again"-type dialogs.
...
input controls most additional xul windows and dialogs in extensions are some kind of
input form.
...And 3 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.
...so if you want an
input bound to an instance node of type integer (and all types derived from integer), you would use: @namespace xf url(http://www.w3.org/2002/xforms); @namespace moztype url(http://www.mozilla.org/projects/xforms/2005/type); xf|
input[moztype|typelist~="http://www.w3.org/2001/xmlschema#integer"] { -moz-binding: url('chrome://xforms/content/
input-xhtml.xml#xformswidget-
input-integer'); } advanced xfo...
...to give you an idea of what we are talking about, it could look something like this: <content> <xf:
input xbl:inherits="ref=ref1" anonid="ref1"/> <xf:
input xbl:inherits="ref=ref2" anonid="ref2"/> </content> <implementation> <method name="refresh"> <body> // here we should refresh custom control.
...And 3 more matches
State machine - MDN Web Docs Glossary: Definitions of Web-related terms
a state machine reads a set of
inputs and changes to a different state based on those
inputs.
... looking at the final state, you can discern something about the series of
inputs leading to that state.
... there are two types of basic state machines: deterministic finite state machine this kind allows only one possible transition for any allowed
input.
...And 3 more matches
Mobile accessibility - Learn web development
user
input — make user
input requirements as painless as possible on mobile (e.g., in forms, keep typing to a minimum).
... user
input on mobile devices,
inputting data tends to be more annoying for users than the equivalent experience on desktop computers.
... it is more convenient to type text into form
inputs using a desktop or laptop keyboard than a touchscreen virtual keyboard or a tiny mobile physical keyboard.
...And 3 more matches
Introduction to CSS layout - Learn web development
each
input element has a label, and we've also included a caption inside a paragraph.
... each label/
input pair is wrapped in a <div>, for layout purposes.
... <form> <p>first of all, tell us your name and age.</p> <div> <label for="fname">first name:</label> <
input type="text" id="fname"> </div> <div> <label for="lname">last name:</label> <
input type="text" id="lname"> </div> <div> <label for="age">age:</label> <
input type="text" id="age"> </div> </form> now, the css for our example.
...And 3 more matches
Practical positioning examples - Learn web development
let's have a look at the html in the file: <label for="toggle">❔</label> <
input type="checkbox" id="toggle"> <aside> ...
... </aside> to start with here we've got a <label> element and an <
input> element — <label> elements are normally used to associate a text label with a form element for accessibility purposes (allowing a screen user to see what description goes with what form element).
... here it is associated with the <
input> checkbox using the for and id attributes.
...And 3 more matches
How to build custom form controls - Learn web development
remember, if you want to provide the same functionality as the existing native <select>, it should behave the exact same way as the select for all users, from keyboard to mouse to touch to screen reader, and any other
input device.
...when it comes to standardized elements, of which the <select> is one, the specification authors spent an inordinate amount of time specifying all interactions for every use case for every
input device.
... live example check out the source code handling the control's value now that our control is working, we have to add code to update its value according to user
input and make it possible to send the value along with form data.
...And 3 more matches
Test your skills: Other controls - Learn web development
other controls 1 in our first "other controls" assessment, we'll get you to create a multi-line text
input.
... create a basic multi-line text
input.
... give the
input 35 columns, and 10 rows of space in which to add comments.
...And 3 more matches
Rhino shell
readurl(url [, charactercoding]) open an
input connection to the given string url, read all its bytes and convert them to a string using the specified character coding or default character coding if explicit coding argument is not given.
...
input - the process
input.
... if it is not java.io.
inputstream, it is converted to string and sent to the process as its
input.
...And 3 more matches
nsIIDNService
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/idn-service;1 as a service: var idnservice = components.classes["@mozilla.org/network/idn-service;1"] .getservice(components.interfaces.nsiidnservice); method overview autf8string convertacetoutf8(in acstring
input); autf8string converttodisplayidn(in autf8string
input, out boolean isascii); acstring convertutf8toace(in autf8string
input); boolean isace(in acstring
input); autf8string normalize(in autf8string
input); methods convertacetoutf8() converts an ace (ascii compatible encoding) hostname into unicode format, returning a utf-8 format string.
...autf8string convertacetoutf8( in acstring
input ); parameters
input the ace encoded hostname to convert into utf-8 format.
...autf8string converttodisplayidn( in autf8string
input, out boolean isascii ); parameters
input the string to convert to display format.
...And 3 more matches
nsIMsgFolder
ue label); nsimsgdatabase getmsgdatabase(in nsimsgwindow msgwindow); void setmsgdatabase(in nsimsgdatabase msgdatabase); nsimsgdatabase getdbfolderinfoanddb(out nsidbfolderinfo folderinfo); nsimsgdbhdr getmessageheader(in nsmsgkey msgkey); boolean shouldstoremsgoffline(in nsmsgkey msgkey); boolean hasmsgoffline(in nsmsgkey msgkey); nsi
inputstream getofflinefilestream(in nsmsgkey msgkey, out pruint32 offset, out pruint32 size); void downloadmessagesforoffline(in nsisupportsarray messages, in nsimsgwindow window); nsimsgfolder getchildwithuri(in acstring uri, in boolean deep, in boolean caseinsensitive); void downloadallforoffline(in nsiurllistener listener, in nsimsgwindow window); void enablenotif...
...madded(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 copydatatooutputstreamforappend(in nsi
inputstream aistream, in long alength, in nsioutputstream 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 aurlliste...
...ner); void addkeywordstomessages(in nsisupportsarray amessages, in acstring akeywords); void removekeywordsfrommessages(in nsisupportsarray amessages, in acstring akeywords); autf8string getmsgtextfromstream(in nsimsgdbhdr amsghdr, in nsi
inputstream astream, in long abytestoread, in long amaxoutputlen, in boolean acompressquotes); attributes attribute type description supportsoffline boolean readonly offlinestoreoutputstream nsioutputstream readonly offlinestore
inputstream nsi
inputstream readonly retentionsettings nsimsgretentionsettings downloadsettings nsimsgdownloadsettings sortorder long used for order in the folder pane, folder pickers, etc.
...And 3 more matches
Add to iPhoto
in c, these are declared thusly: void cfrelease(cftyperef cf); void cfretain(cftyperef cf); in javascript, this translates to: this.cfrelease = this.lib.declare("cfrelease", ctypes.default_abi, ctypes.void_t, ctypes.voidptr_t); //
input: object to release this.cfretain = this.lib.declare("cfretain", ctypes.default_abi, ctypes.void_t, ctypes.voidptr_t); //
input: object to retain these methods are used to manage the reference counting for core foundation objects.
...it returns a cfstringref, which is a pointer to the new string, and accepts, as
input, three parameters: an allocator, which is a pointer to a routine that will allocate the memory to contain the new object (we use the ctypes.voidptr_t type for this), a pointer to the unicode string to copy into the new string object (ctypes.jschar.ptr), and the length of the unicode string in characters.
... let's take a look at two of the routines declared here: this.cfurlcreatefromfilesystemrepresentation = this.lib.declare("cfurlcreatefromfilesystemrepresentation", ctypes.default_abi, this.cfurlref, // returns ctypes.voidptr_t, //
input: allocator ctypes.unsigned_char.ptr, //
input: pointer to string cfindex, //
input: string length ctypes.bool) //
input: isdirectory this method is used to convert a unix pathname into an url.
...And 3 more matches
AudioNode.connect() - Web APIs
syntax var destinationnode = audionode.connect(destination, outputindex,
inputindex); audionode.connect(destination, outputindex); parameters destination the audionode or audioparam to which to connect.
...while you can only connect a given output to a given
input once (repeated attempts are ignored), you can connect an output to multiple
inputs by calling connect() repeatedly.
...
inputindex optional an index describing which
input of the destination you want to connect the current audionode to; the default is 0.
...And 3 more matches
HTMLElement: change event - Web APIs
the change event is fired for <
input>, <select>, and <textarea> elements when an alteration to the element's value is committed by the user.
... unlike the
input event, the change event is not necessarily fired for each alteration to an element's value.
... bubbles yes cancelable no interface event event handler property onchange depending on the kind of element being changed and the way the user interacts with the element, the change event fires at a different moment: when the element is :checked (by clicking or using the keyboard) for <
input type="radio"> and <
input type="checkbox">; when the user commits the change explicitly (e.g., by selecting a value from a <select>'s dropdown with a mouse click, by selecting a date from a date picker for <
input type="date">, by selecting a file in the file picker for <
input type="file">, etc.); when the element loses focus after its value was changed, but not commited (e.g., after editing the value of <textarea> or <
input type="text">).
...And 3 more matches
Timing element visibility with the Intersection Observer API - Web APIs
ecting) { if (entry.intersectionratio >= 0.75) { adbox.dataset.lastviewstarted = entry.time; visibleads.add(adbox); } } else { visibleads.delete(adbox); if ((entry.intersectionratio === 0.0) && (adbox.dataset.totalviewtime >= 60000)) { replacead(adbox); } } }); } as previously mentioned, the intersectionobserver callback receives as
input an array of all of the observer's targeted elements which have become either more or less visible than one of the intersection observer ratios.
...this function takes as an
input an ad's htmldivelement object.
... creating an article to create the <article> element for an article (as well as all of its contents), we use the createarticle() function, which takes as
input a string which is the full text of the article to add to the page.
...And 3 more matches
MediaDevices.getUserMedia() - Web APIs
the mediadevices.getusermedia() method prompts the user for permission to use a media
input which produces a mediastream with tracks containing the requested types of media.
...on browsers that support managing media permissions with feature policy, this error is returned if feature policy is not configured to allow access to the
input source(s).
... in addition, user permission is always required to access the user's audio and video
inputs.
...And 3 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.
... example the following example shows basic usage of a scriptprocessornode to take a track loaded via audiocontext.decodeaudiodata(), process it, adding a bit of white noise to each audio sample of the
input track (buffer) and play it through the audiodestinationnode.
... 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
TextEncoder.prototype.encodeInto() - Web APIs
no zero-termination if the
input string contains the character u+0000 in the
input, encodeinto() will write a 0x00 byte in the output.
...if (point <= 0x07ff) { return fromcharcode((0x6<<5)|(point>>>6), (0x2<<6)|(point&0x3f)); } else return fromcharcode( (0xe/*0b1110*/<<4) | (point>>>12), (0x2/*0b10*/<<6) | ((point>>>6)&0x3f/*0b00111111*/), (0x2/*0b10*/<<6) | (point&0x3f/*0b00111111*/) ); } function textencoder(){}; textencoderprototype["encode"] = function(
inputstring) { // 0xc0 => 0b11000000; 0xff => 0b11111111; 0xc0-0xff => 0b11xxxxxx // 0x80 => 0b10000000; 0xbf => 0b10111111; 0x80-0xbf => 0b10xxxxxx var encodedstring =
inputstring === void 0 ?
... "" : ("" +
inputstring).replace(/[\x80-\ud7ff\udc00-\uffff]|[\ud800-\udbff][\udc00-\udfff]?/g, encoderreplacer); var len=encodedstring.length|0, result = new patchedu8array(len); var i=0; for (; i<len; i=i+1|0) result[i] = encodedstring.charcodeat(i) |0; return result; }; function polyfill_encodeinto(
inputstring, u8arr) { var encodedstring =
inputstring === void 0 ?
...And 3 more matches
Supporting both TouchEvent and MouseEvent - Web APIs
however, the reality is the vast majority of today's web content is designed only to work with mouse
input.
... consequently, even if a browser supports touch, the browser must still emulate mouse events so content that assumes mouse-only
input will work as is without direct modification.
... ideally, a touch-based application does not need to explicitly address mouse
input.
...And 3 more matches
ValidityState.patternMismatch - Web APIs
the read-only patternmismatch property of a validitystate object indicates if the value of an <
input>, after having been edited by the user, does not conform to the constraints set by the element's pattern attribute.
... if the field supports the pattern attribute -- which means the <
input> is of type text, tel, email, url, password, or search -- and the pattern value is set to a valid regular expression, if the value don't doesn't conform to the constraints set by the pattern value, the patternmismatch property will be true.
... examples given the following: <p> <label>enter your phone number in the format (123)456-7890 (<
input name="tel1" type="tel" pattern="[0-9]{3}" placeholder="###" aria-label="3-digit area code" size="2"/>)- <
input name="tel2" type="tel" pattern="[0-9]{3}" placeholder="###" aria-label="3-digit prefix" size="2"/> - <
input name="tel3" type="tel" pattern="[0-9]{4}" placeholder="####" aria-label="4-digit number" size="3"/> </label> </p> here we have 3 sections for a north american phone number with an implicit label encompassing all three components of the phone number, expecting 3-digits, 3-digits and 4-digits respectively, as defined by the pattern attribute set on each.
...And 3 more matches
Starting up and shutting down a WebXR session - Web APIs
other improvements include updating the emulator to rename the xr interface to xrsystem, introduce support for squeeze (grip)
input sources, and add support for the xr
inputsource property profiles.
... if you use xr
input controllers, watch the
inputsourceschange event to detect the addition or removal of xr
input controllers, and the various select and squeeze action events.
...the
input value into getoffsetreferencespace() is an xrrigidtransform encapsulating the player's position and orientation as specified in the default world coordinates.
...And 3 more matches
Alerts - Accessibility
here is a simple form: <form method="post" action="post.php"> <fieldset> <legend>please enter your contact details</legend> <label for="name">your name (required):</label> <
input name="name" id="name" aria-required="true"/> <br /> <label for="email">e-mail address (required):</label> <
input name="email" id="email" aria-required="true"/> <br /> <label for="website">website (optional):</label> <
input name="website" id="website"/> </fieldset> <label for="message">please enter your message (required):</label> <br /> <textarea name="me...
...ssage" id="message" rows="5" cols="80" aria-required="true"></textarea> <br /> <
input type="submit" name="submit" value="send message"/> <
input type="reset" name="reset" value="reset form"/> </form> checking for validity and notifying the user form validations consists of several steps: checking if the e-mail address or entered name are valid.
...this method takes three parameters: the id of the
input that is to be validated, the term to search for to ensure validity, and the error message to be inserted into the alert.
...And 3 more matches
Operable - Accessibility
links, buttons, form
inputs) makes logical sense, meaning that the page is still usable by non-sighted/keyboard users.
... 2.4.7 visible focus for focusable elements (aa) when tabbing through focusable elements such as links or form
inputs, there should be a visual indicator to show you which element currently has focus.
... guideline 2.5
input modalities: make it easier for users to operate functionality through various
inputs beyond keyboard.
...And 3 more matches
WAI ARIA Live Regions/API Support - Developer guides
aria-atomic on ancestor element event-from-
input "true" | "false" (described more below) browser could not calculate this was the root cause of this event explicit user
input?
...determining if event was from user
input all events will now provide information about whether the event was caused by user
input, or was something that the web page caused.
...in iaccessible2, this is retrieved from the object attribute "event-from-
input", which will be set to "true" or "false".
...And 3 more matches
Global attributes - HTML: Hypertext Markup Language
the event handler attributes: onabort, onautocomplete, onautocompleteerror, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncontextmenu, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, on
input, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onsort, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechan...
... autocapitalize controls whether and how text
input is automatically capitalized as it is entered/edited by the user.
...
inputmode provides a hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.
...And 3 more matches
Introduction - JavaScript
for example, client-side extensions allow an application to place elements on an html form and respond to user events such as mouse clicks, form
input, and page navigation.
... the web console tool built into firefox is useful for experimenting with javascript; you can use it into two modes: single-line
input mode, and multi-line
input mode.
... single-line
input in the web console the web console shows you information about the currently loaded web page, and also includes a javascript interpreter that you can use to execute javascript expressions in the current page.
...And 3 more matches
Promise.all() - JavaScript
the promise.all() method takes an iterable of promises as an
input, and returns a single promise that resolves to an array of the results of the
input promises.
... this returned promise will resolve when all of the
input's promises have resolved, or if the
input iterable contains no promises.
... it rejects immediately upon any of the
input promises rejecting or non-promises throwing an error, and will reject with this first rejection message / error.
...And 3 more matches
Authoring MathML - MathML
mathbird is a convenient add-on for thunderbird to insert such mathml expressions using the asciimath
input syntax.
... moreover, a latex-to-mathml
input box has also been integrated into seamonkey since version 2.28 and into thunderbird since version 31.
...on unix, you can then download itex2mml, build and install it: wget http://golem.ph.utexas.edu/~distler/blog/files/itextomml.tar.gz; \ tar -xzf itextomml.tar.gz; \ cd itex2mml/itex-src; make sudo make install now suppose that you have a html page with tex fragments delimited by dollars:
input.html ...
...And 3 more matches
Performance fundamentals - Web Performance
users provide
inputs to the system through touch, movement, and speech.
...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.
...And 3 more matches
in - SVG: Scalable Vector Graphics
the in attribute identifies
input for the given filter primitive.
...if no value is provided and this is the first filter primitive, then this filter primitive will use sourcegraphic as its
input.
... if no value is provided and this is a subsequent filter primitive, then this filter primitive will use the result from the previous filter primitive as its
input.
...And 3 more matches
JXON - Archive of obsolete content
e following htmlelement through json: <div id="form_container"></div> then, the following code: document.getelementbyid("form_container").appendjxon({ "form": { "script": { "@type": "text/javascript", "keyvalue": "\n function numbersonly (otocheckfield, okeyevent) {\n return okeyevent.charcode === 0 || /\\d/.test(string.fromcharcode(okeyevent.charcode));\n }\n" }, "
input": [{ "@type": "hidden", "@name": "instid", "@value": 1234 }, { "@type": "hidden", "@name": "currency", "@value": "gbp" }, { "@type": "hidden", "@name": "amount", "@value": 0 }, { "@type": "hidden", "@name": "name", "@value": "captured" }], "table": { "tr": [{ "th": { "@style": "text...
...-align: right;", "keyvalue": "product:" }, "td": { "span": [{ "
input": { "@type": "radio", "@name": "nome", "@id": "rel_tshirt", "@value": "tshirt" }, "label": { "@for": "rel_tshirt", "keyvalue": "t-shirt" }, "@class": "product" }, { "
input": { "@type": "radio", "@name": "nome", "@id": "rel_trousers", "@value": "trousers" }, "label": { "@for": "rel_trousers", "keyvalue": "trousers" }, "@class": "product" }, { "
input": { "@type": "r...
...e", "@id": "rel_pullover", "@value": "pullover" }, "label": { "@for": "rel_pullover", "keyvalue": "pullover" }, "@class": "product" }] } }, { "th": { "@style": "text-align: right;", "keyvalue": "quantity:" }, "td": { "
input": { "@type": "text", "@name": "my
input", "@onkeypress": "return numbersonly(this, event);", "@onpaste": "return false;" } } }] }, "p": { "
input": { "@type": "submit", "@value": "purchase!" } }, "@action": "https://secure-test.worldpay.com/wcc/purchase", "@name": "buyform", "...
...And 2 more matches
Focus and Selection - Archive of obsolete content
focused elements the focused element refers to the element which currently receives
input events.
... first, when the textbox is focused, the tag name is 'html:
input', not 'textbox' as we might expect.
... this is because xul text boxes are implemented using the html
input widget, so the focus event is received for that element instead.
...And 2 more matches
Player paddle and controls - Game development
to do that we can use the system's default
input (mouse or touch, depending on platform) and set the paddle position to where the
input position is.
... add the following new line to the update() function, as shown: function update() { game.physics.arcade.collide(ball, paddle); paddle.x = game.
input.x; } now on every new frame the paddle's x position will adjust accordingly to the
input's x position, however when we start the game, the position of the paddle is not in the middle.
... it's because the
input position is not yet defined.
...And 2 more matches
Index - Learn web development
96 making decisions in your code — conditionals article, beginner, codingscripting, conditionals, javascript, learn, switch, conditions, else, if, l10n:priority, ternary in any programming language, the code needs to make decisions and carry out actions accordingly depending on different
inputs.
... 310 basic native form controls beginner, controls, example, forms, guide, html,
input, web, widgets this article has covered the older
input types — the original set introduced in the early days of html that is well supported in all browsers.
... 330 test your skills: html5 controls assessment, beginner, forms, html5, learn, test your skills this aim of this skill test is to assess whether you've understood our the html5
input types article.
...And 2 more matches
Function return values - Learn web development
this is a simple html page containing a text <
input> field and a paragraph.
... next, we're going to include a way to print out information about the number entered into the text
input.
... enter the following event handler below the existing functions:
input.onchange = function() { const num =
input.value; if (isnan(num)) { para.textcontent = 'you need to enter a number!'; } else { para.textcontent = num + ' squared is ' + squared(num) + '.
...And 2 more matches
Drawing graphics - Learn web development
we use our degtorad() function to convert 60 degrees to radians, as math.tan() expects an
input value in radians.
... a simple drawing application as a final animation example, we'd like to show you a very simple drawing application, to illustrate how the animation loop can be combined with user
input (like mouse movement, in this case).
...a simple function that clears the whole canvas back to black, the same way we've seen before: clearbtn.onclick = function() { ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); } the drawing loop is pretty simple this time around — if pressed is true, we draw a circle with a fill style equal to the value in the color picker, and a radius equal to the value set in the range
input.
...And 2 more matches
React interactivity: Editing, filtering, conditional rendering - Learn web development
copy this block of code into the todo() function, beneath your usestate() hook but above the return statement: const editingtemplate = ( <form classname="stack-small"> <div classname="form-group"> <label classname="todo-label" htmlfor={props.id}> new name for {props.name} </label> <
input id={props.id} classname="todo-text" type="text" /> </div> <div classname="btn-group"> <button type="button" classname="btn todo-cancel"> cancel <span classname="visually-hidden">renaming {props.name}</span> </button> <button type="submit" classname="btn btn__primary todo-edit"> save <span classname="visually-hidden">new name for {props.nam...
...e}</span> </button> </div> </form> ); const viewtemplate = ( <div classname="stack-small"> <div classname="c-cb"> <
input id={props.id} type="checkbox" defaultchecked={props.completed} onchange={() => props.toggletaskcompleted(props.id)} /> <label classname="todo-label" htmlfor={props.id}> {props.name} </label> </div> <div classname="btn-group"> <button type="button" classname="btn"> edit <span classname="visually-hidden">{props.name}</span> </button> <button type="button" classname="btn btn__danger" onclick={() => props.deletetask(props.id)} > delete <span classname="visually-hidden">{props.name}</span> ...
... editing from the ui much of what we're about to do will mirror the work we did in form.js: as the user types in our new
input field, we need to track the text they enter; once they submit the form, we need to use a callback prop to update our state with the new name of the task.
...And 2 more matches
Setting up your own test automation environment - Learn web development
add the following code and try running your test again: const
input = driver.findelement(by.id('name'));
input.sendkeys('filling in my form'); you can submit key presses that can't be represented by normal characters using properties of the webdriver.key object.
... for example, above we used this construct to tab out of the form
input before submitting it: driver.sleep(1000).then(function() { driver.findelement(by.name('q')).sendkeys(webdriver.key.tab); }); waiting for something to complete there are times where you'll want to make webdriver wait for something to complete before carrying on.
... we could add a sleep() method to our quick_test.js test too — try wrapping your last line of code in a block like this: driver.sleep(2000).then(function() {
input.sendkeys('filling in my form');
input.getattribute("value").then(function(value) { if(value !== '') { console.log('form
input editable'); } }); }); webdriver will now wait for 2 seconds before filling in the form field.
...And 2 more matches
Adding a new event
a dom event which represents a native event like a user action such as keyboard or mouse
input.
... mouseevents.h this header file should be used for defining
input events from pointing devices such as mouse.
... textevents.h this header file should be used for defining
input events from keyboard or ime and also other text edit related events like querying focused content information.
...And 2 more matches
Experimental features in Firefox
nightly 53 yes developer edition 53 no beta 53 no release 53 no preference name dom.dialog_element.enabled global attribute:
inputmode our implementation of the
inputmode global attribute has been updated as per the whatwg spec (bug 1509527), but we still need to make other changes too, like making it available on contenteditable content.
... nightly 75 yes developer edition 75 no beta 75 no release 75 no preference name dom.forms.
inputmode <link rel="preload"> the <link> element's rel attribute is intended to help provide performance gains by letting you download resources earlier in the page lifecycle, ensuring that they're available earlier and are less likely to block page rendering.
... nightly 73 no developer edition 73 no beta 73 no release 73 no preference name dom.webgpu.enabled html dom api global event: before
input the global before
input event is sent to an <
input> element—or any element whose contenteditable attribute is enabled—immediately before the element's value changes.
...And 2 more matches
Internationalized Domain Names (IDN) Support in Mozilla Browsers
idn allows host/domain names with non-ascii characters for user
input into a browser's location bar or url's embedded in web pages.
...if end users
input non-ascii characters as part of a domain name or if a web page contains a link using a non-ascii domain name, the application must convert such
input into a special encoded format using only the usual ascii subset characters.
... how mozilla browsers handle non-ascii domain names unicode and nameprep when mozilla receives idn
input from the user via the location bar or a request to process non-ascii host name links, it first turns them into unicode, then normalizes the
input string to make it conform to general uri requirement.
...And 2 more matches
Basics
</p> <div style="text-align:center"> fill the gaps in this matrix with resizable
input fields.
... </div> <math class="
inputmath" display="block"> <mrow> <mi>a</mi> <mo>=</mo> <mo>[</mo> <mtable> <mtr> <mtd><mn>1</mn></mtd> <mtd> <mtext><
input id="
input12" value="?" size="1"/></mtext> </mtd> </mtr> <mtr> <mtd> <mtext><
input id="
input21" value="?" size="1"/></mtext> </mtd> <mtd><mn>4</mn></mtd> </mtr> </mtable> <mo>]</mo> </mrow> </math> <div style="text-align:center"> left size: <a class="control" href="javascript:increment
input('
input21', 1);" title="increase
input">+</a> <a class="control" href="javascript:increment
input('
input21',-1);" title="decrease
input">-</a> right size: <a class="control" href="javascript:increment
input('
input12', 1);" title="increase
input">+</a> <a class="control" href="javascript:increment
input('
input12',-1);" title=...
..."decrease
input">-</a> <br/> (click these control buttons to see their effects.) </div> <p> each entry of the following matrix represents <math> <msup><mrow><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi><mo>)</mo></mrow><mi>n</mi></msup> </math> for some <i>n</i>.
...And 2 more matches
NSS tools : certutil
-a use ascii format or allow the use of ascii format for
input or output.
... -i
input_file pass an
input file to the command.
... depending on the command option, an
input file can be a specific certificate, a certificate request file, or a batch file of commands.
...And 2 more matches
certutil
-a use ascii format or allow the use of ascii format for
input or output.
... -i
input_file pass an
input file to the command.
... depending on the command option, an
input file can be a specific certificate, a certificate request file, or a batch file of commands.
...And 2 more matches
Rhino serialization
rhino serialization apis two new classes, scriptableoutputstream and scriptable
inputstream, were introduced to handle serialization of rhino classes.
... these classes extend objectoutputstream and object
inputstream respectively.
...reading the serialized object back into memory is similarly simple: file
inputstream fis = new file
inputstream(filename); object
inputstream in = new scriptable
inputstream(fis, scope); object deserialized = in.readobject(); in.close(); again, we need the scope to create our serialization stream class.
...And 2 more matches
Index
(there is a pending exception if the most recently thrown exception in cx has not yet been caught or cleared.) 203 js_clearregexpstatics jsapi reference, reference, référence(2), spidermonkey js_clearregexpstatics clears the pending
input string and flags of the built-in regexp object.
...the result could be the same as one of the
input strings, if the other string is zero length.
... 263 js_executeregexp jsapi reference, spidermonkey js_executeregexp and js_newregexpobjectnostatics execute the regexp object, reobj, to the specified
input string, chars, from *indexp index.
...And 2 more matches
Secure Development Guidelines
r the eip otherwise the attacker can try to control memory pointed to by an existing function pointer a vulnerability is required to modify the eip or sensitive memory saved return addr or function pointer get altered introduction: gaining control (3) common issues used to gain control buffer overflows format string bugs integer overflows/underflows writing secure code:
input validation
input validation most vulnerabilities are a result of un-validated
input always perform
input validation could save you without knowing it examples: if it doesn’t have to be negative, store it in an unsigned int if the
input doesn’t have to be > 512, cut it off there if the
input should only be [a-za-z0-9], enforce it cross site scripting (xss) xss is a...
...is exploitable (in some browsers) with a simple request such as: http://www.victim.com?something=<script>alert('oops')</script> xss: prevention escape all dynamic
input that will be sent back to the user html encoding & → & < → < > → > " → " ' → ' url encoding % encoding java/vbscript escaping depends on the context; in a single-quoted string, escaping ' would suffice sql injection occurs when un-trusted
input is mixed with a sql string sql is a language used to interact with dat...
...abases code injection attack that is similar to xss but targeted at sql rather than html and javascript if
input is mixed with sql, it could itself become an sql instruction and be used to: query data from the database (passwords) insert value into the database (a user account) change application logic based on results returned by the database sql injection: example snprintf(str, sizeof(str), "select * from account where name ='%s'", name); sqlite3_exec(db, str, null, null, null); sql injection: prevention use parameterized queries insert a marker for every piece of dynamic content so data does not get mixed with sql instructions example: sqlite3_stmt *stmt; char *str = "select * from account where name='?'"; sqlite3_prepare_v2(db, str, strlen(str), ...
...And 2 more matches
imgIDecoder
modules/libpr0n/public/imgidecoder.idlscriptable base class for a decoder that reads an image from an
input stream and sends it to an imgiloader object.
...method overview void close(); void flush(); void init(in imgiload aload); unsigned long writefrom(in nsi
inputstream instr, in unsigned long count); methods close() closes the stream.
... writefrom() writes data into the stream from an
input stream.
...And 2 more matches
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 nsi
inputstream asource, in nsioutputstream 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 nsi
inputstream asource, in nsioutputstream 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.
...asourcebuffered true if asource implements nsi
inputstream.readsegments().
...And 2 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(); nsi
inputstream open
inputstream(in unsigned long offset); nsioutputstream openoutputstream(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 ...
...open
inputstream() this method opens blocking
input stream to cache data.
...nsi
inputstream open
inputstream( in unsigned long offset ); parameters offset read starting from this offset into the cached data.
...And 2 more matches
nsICryptoHash
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview acstring finish(in prbool aascii); void init(in unsigned long aalgorithm); void initwithstring(in acstring aalgorithm); void update([const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsi
inputstream astream, in unsigned long alen); constants hash algorithms these constants are used by the init() method to indicate which hashing function to use.
... updatefromstream() calculates and updates a new hash based on a given data stream (nsi
inputstream).
... void updatefromstream( in nsi
inputstream astream, in unsigned long alen ); parameters astream an
input stream to read from.
...And 2 more matches
nsISelection2
allowadjacent specifies whether the returned ranges are allowed to touch the
input range rather than merely overlapping it.
... resultcount returns the number of ranges that overlap (or touch) the
input range.
... results returns the ranges that overlap (or touch) the
input range.
...And 2 more matches
nsIURIFixupInfo
the
input is an invalid uri and fixup_flag_allow_keyword_lookup is not passed).
... fixeduri nsiuri the fixed-up original
input, *never* using a keyword search.
... (may be null if the original
input was broken as a url, e.g.
...And 2 more matches
nsIZipWriter
amodtime, in print32 acompression, in nsichannel achannel, in boolean aqueue); void addentrydirectory(in autf8string azipentry, in prtime amodtime, in boolean aqueue); void addentryfile(in autf8string azipentry, in print32 acompression, in nsifile afile, in boolean aqueue); void addentrystream(in autf8string azipentry, in prtime amodtime, in print32 acompression, in nsi
inputstream astream, in boolean aqueue); void close(); nsizipentry getentry(in autf8string azipentry); boolean hasentry(in autf8string azipentry); void open(in nsifile afile, in print32 aioflags); void processqueue(in nsirequestobserver aobserver, in nsisupports acontext); void removeentry(in autf8string azipentry, in boolean aqueue); attribu...
... addentrystream() adds data from an
input stream to the zip file.
... void addentrystream( in autf8string azipentry, in prtime amodtime, in print32 acompression, in nsi
inputstream astream, in boolean aqueue ); parameters azipentry the path of the file entry to add to the zip file.
...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.
...
input optional an index describing which
input into the specified destination audionode is to be disconnected.
...And 2 more matches
AudioWorkletNodeOptions - Web APIs
properties numberof
inputs optional the value to initialize the numberof
inputs property to.
...if the number of
inputs and number of outputs are both set to 0, a notsupportederror will be thrown and the node construction process aborted.
... if outputchannelcount isn't specified, and numberof
inputs and numberofoutputs are both 1, the audioworkletnode's initial channel count is set to 1.
...And 2 more matches
AudioWorkletProcessor() - Web APIs
available properties are as follows: numberof
inputs optional the value to initialize the numberof
inputs property to.
...note that there are default values for the first two properties, so even if there are no options object passed to the audioworkletnode constructor, the options object passed by the node to the audioworkletprocessor constructor will exist and at minimum have numberof
inputs and numberofoutputs.
... // test-processor.js class testprocessor extends audioworkletprocessor { constructor (options) { super() console.log(options.numberof
inputs) console.log(options.processoroptions.someusefulvariable) } 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 name of the processor and options object.
...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
Using channel messaging - Web APIs
it looks like so: creating the channel in the main page of the demo, we have a simple form with a text
input for entering messages to be sent to an <iframe>.
... 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 on 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 onc...
...lick(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.
...And 2 more matches
HTMLElement - Web APIs
input events before
input fired when the value of an <
input>, <select>, or <textarea> element is about to be modified.
...
input fired when the value of an <
input>, <select>, or <textarea> element has been changed.
... also available via the on
input property.
...And 2 more matches
MediaStreamTrackAudioSourceNode - Web APIs
the audio itself might be
input from a microphone or other audio sampling device, or might be received through a rtcpeerconnection, among other posible options.
... 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.
...And 2 more matches
ScriptProcessorNode.onaudioprocess - Web APIs
} example the following example shows basic usage of a scriptprocessornode to take a track loaded via audiocontext.decodeaudiodata(), process it, adding a bit of white noise to each audio sample of the
input track (buffer) and play it through the audiodestinationnode.
... 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.
...ipt-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.decode...
...And 2 more matches
SubtleCrypto.wrapKey() - Web APIs
to use aes-kw, the
input must be a multiple of 64 bits.
... let salt; /* get some key material to use as
input to the derivekey method.
... let salt; let iv; /* get some key material to use as
input to the derivekey method.
...And 2 more matches
sourceCapabilities - Web APIs
the uievent.sourcecapabilities read-only property returns an instance of the
inputdevicecapabilities interface which provides information about the physical device responsible for generating a touch event.
... if no
input device was responsible for the event, it returns null.
... when a single user interaction with an
input device generates a series of different
input events, the sourcecapabilities property for all of them will point to the same instance of
inputdevicecapabilities.
...And 2 more matches
Example and tutorial: Simple synth keyboard - Web APIs
then we establish a box that will be presented on the left side of the bar and place a label and an <
input> element of type "range".
... <div class="settingsbar"> <div class="left"> <span>volume: </span> <
input type="range" min="0.0" max="1.0" step="0.01" value="0.5" list="volumes" name="volume"> <datalist id="volumes"> <option value="0.0" label="mute"> <option value="1.0" label="100%"> </datalist> </div> we specify a default value of 0.5, and we provide a <datalist> element which is connected to the range using the name attribute to find an option list whose id matches; in this case, the data set is named "volume".
...nd-color: #000; color: #fff; } .octave { display: inline-block; padding: 0 6px 0 0; } .settingsbar { padding-top: 8px; font: 14px "open sans", "lucida grande", "arial", sans-serif; position: relative; vertical-align: middle; width: 100%; height: 30px; } .left { width: 50%; position: absolute; left: 0; display: table-cell; vertical-align: middle; } .left span, .left
input { vertical-align: middle; } .right { width: 50%; position: absolute; right: 0; display: table-cell; vertical-align: middle; } .right span { vertical-align: middle; } .right
input { vertical-align: baseline; } javascript the javascript code begins by initializing a number of variables.
...And 2 more matches
XRSession.onsqueeze - Web APIs
the xrsession interface's onsqueeze event handler property can be set to a function which is then invoked to handle the squeeze event that's sent when the user successfully completes a primary squeeze action on a webxr
input device.
... to learn more about how to use and handle webxr controller
inputs, see
inputs and
input sources.
...this is determined by comparing the
input source's handedness against the value of a handedness property on a user object we've established previously.
...And 2 more matches
XRSession: squeeze event - Web APIs
the webxr event squeeze is sent to an xrsession when one of the session's
input sources has completed a primary squeeze action.
... bubbles yes cancelable no interface xr
inputsourceevent event handler property onsqueeze for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in
inputs and
input sources.
...the handler fetches the pose representing the target ray for tracked-pointer
inputs and sends the pose's transform to a function called myhandlesqueezewithray().
...And 2 more matches
ARIA: application role - Accessibility
in this mode, the web author is completely responsible for handling any and all keyboard
input, focus management, and other interactions and cannot assume assistive technologies would do any processing on their end.
... for all of this to work, ats intercept almost all keyboard
input and consume it themselves, letting nothing through to the browser or other user agent.
...the screen reader mode, often called forms mode or focus mode, lets all keyboard
input go through to the browser again.
...And 2 more matches
Accessibility documentation index - Accessibility
20 using the aria-invalid attribute aria, accessibility, attribute, codingscripting, html, javascript, needscontent, role(2), agent, alert, user, useragent the aria-invalid attribute is used to indicate that the value entered into an
input field does not conform to the format expected by the application.this may include formats such as email addresses or telephone numbers.
...list multiple element ids in a space delimited fashion.this idea is similar to how the "for" attribute is used to link a label to an
input.assistive technology, such as screen readers, use this attribute to catalog the objects in a document so that users can navigate between them.
... 25 using the aria-required attribute aria, accessibility, needscontent the aria-required attribute is used to indicate that user
input is required on an element before a form can be submitted.
...And 2 more matches
:invalid - CSS: Cascading Style Sheets
the :invalid css pseudo-class represents any <
input> or other <form> element whose contents fail to validate.
... /* selects any invalid <
input> */
input:invalid { background-color: pink; } this pseudo-class is useful for highlighting field errors for the user.
... html <form> <div class="field"> <label for="url_
input">enter a url:</label> <
input type="url" id="url_
input"> </div> <div class="field"> <label for="email_
input">enter an email address:</label> <
input type="email" id="email_
input" required> </div> </form> css label { display: block; margin: 1px; padding: 1px; } .field { margin: 1px; padding: 1px; }
input:invalid { background-color: #ffdddd; } form:invalid { border: 5px solid #ffdddd; }
input:valid { background-color: #ddffdd; } form:valid { border: 5px solid #ddffdd; }
input:required { border-color: #800000; border-width: 3px; }
input:required:invalid {...
...And 2 more matches
:optional - CSS: Cascading Style Sheets
the :optional css pseudo-class represents any <
input>, <select>, or <textarea> element that does not have the required attribute set on it.
... /* selects any optional <
input> */
input:optional { border: 1px dashed black; } this pseudo-class is useful for styling fields that are not required to submit a form.
... accessibility concerns if a form contains optional <
input>s, required
inputs should be indicated using the required attribute.
...And 2 more matches
:required - CSS: Cascading Style Sheets
the :required css pseudo-class represents any <
input>, <select>, or <textarea> element that has the required attribute set on it.
... /* selects any required <
input> */
input:required { border: 1px dashed red; } this pseudo-class is useful for highlighting fields that must have valid data before a form can be submitted.
... accessibility concerns mandatory <
input>s should have the required attribute applied to them.
...And 2 more matches
Using media queries - CSS: Cascading Style Sheets
name summary notes any-hover does any available
input mechanism allow the user to hover over elements?
... any-pointer is any available
input mechanism a pointing device, and if so, how accurate is it?
... height height of the viewport hover does the primary
input mechanism allow the user to hover over elements?
...And 2 more matches
<color> - CSS: Cascading Style Sheets
activetext text of active links buttonface background of push buttons buttontext text of push buttons canvas background of application content or documents canvastext text in application content or documents field background of
input fields fieldtext text in
input fields graytext text that is disabled highlight background of items that are selected in a control highlighttext text of items that are selected in a control linktext text of non-active, non-visited links visitedtext text of visited links deprecated system color keywords the following keywords were defined in earlier versions...
... examples color value tester in this example we provide a <div> and a text
input.
... entering a valid color into the
input causes the <div> to adopt that color, allowing you to test our color values.
...And 2 more matches
min() - CSS: Cascading Style Sheets
mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 examples setting a maximum size for a label and
input another use case for css functions is to set a maximum size on responsive form controls: enabling the width of labels and
inputs to shrink as the width of the form shrinks.
... let's look at some css:
input, label { padding: 2px; box-sizing: border-box; display: inline-block; width: min(40%, 400px); background-color: pink; } form { margin: 4px; border: 1px solid black; padding: 4px; } here, the form itself, along with the margin, border, and padding, will be 100% of its parent's width.
... we declare the
input and label to be the lesser of 40% of the form width up to the padding or 400px wide, whichever is smaller.
...And 2 more matches
Audio and video manipulation - Developer guides
deo> javascript var myvideo = document.getelementbyid('my-video'); myvideo.playbackrate = 2; playable code <video id="my-video" controls="true" width="480" height="270"> <source src="https://udn.realityripple.com/samples/5b/8cd6da9c65.webm" type="video/webm"> <source src="https://udn.realityripple.com/samples/6f/08625b424a.m4v" type="video/mp4"> </video> <div class="playable-buttons"> <
input id="edit" type="button" value="edit" /> <
input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"> var myvideo = document.getelementbyid('my-video'); myvideo.playbackrate = 2;</textarea> var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var edit = document.getelementbyid('edit'); var code = textarea.value; fu...
...nction setplaybackrate() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; setplaybackrate(); }); edit.addeventlistener('click', function() { textarea.focus(); }) textarea.addeventlistener('
input', setplaybackrate); window.addeventlistener('load', setplaybackrate); note: try the playbackrate example live.
... use this web audio node type an audio track from an html <audio> or <video> element mediaelementaudiosourcenode a plain raw audio data buffer in memory audiobuffersourcenode an oscillator generating a sine wave or other computed waveform oscillatornode an audio track from webrtc (such as the microphone
input you can get using getusermedia().
...And 2 more matches
HTML attribute: capture - HTML: Hypertext Markup Language
the capture attribute is supported on the file
input type.
... the capture attribute takes as it's value a string that specifies which camera to use for capture of image or video data, if the accept attribute indicates that the
input should be of one of those types.
... environment the outward-facing camera and/or microphone should be used note: capture was previously a boolean attribute which, if present, requested that the device's media capture device(s) such as camera or microphone be used instead of requesting a file
input.
...And 2 more matches
disabled - HTML: Hypertext Markup Language
the disabled attribute is supported by <button>, <command>, <fieldset>, <keygen>, <optgroup>, <option>, <select>, <textarea> and <
input>.
... because a disabled field cannot have it's value changed, required does not have any effect on
inputs with the disabled attribute also specified.
... note: the required attribute is not permitted on
inputs with the disabled attribute specified.
...And 2 more matches
HTML attribute: minlength - HTML: Hypertext Markup Language
the minlength attribute defines the minimum number of characters (as utf-16 code units) the user can enter into an <
input> or <textarea>.
...if no minlength is specified, or an invalid value is specified, the
input has no minimum length.
... the
input will fail constraint validation if the length of the text value of the field is less than minlength utf-16 code units long, with validitystate.tooshort returning true.
...And 2 more matches
HTML attribute: size - HTML: Hypertext Markup Language
the size attribute defines the width of the <
input> and the height of the <select> element.
... for the
input, if the type attribute is text or password then it's the number of characters.
...if no size is specified, or an invalid value is specified, the
input has no size declared, and the form control will be the default width based on the user agent.
...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
Interacting with page scripts - Archive of obsolete content
-on"}; unsafewindow.clonedcontentscriptobject = cloneinto(contentscriptobject, unsafewindow); unsafewindow.assignedcontentscriptobject = contentscriptobject; the "page.html" file adds two buttons and assigns an event listener to each: one listener displays a property of the cloned object, and the other listener displays a property of the assigned object: <html> <head> </head> <body> <
input id="works" type="button" value="i will work"/> <
input id="fails" type="button" value="i will not work"/> <script> var works = document.getelementbyid("works"); works.addeventlistener("click", function() { alert(clonedcontentscriptobject.greeting); }, false); var fails = document.getelementbyid("fails"); fails.addeventlistener("click", function() { ...
...note that the function's closure will be exported, too: // content-script.js var salutation = "hello, "; function greetme(user) { return salutation + user; } exportfunction(greetme, unsafewindow, {defineas: "greetme"}); finally, the "page.html" file adds a button and a page script that calls the exported function when the user pushes the button: <html> <head> </head> <body> <
input id="test" type="button" value="click me"/> <script> var test = document.getelementbyid("test"); test.addeventlistener("click", function() { alert(window.greetme("page script")); }, false); </script> </body> </html> exportfunction() works by structured cloning the arguments and return value of the function from one scope to the other.
...now the page script can call the function as foo.greetme(): <html> <head> </head> <body> <
input id="test" type="button" value="click me"/> <script> var test = document.getelementbyid("test"); test.addeventlistener("click", function() { alert(window.foo.greetme("page script")); }, false); </script> </body> </html> reverting to the old behavior you can switch firefox back to the old behavior in which content scripts could expose objects and functions to p...
... = require("sdk/page-mod"); var self = require("sdk/self"); var pageurl = self.data.url("page.html") var pagemod = mod.pagemod({ include: pageurl, contentscriptfile: self.data.url("content-script.js"), contentscriptwhen: "ready" }) tabs.open(pageurl); the target web page "page.html" includes a button and a page script: <html> <head> <meta charset="utf-8"> </head> <body> <
input id="message" type="button" value="send a message"/> <script type="text/javascript" src="page-script.js"></script> </body> </html> the content script "content-script.js" adds an event listener to the button, that sends a custom event containing a message: var messenger = document.getelementbyid("message"); messenger.addeventlistener("click", sendcustomevent, false); function sendcustomeve...
lang/functional - Archive of obsolete content
function hasher (
input) { return
input.split(" ")[1]; } getlineage("homer simpson"); // computes and returns information for "simpson" getlineage("lisa simpson"); // returns cached for "simpson" parameters fn : function the function that becomes memoized.
... arguments : mixed additional arguments to pass to fn upon execution once(fn) creates a version of the
input function that can only be called one time.
... chain(fn) creates a version of the
input function that will return this.
...this could be useful, for example, if we are checking the user's keyboard
input, and want to wait until they've paused in their typing before we do so.
Post data to window - Archive of obsolete content
preprocessing post data the apostdata argument of the (global) loaduri(), opendialog(), and (tab)browser.loaduriwithflags() methods expects the post data in the form of an nsi
inputstream (because they eventually call nsiwebnavigation.loaduri()) while post data can be created using nsimime
inputstream.
...here is an example: var datastring = "name1=data1&name2=data2"; // post method requests must wrap the encoded text in a mime // stream const cc = components.classes; const ci = components.interfaces; var stringstream = cc["@mozilla.org/io/string-
input-stream;1"].
... createinstance(ci.nsistring
inputstream); if ("data" in stringstream) // gecko 1.9 or newer stringstream.data = datastring; else // 1.8 or older stringstream.setdata(datastring, datastring.length); var postdata = cc["@mozilla.org/network/mime-
input-stream;1"].
... createinstance(ci.nsimime
inputstream); postdata.addheader("content-type", "application/x-www-form-urlencoded"); postdata.addcontentlength = true; postdata.setdata(stringstream); // postdata is ready to be used as apostdata argument ...
JavaScript Daemons Management - Archive of obsolete content
eplay();">reverseplay</button> <button onclick="orecompose.reversals = 2;alert('changed');">two reversals</button> <button onclick="orecompose.makeloop();alert('changed');">makeloop</button> <button onclick="orecompose.unmakeloop();alert('changed');">unmakeloop</button> <button onclick="orecompose.close();">close</button> <button onclick="orecompose.reclose();">reclose</button><br /> frame rate: <
input type="text" id="vello" value="33" style="width: 40px;" onkeypress="return event.charcode===0||/\d/.test(string.fromcharcode(event.charcode));" onkeyup="if(isfinite(this.value)&&number(this.value)>0){orecompose.setrate(this.value);}" /></p> </body> </html> example #2: a practical instantiation – daemon.buildaround() <!doctype html> <html> <head> <meta http-equiv="content-type" content="text...
..."ounhide.reverseplay();">reverseplay</button> <button onclick="ounhide.reversals = 2;alert('changed');">two reversals</button> <button onclick="ounhide.makeloop();alert('changed');">makeloop</button> <button onclick="ounhide.unmakeloop();alert('changed');">unmakeloop</button> <button onclick="ounhide.close();">close</button> <button onclick="ounhide.reclose();">reclose</button><br /> frame rate: <
input type="text" id="vello" value="33" style="width: 40px;" onkeypress="return event.charcode===0||/\d/.test(string.fromcharcode(event.charcode));" onkeyup="if(isfinite(this.value)&&number(this.value)>0){ounhide.setrate(this.value);}" /></p> </body> </html> example #3: a safe (without setinterval) instantiation – new daemon.safe() <!doctype html> <html> <head> <meta http-equiv="content-type" co...
...eplay();">reverseplay</button> <button onclick="orecompose.reversals = 2;alert('changed');">two reversals</button> <button onclick="orecompose.makeloop();alert('changed');">makeloop</button> <button onclick="orecompose.unmakeloop();alert('changed');">unmakeloop</button> <button onclick="orecompose.close();">close</button> <button onclick="orecompose.reclose();">reclose</button><br /> frame rate: <
input type="text" id="vello" value="33" style="width: 40px;" onkeypress="return event.charcode===0||/\d/.test(string.fromcharcode(event.charcode));" onkeyup="if(isfinite(this.value)&&number(this.value)>0){orecompose.setrate(this.value);}" /></p> </body> </html> example #4: a practical and safe (without setinterval) instantiation – daemon.safe.buildaround() <!doctype html> <html> <head> <meta htt...
..."ounhide.reverseplay();">reverseplay</button> <button onclick="ounhide.reversals = 2;alert('changed');">two reversals</button> <button onclick="ounhide.makeloop();alert('changed');">makeloop</button> <button onclick="ounhide.unmakeloop();alert('changed');">unmakeloop</button> <button onclick="ounhide.close();">close</button> <button onclick="ounhide.reclose();">reclose</button><br /> frame rate: <
input type="text" id="vello" value="33" style="width: 40px;" onkeypress="return event.charcode===0||/\d/.test(string.fromcharcode(event.charcode));" onkeyup="if(isfinite(this.value)&&number(this.value)>0){ounhide.setrate(this.value);}" /></p> </body> </html> ...
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
type chrome://browser/content/browser.xul into the url
input field at the top, then click the inspect button.
... listing 22: content for _readfile method _readfile: function(afile) { try { var stream = components.classes["@mozilla.org/network/file-
input-stream;1"].
... createinstance(components.interfaces.nsifile
inputstream); stream.init(afile, 0x01, 0, 0); var cvstream = components.classes["@mozilla.org/intl/converter-
input-stream;1"].
... createinstance(components.interfaces.nsiconverter
inputstream); cvstream.init(stream, "utf-8", 1024, components.interfaces.nsiconverter
inputstream.default_replacement_character); var content = ""; var data = {}; while (cvstream.readstring(4096, data)) { content += data.value; } cvstream.close(); return content.replace(/\r\n?/g, "\n"); } catch (ex) { } return null; }, _writefile method creates a new file for the nslfile object passed as a parameter, and writes the text string, also passed as a parameter.
Writing to Files - Archive of obsolete content
to create an
input stream, first get a reference to a nsifile, and then use nsiscriptableio.newoutputstream() to open a stream for writing to it.
...writing text files characters are written to a text
input stream using a specified character encoding, which defaults to utf-8.
...var file = io.getfile("desktop", "myinfo.txt"); var stream = io.newoutputstream(file, "text"); stream.writestring("this is some text"); stream.close(); in this example, a text
input stream is created for the file 'myinfo.txt'.
...var stream = io.new
inputstream(file, "text", "utf-16"); this third argument is not needed to write using utf-8.
Adding HTML Elements - Archive of obsolete content
<html:img src="banner.jpg"/> <html:
input type="checkbox" value="true"/> <html:table> <html:tr> <html:td> a simple table </html:td> </html:tr> </html:table> these examples will create an image from the file banner.jpg, a checkbox and a single-cell table.
...if you left out the html: part, the browser would think that the elements were xul elements and they would not display because img,
input, table, and so on are not valid xul tags.
...example 1 : source view <html:p> search for: <html:
input id="find-text"/> <button id="okbutton" label="ok"/> </html:p> this code will cause the text 'search for:' to be displayed, followed by an
input element and an ok button.
... <html:p> <html:
input id="rtd" type="checkbox"/> <html:label for="rtd">remember this decision</html:label> </html:p> </html:p> in this case, one p tag was used to place the text in and another was used to break apart the text into multiple lines.
Element Positioning - Archive of obsolete content
example 5 the text
input is flexible but will never grow to be larger than 10 ems.
... <textbox id="find-text" flex="1" style="min-width: 15em;"/> here, the text
input has been made flexible.
...if the user resizes the dialog to be very small, the text
input will not shrink past 15 ems.
...notice in the image that the text
input has grown to extend to the full size of the window.
::-ms-clear - Archive of obsolete content
the ::-ms-clear css pseudo-element creates a clear button at the edge of an <
input type="text"> text control that clears the current value.
...this includes
inputs that appear text-like or fall back to type="text".
... such
inputs include: <
input type="color"> <
input type="date"> <
input type="datetime"> <
input type="datetime-local"> <
input type="email"> <
input type="month"> <
input type="number"> <
input type="search"> <
input type="tel"> <
input type="time"> <
input type="url"> <
input type="week"> allowable properties only the following css properties can be used in a rule with ::-ms-clear in its selector.
... (values block, inline-block, none) @font-face font-size font-style font-weight height 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-clear example html <form> <label for="firstname">first name:</label> <
input type="text" id="firstname" name="firstname" placeholder="first name"> <br> <label for="lastname">last name:</label> <
input type="text" id="lastname" name="lastname" placeholder="second name"> </form> css
input, label { display: block; }
input[type=text]::-ms-clear { color: red; /* this sets the cross color as red.
Mozilla XForms Specials - Archive of obsolete content
instead you will have to use the following normal classes instead: xf-value xf-repeat-item xf-repeat-index for example, to target the value element of an
input control use: @namespace xf url("http://www.w3.org/2002/xforms"); xf|
input .xf-value { ...
...it involves exposing some (script) functionality on all our controls, like output,
input, etc.
...labelposition for xforms:
input elements bound to a boolean node we support an attribute labelposition in the namespace http://www.mozilla.org/projects/xfor...009/extensions, which allows the form author to define on which side of the checkbox the label will be shown.
... for details, see the
input control documentation.
XForms Secret Element - Archive of obsolete content
introduction used for
inputting passwords or other sensitive text.
... single-node binding special
inputmode - isn't supported.
...characteristics analogous widgets are <xhtml:
input type="password"/> and <xul:textbox type="password"/> if the incremental attribute is present and has the value true, then the bound instance node is updated on every user
input.
... please keep in mind that the instance data will hold exactly what the user gave as
input.
Mozilla XForms User Interface - Archive of obsolete content
for example, a xforms
input control may appear as a text field or as a datepicker depending on whether it is bound to a xsd:string type or a xsd:date type.
...
input a key xforms element to show and change the instance data to which it is bound.
...consists of a text field for direct
input and a dropdown calendar that can also be used to
input the date value.
... secret used for
inputting passwords.
IDL - MDN Web Docs Glossary: Definitions of Web-related terms
for example, to set an <
input> element's maxlength to 42 using the content attribute, you have to call setattribute("maxlength", "42") on that element.
...for example, the default type for <
input> elements is "text", so if you set
input.type="foobar", the <
input> element will be of type text (in the appearance and the behavior) but the "type" content attribute's value will be "foobar".
... idl attributes are not always strings; for example,
input.maxlength is a number (a signed long).
... when using idl attributes, you read or set values of the desired type, so
input.maxlength is always going to return a number and when you set
input.maxlength ,it wants a number.
Pseudo-classes and pseudo-elements - Learn web development
:blank matches an <
input> element whose
input value is empty.
... :invalid matches an element, such as an <
input>, in an invalid state.
... :placeholder-shown matches an
input element that is showing placeholder text.
... :valid matches an element such as an <
input> element, in a valid state.
Styling links - Learn web development
playable code <div class="body-wrapper" style="font-family: 'open 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>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 html
input = document.queryselector(".html-
input"); var css
input = document.queryselector(".css-
input"); var reset = document.getelementbyid("reset"); var htmlcode = html
input.value; var csscode = css
input.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 drawoutput() { output.innerhtml = html
input.value; styleelem.textcontent = css
input.value; } reset.addeventlistener("click", function() { html
input.value = htmlcode; css
input.value = csscode; drawoutput(); }); solution.addeventlistener("click", function() { html
input.value = htmlcode; css
input.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 back...
...ground: #265301;\n color: #cdfeaa;\n}'; drawoutput(); }); html
input.addeventlistener("
input", drawoutput); css
input.addeventlistener("
input", drawoutput); window.addeventlistener("load", drawoutput); 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.
Example - Learn web development
a payment form html content <form method="post"> <h1>payment form</h1> <p>required fields are followed by <strong><abbr title="required">*</abbr></strong>.</p> <section> <h2>contact information</h2> <fieldset> <legend>title</legend> <ul> <li> <label for="title_1"> <
input type="radio" id="title_1" name="title" value="a"> ace </label> </li> <li> <label for="title_2"> <
input type="radio" id="title_2" name="title" value="k" > king </label> </li> <li> <label for="title_3"> <
input type="radio" id="title_3" name="title" value="q"> queen ...
... </label> </li> </ul> </fieldset> <p> <label for="name"> <span>name: </span> <strong><abbr title="required">*</abbr></strong> </label> <
input type="text" id="name" name="username"> </p> <p> <label for="mail"> <span>e-mail: </span> <strong><abbr title="required">*</abbr></strong> </label> <
input type="email" id="mail" name="usermail"> </p> <p> <label for="pwd"> <span>password: </span> <strong><abbr title="required">*</abbr></strong> </label> <
input type="password" id="pwd" name="password"> </p> </section> <section> <h2>payment information</h2> <p> <label for="card"> <span>card type:</span> </label> <select id="...
...card" name="usercard"> <option value="visa">visa</option> <option value="mc">mastercard</option> <option value="amex">american express</option> </select> </p> <p> <label for="number"> <span>card number:</span> <strong><abbr title="required">*</abbr></strong> </label> <
input type="tel" id="number" name="cardnumber"> </p> <p> <label for="date"> <span>expiration date:</span> <strong><abbr title="required">*</abbr></strong> <em>formatted as mm/dd/yyyy</em> </label> <
input type="date" id="date" name="expiration"> </p> </section> <section> <p> <button type="submit">validate the payment</button> </p> </section> </form> css content h1 { margin-top: 0; } ul { ...
... margin: 0; padding: 0; list-style: none; } form { margin: 0 auto; width: 400px; padding: 1em; border: 1px solid #ccc; border-radius: 1em; } div+div { margin-top: 1em; } label span { display: inline-block; width: 120px; text-align: right; }
input, textarea { font: 1em sans-serif; width: 250px; box-sizing: border-box; border: 1px solid #999; }
input[type=checkbox],
input[type=radio] { width: auto; border: none; }
input:focus, textarea:focus { border-color: #000; } textarea { vertical-align: top; height: 5em; resize: vertical; } fieldset { width: 250px; box-sizing: border-box; margin-left: 136px; border: 1px solid #999; } button { margin: 20px 0 0 124px; } label { position: relative...
Sending form data - Learn web development
consider the following form: <form action="http://www.foo.com" method="get"> <div> <label for="say">what greeting do you want to say?</label> <
input name="say" id="say" value="hi"> </div> <div> <label for="to">who do you want to say it to?</label> <
input name="to" id="to" value="mom"> </div> <div> <button>send my greetings</button> </div> </form> since the get method has been used, you'll see the url www.foo.com/?say=hi&to=mom appear in the browser address bar when you submit the form.
... <form action="https://www.foo.com" method="post"> <div> <label for="say">what greeting do you want to say?</label> <
input name="say" id="say" value="hi"> </div> <div> <label for="to">who do you want to say it to?</label> <
input name="to" id="to" value="mom"> </div> <div> <button>send my greetings</button> </div> </form> when the form is submitted using the post method, you get no data appended to the url, and the http request looks like so, with the data included in the request body instead: ...
... include one or more <
input type="file"> controls to allow your users to select the file(s) that will be uploaded.
... for example: <form method="post" action="https://www.foo.com" enctype="multipart/form-data"> <div> <label for="file">choose a file</label> <
input type="file" id="file" name="myfile"> </div> <div> <button>send the file</button> </div> </form> note: servers can be configured with a size limit for files and http requests in order to prevent abuse.
Sending forms through JavaScript - Learn web development
many modern uis only use html forms to collect
input from the user, and not for data submission.
... the html is typical: <form id="myform"> <label for="myname">send me your name:</label> <
input id="myname" name="name" value="john"> <
input type="submit" value="send me!"> </form> but javascript takes over the form: window.addeventlistener( "load", function () { function senddata() { const xhr = new xmlhttprequest(); // bind the formdata object and the form element const fd = new formdata( form ); // define what happens on successful data submission xhr.addevent...
... dealing with binary data if you use a formdata object with a form that includes <
input type="file"> widgets, the data will be processed automatically.
... in the following example, we use the filereader api to access binary data and then build the multi-part form data request by hand: <form id="theform"> <p> <label for="thetext">text data:</label> <
input id="thetext" name="mytext" value="some text data" type="text"> </p> <p> <label for="thefile">file data:</label> <
input id="thefile" name="myfile" type="file"> </p> <button>send me!</button> </form> as you see, the html is a standard <form>.
Test your skills: Advanced styling - Learn web development
advanced form styling 1 in our first advanced styling tasks, we want you to handle making a search
input as consistent as possible across browsers — a trickier task than with standard text
inputs, even on modern browsers.
...we've made one available in the same directory as our html files — see search-24px.png — plus a <div> element after the search
input to help you attach it, should you need it.
... first of all, we want you to provide some specific styling to visually indicate which
inputs have to be filled in — they cannot be left empty.
... second, we want you to provide a useful visual indicator of whether the data entered inside each
input is valid or not.
Test your skills: Form validation - Learn web development
form validation 1 in this task, we are providing you with a simple support query form, and we want you to add some validation features to it: make all of the
input fields mandatory to complete before the form can be submitted.
... form validation 3 in our final task for this set, we are providing you with a similar example to what you saw in the accompanying article — a simple email address entry
input.
... make the
input mandatory to fill in, and give it a minimum length of 10 characters.
... add an event listener that checks whether the
inputted value is an email address, and whether it is long enough.
Test your skills: HTML5 controls - Learn web development
this aim of this skill test is to assess whether you've understood our the html5
input types article.
... html5 controls 1 first let's explore some of the new html5
input types.
... create appropriate
inputs for a user to update their details for: email website phone number favourite color try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...give it a class of invite-output, and semantically associate it with the
input.
Adding vector graphics to the Web - Learn web development
in the
input section below you'll see that we've already provided you with some samples to get you started.
... 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" stroke="black" /> <polygon points="120,0 240,225 0,225" fill="green"/> <text x="50" y="100" font-family="verdana" font-size="55" fill="white" stroke="black" stroke-width="2"> hello!
... </text> </svg> </textarea> <div class="playable-buttons"> <
input id="reset" type="button" value="reset"> <
input id="solution" type="button" 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 = text...
...e = '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 = ''; let solutionentry = htmlsolution; textarea.addeventlistener('
input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; ...
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: #f5f9...
... solution.value = 'show solution'; } updatecode(); }); var htmlsolution = '<img src="https://udn.realityripple.com/samples/ec/5a13bd14f6.jpg"\n alt="the head and torso of a dinosaur skeleton; it has a large head with long sharp teeth"\n width="200"\n height="171"\n title="a t-rex on display in the manchester university museum">'; var solutionentry = htmlsolution; textarea.addeventlistener('
input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; v...
...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; } ...
... updatecode(); }); var htmlsolution = '<figure>\n <img src="https://udn.realityripple.com/samples/ec/5a13bd14f6.jpg"\n alt="the head and torso of a dinosaur skeleton; it has a large head with long sharp teeth"\n width="200"\n height="171">\n <figcaption>a t-rex on display in the manchester university museum</figcaption>\n</figure>'; var solutionentry = htmlsolution; textarea.addeventlistener('
input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; v...
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; } ...
...ttps://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d37995.65748333395!2d-2.273568166412784!3d53.473310471916975!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x487bae6c05743d3d%3a0xf82fddd1e49fc0a1!2sthe+lowry!5e0!3m2!1sen!2suk!4v1518171785211" width="600" height="450" frameborder="0" style="border:0" allowfullscreen>\n</iframe>'; let solutionentry = htmlsolution; textarea.addeventlistener('
input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; ...
Introduction to web APIs - Learn web development
if you look at our simple web audio example (see it live also), you'll first see the following html: <audio src="outfoxing.mp3"></audio> <button class="paused">play</button> <br> <
input type="range" min="0" max="1" step="0.01" value="1" class="volume"> we, first of all, include an <audio> element with which we embed an mp3 into the page.
...next, we include a <button> that we'll use to play and stop the music, and an <
input> element of type range, which we'll use to adjust the volume of the track while it's playing.
... we start by creating an audiocontext instance inside which to manipulate our track: const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); next, we create constants that store references to our <audio>, <button>, and <
input> elements, and use the audiocontext.createmediaelementsource() method to create a mediaelementaudiosourcenode representing the source of our audio — the <audio> element will be played from: const audioelement = document.queryselector('audio'); const playbtn = document.queryselector('button'); const volumeslider = document.queryselector('.volume'); const audiosource = audioctx.createmediaelementsource(audioelement); next up we include a couple of event handlers ...
... next, we create a gainnode object using the audiocontext.creategain() method, which can be used to adjust the volume of audio fed through it, and create another event handler that changes the value of the audio graph's gain (volume) whenever the slider value is changed: const gainnode = audioctx.creategain(); volumeslider.addeventlistener('
input', function() { gainnode.gain.value = this.value; }); the final thing to do to get this to work is to connect the different nodes in the audio graph up, which is done using the audionode.connect() method available on every node type: audiosource.connect(gainnode).connect(audioctx.destination); the audio starts in the source, which is then connected to the gain node so the audio's volume can...
Command line crash course - Learn web development
this counts the number of words, lines, characters, or bytes of whatever is
inputted into it.
...a good deal of commands can also read content from streamed
input (known as "standard
input" or stdin).
... the pipe operator can connect these
inputs and outputs together, allowing us to build up increasingly more complex operations to suit our needs — the output from one command can become the
input to the next command.
... in this case, ls would normally print its output to stdout, but instead ls’s output is being piped into wc, which takes that output as an
input, counting the number of lines it contains, and prints that count to stdout instead.
Mozilla's Section 508 Compliance
(c) a well-defined on-screen indication of the current focus shall be provided that moves among interactive interface elements as the
input focus changes.
...the minimum information that shall be made available is text content, text
input caret location, and text attributes.
...does not require speech
input f) at least one mode of operation and information retrieval that does not require fine motor control or simultaneous actions and that is operable with limited reach and strength shall be provided complete.
... all
input technologies that go through the keyboard driver work with mozilla -- including sticky keys, filter keys, on screen keyboards, etc.
Creating Sandboxed HTTP Connections
l.notificationcallbacks = listener; gchannel.asyncopen(listener, null); function streamlistener(acallbackfunc) { this.mcallbackfunc = acallbackfunc; } streamlistener.prototype = { mdata: "", // nsistreamlistener onstartrequest: function (arequest, acontext) { this.mdata = ""; }, ondataavailable: function (arequest, acontext, astream, asourceoffset, alength) { var scriptable
inputstream = components.classes["@mozilla.org/scriptable
inputstream;1"] .createinstance(components.interfaces.nsiscriptable
inputstream); scriptable
inputstream.init(astream); this.mdata += scriptable
inputstream.read(alength); }, onstoprequest: function (arequest, acontext, astatus) { if (components.issuccesscode(astatus)) { // request was successfull this.mca...
... first, a nsi
inputstream instance is created, after which the setdata method is called.
... var
inputstream = components.classes["@mozilla.org/io/string-
input-stream;1"] .createinstance(components.interfaces.nsistring
inputstream);
inputstream.setdata(postdata, postdata.length); next, the nsichannel is qied to an nsiuploadchannel.
... its setuploadstream method is called, passing in the nsi
inputstream and the type (in this case, "application/x-www-form-urlencoded"): var uploadchannel = gchannel.queryinterface(components.interfaces.nsiuploadchannel); uploadchannel.setuploadstream(
inputstream, "application/x-www-form-urlencoded", -1); due to a bug, calling setuploadstream will reset the nsihttpchannel to be a put request, so now the request type is set to post: // order important - setuploadstream resets to put httpchannel.requestmethod = "post"; ...
HTML parser threading
if the parser isn't blocked, document.write() parses
input into tree ops synchronously and flushes the tree ops synchronously by calling nshtml5treeopexecutor::flushdocumentwrite().
...if there is data in document.write()
input after a an external script (or any data at all if a previous document.write() call has contained an external script and blocked the parser), the data is left in a linked list of nshtml5owningutf16buffer objects.
...this is equivalent to rewinding the
input to where it was when speculation started.
...on the main thread, the speculative tokenizer/tree builder pair used for parsing document.write()
input that didn't get parsed by the main document.write() tokenizer/tree builder synchronously also sends speculative loads to the tree op executor.
Mozilla Web Developer FAQ
in fact, since the
input to the browser can be of arbitrary length, there is no upper bound for the number of distinct ways of deviating from the standards.
... therefore, it is impossible to test whether mozilla reacts exactly like browser x to every possible
input.
... (likewise, there is no upper bound for the number of ways different features of the standards themselves can be combined, which makes software quality assurance challenging.) also, the ways in which browser x reacts to some standards-incompliant
input are not all intentional.
...this affects data round tripping using hidden form
inputs.
L20n HTML Bindings
consider the following source html: <p data-l10n-id="save"> <
input type="submit"> <a href="/main" class="btn-cancel"></a> </p> assume the following malicious translation: <save """ <
input value="save" type="text"> or <a href="http://myevilwebsite.com" onclick="alert('pwnd!')" title="back to the homepage">cancel</a>.
... """> the result will be: <p data-l10n-id="back"> <
input value="save" type="submit"> or <a href="/main" class="btn-cancel" title="back to the homepage">cancel</a>.
... </p> the
input element is not on the default whitelist but since it's present in the source html, it is also allowed in the translation.
... the value attribute is allowed on
input elements, but type is not.
PR_strtod
syntax #include <prdtoa.h> prfloat64 pr_strtod(const char *s00, char **se); parameters the function has these parameters: s00 the
input string to be scanned.
... se a pointer that, if not null, will be assigned the address of the last character scanned in the
input string.
... returns the result of the conversion is a prfloat64 value equivalent to the
input string.
... description pr_strtod converts the prefix of the
input decimal string pointed to by s00 to a nearest double-precision floating point number.
NSS Sample Code Sample_2_Initialization of NSS
r, "%-15s specify a db 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, output, "re-enter password: ", checkpassword); if (p0 && p1 && !port_strcmp(p0, p1)) { break; } pr_fprintf(pr_stderr, "passwords do not match.
... 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 (oldpwfile) { pwdata.source = pw_fromfile; pwdata.data = oldpwfile; } else { pwdata.source = pw_none; pwdata.data = null; } if (newpass) { newpwdata.source = pw_pl...
Initialize NSS database - sample 2
progname); 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, output, "re-enter password: ", checkpassword); if (p0 && p1 && !port_strcmp(p0, p1)) { break; } pr_fprintf(pr_stderr, "passwords do not match.
... 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) { pwdata.source = pw_fromfile; pwdata.data = oldpwfile; } else { pwdata.source = pw_none; pwdata.data = null; } if (newpass) { newpwdata.source = pw_plaintext; ...
Utilities for nss samples
const unsigned char *data, 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.
...ord(char *cp) { 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), inpu...
...ame, pr_geterror(), pr_getoserror()); rv = secfailure; goto cleanup; } if (ascii) { /* first convert ascii to binary */ secitem filedata; char *asc, *body; /* read in ascii data */ rv = filetoitem(&filedata, infile); asc = (char *)filedata.data; if (!asc) { pr_fprintf(pr_stderr, "unable to read data from
input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and remove them */ if ((body = strstr(asc, "-----begin")) != null) { char *trailer = null; asc = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(asc, '\r'); /* maybe this is a mac file */ ...
... if (body) trailer = strstr(++body, "-----end"); if (trailer != null) { *trailer = '\0'; } else { pr_fprintf(pr_stderr, "
input has header but no trailer\n"); port_free(filedata.data); rv = secfailure; goto cleanup; } } else { body = asc; } /* convert to binary */ rv = atob_convertasciitoitem(der, body); if (rv) { pr_fprintf(pr_stderr, "error converting ascii to binary %s\n", port_geterror()); port_free(filedata.data); rv = secfailure; goto cleanup; } port_free(filedata.data); } else { /* read in binary ...
FC_SetPIN
syntax ck_rv fc_setpin( ck_session_handle hsession, ck_char_ptr poldpin, ck_ulong uloldlen, ck_char_ptr pnewpin, ck_ulong ulnewlen ); parameters fc_setpin takes five parameters: hsession [
input] the session's handle poldpin [
input] points to the old pin.
... uloldlen [
input] the length in bytes of the old pin.
... pnewpin [
input] points to the new pin.
... ulnewlen [
input] the length in bytes of the new pin.
NSS tools : signtool
in the following example, the user
input is in boldface: signtool -g mytestcert using certificate directory: /u/someuser/.netscape enter certificate information.
... the certificate information is read from standard
input.
...to create a file for this purpose, enter each of the seven
input fields, in order, on a separate line.
...then run signtool with standard
input redirected from your file as follows: signtool -g mytestcert
inputfile the prompts show up on the screen, but the responses will be automatically read from the file.
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.
... -i
input_file gives the
input file for the object with signed data.
... -s signature_file gives the
input file for the digital signature.
... extended examples verifying a signature the -v option verifies that the signature in a given signature file is valid when used to sign the given object (from the
input file).
64-bit Compatibility
luckily there is an alias that will choose the right opcode for you - lir_ldp: struct object { void *data; }; lir->insload(lir_ldp, objins, ins->insimm(offsetof(object, data))); when you use lirwriter::insstore, the correct size is chosen for you automatically, based on the size of the
input operands.
... piadd 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.
Mozilla internal string guide
this function should only be used if the
input is known to be strictly ascii.
...(in the future, these conversions may start asserting in debug builds that their
input is in the permissible range.) if the
input is actually in the latin1 range, each 16-bit code unit in narrowed to an 8-bit byte by removing the high half.
... latin1 to utf-16 converters these converters are very dangerous because they will produce wrong results for non-ascii utf-8 or windows-1252
input into a meaningless utf-16 string.
...if handlestring assigns its
input into another nsstring, then the string buffer will be shared in this case negating the cost of the intermediate temporary.
Components.Constructor
for example: var binary
inputstream = components.constructor("@mozilla.org/binary
inputstream;1"); var bis = new binary
inputstream(); print(bis.tostring()); // "[xpconnect wrapped nsisupports]" try { // some
inputstream is an existing nsi
inputstream // throws because bis hasn't been qi'd to nsibinary
inputstream bis.set
inputstream(some
inputstream); } catch (e) { bis.queryinterface(components.interfaces.nsibinary
inputstr...
...eam); bis.set
inputstream(some
inputstream); // succeeds now } if two arguments are given, the created instance will be nsisupports.queryinterface()'d to the xpcom interface whose name is the second argument: var binary
inputstream = components.constructor("@mozilla.org/binary
inputstream;1", "nsibinary
inputstream"); var bis = new binary
inputstream(); print(bis.tostring()); // "[xpconnect wrapped nsibinary
inputstream]" // some
inputstream is an existing nsi
inputstream bis.set
inputstream(some
inputstream); // succeeds if three arguments are given, then in addition to being nsisupports.queryinterface()'d, the instance will also have had an initialization method called on it.
... the arguments used with the initialization method are the arguments passed to the components.constructor()-created function when called: var binary
inputstream = components.constructor("@mozilla.org/binary
inputstream;1", "nsibinary
inputstream", "set
inputstream"); try { // throws, because number of arguments isn't equal to the number of // arguments nsibinary
inputstream.set
inputstream takes var bis = new binary
inputstream(); } catch (e) { // some
inputstream is an existing nsi
inputstream bis = new binary
inputstream(some
inputstream); // succeeds var bytes = bis.readbytearray(somenumberofbytes); // succeeds } compare instance creation from base principles with instance creation using compone...
...nts.constructor(); the latter is much easier to read than the former (particularly if you're creating instances of a component in many different places): var bis = components.classes["@mozilla.org/binary
inputstream;1"] .createinstance(components.interfaces.nsibinary
inputstream); bis.set
inputstream(some
inputstream); // assumes binary
inputstream was initialized previously var bis = new binary
inputstream(some
inputstream); components.constructor() is purely syntactic sugar (albeit speedy and pretty syntactic sugar) for actions that can be accomplished using other common methods.
nsIAccessibleProvider
this property is used for upload,
input[type="xsd:gday"] and
input[type="xsd:gmonth"] xformslabel 0x00002001 used for label element.
... xforms
input 0x00002004 used for
input and textarea elements.
... xforms
inputboolean 0x00002005 used for
input[xsd:boolean] element.
... xforms
inputdate 0x00002006 used for
input[xsd:date] element.
nsIAccessibleRole
it is used for xul:checkbox, html:
input@type="checkbox", role="checkbox", boolean xforms:
input.
...it is used for xul:radio, html:
input@type="radio", role="radio".
...it is used for date xforms:
input.
... role_ime 110 an object which is used to allow
input of characters not found on a keyboard, such as the
input of chinese characters on a western keyboard.
nsIAuthModule
void getnexttoken( [const] in voidptr aintoken, in unsigned long aintokenlength, out voidptr aouttoken, out unsigned long aouttokenlength ); parameters aintoken a buffer containing the
input token (for example a challenge from a server).
...aintokenlength the length of the
input token.
...aintokenlength the length of the
input token.
...aintokenlength the length of the
input token.
nsIDocShell
essionstorageforprincipal(in nsiprincipal principal, in domstring documenturi, in boolean create); nsidomstorage getsessionstorageforuri(in nsiuri uri, in domstring documenturi); void historypurged(in long numentries); void internalload(in nsiuri auri, in nsiuri areferrer, in nsisupports aowner, in pruint32 aflags, in wstring awindowtarget, in string atypehint, in nsi
inputstream apostdatastream, in nsi
inputstream aheadersstream, in unsigned long aloadflags, in nsishentry ashentry, in boolean firstparty, out nsidocshell adocshell, out nsirequest arequest); native code only!
... boolean isbeingdestroyed(); void loadstream(in nsi
inputstream astream, in nsiuri auri, in acstring acontenttype, in acstring acontentcharset, in nsidocshellloadinfo aloadinfo); native code only!
...void internalload( in nsiuri auri, in nsiuri areferrer, in nsisupports aowner, in pruint32 aflags, in wstring awindowtarget, in string atypehint, in nsi
inputstream apostdatastream, in nsi
inputstream aheadersstream, in unsigned long aloadflags, in nsishentry ashentry, in boolean firstparty, out nsidocshell adocshell, out nsirequest arequest ); parameters auri the uri to load.
...void loadstream( in nsi
inputstream astream, in nsiuri auri, in acstring acontenttype, in acstring acontentcharset, in nsidocshellloadinfo aloadinfo ); parameters astream the
input stream that provides access to the data to be loaded.
nsIJSON
jsobject decodefromstream(in nsi
inputstream stream, in long contentlength); astring encode(in jsobject value); obsolete since gecko 7.0 astring encodefromjsval(in jsvaljsval value, in jscontext cx); native code only!
... decodefromstream() decodes a json string read from an
input stream, returning the javascript object it represents.
... jsobject decodefromstream( in nsi
inputstream stream, in long contentlength ); parameters stream the nsi
inputstream from which to read the json string.
... jsval legacydecodefromstream( in nsi
inputstream stream, in long contentlength ); parameters stream the nsi
inputstream from which to read the json string to decode.
nsIScriptableUnicodeConverter
erview acstring convertfromunicode(in astring asrc); acstring finish(); astring converttounicode(in acstring asrc); astring convertfrombytearray([const,array,size_is(acount)] in octet adata, in unsigned long acount); void converttobytearray(in astring astring,[optional] out unsigned long alen,[array, size_is(alen),retval] out octet adata); nsi
inputstream convertto
inputstream(in astring astring); attributes attribute type description charset string current character set.
... void converttobytearray(in astring astring, out unsigned long alen, optional [array, size_is(alen),retval] out octet adata ); convertto
inputstream() converts a unicode string to an
input stream.
... nsi
inputstream convertto
inputstream( in astring astring ); parameters astring the text to encode to the stream.
... return value an nsi
inputstream that will present the text specified in astring as its data.
nsIStreamListener
method overview void ondataavailable(in nsirequest arequest, in nsisupports acontext, in nsi
inputstream a
inputstream, in unsigned long aoffset, in unsigned long acount); methods ondataavailable() this method is called when the next chunk of data for the ongoing request may be read without blocking the calling thread.
... the data can be read from the nsi
inputstream object passed as the argument to this method.
...void ondataavailable( in nsirequest arequest, in nsisupports acontext, in nsi
inputstream a
inputstream, in unsigned long aoffset, in unsigned long acount ); parameters arequest an nsirequest indicating the source of the data.
...a
inputstream an nsi
inputstream from which the data is to be read.
nsITransport
method overview void close(in nsresult areason); nsi
inputstream open
inputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); nsioutputstream openoutputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); void seteventsink(in nsitransporteventsink asink, in nsieventtarget aeventtarget); constants open flags.
... open
inputstream() open an
input stream on this transport.
... nsi
inputstream open
inputstream( 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
inputstream.
Working with data
using strings with c functions you don't even need to convert strings when using them as
input parameters to c functions.
... using arrays of pointers if you need to work with c functions that accept arrays of pointers as
inputs, you can construct an array of pointers like this: var ptrarraytype = ctypes.char.ptr.array(5); var myarray = ptrarraytype(); var somecfunction = library.declare("somecfunction", ctypes.default_abi, ctypes.void_t, ctypes.char.ptr.array() /*same as ctypes.char.ptr.ptr*/); somecfunction(myarray); line 1 declares a new array type, capable of containing 5 arrays of pointers to c characters.
...line 4 declares the c function that accepts the array as an
input, and the last line calls that function.
...it accepts as its
input parameters the high and low 32-bit values and returns a new 64-bit integer.
Deprecated tools - Firefox Developer Tools
the editor mode can be triggered clicking on the icon on the right of the console
input, or with ctrl + b (cmd + b on macos) when in editor mode, the enter key adds a new line in the
input, and you can evaluate the expression using ctrl + enter (cmd + enter on macos).
... when evaluating, the
input isn't cleared, which makes it possible to quickly iterrate over a snippet of code.
... the results are displayed in the console output, to the right of the
input, providing immediate feedback.
... starting firefox 72, you can import a javascript file content in the console
input with ctrl + o (cmd + o on macos), as well as saving the console
input content to a file using ctrl + s (cmd + s on macos).
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.
... number of
inputs 1 number of outputs 1 (but may be left unconnected) channel count mode "max" channel count 2 channel interpretation "speakers" inheritance this interface inherits from the following parent interfaces: <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x...
... basic usage 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.
Background Tasks API - Web APIs
this code draws any pending updates to the document currently being displayed, runs any javascript code the page needs to run, accepts events from
input devices, and dispatches those events to the elements that should receive them.
...that function, enqueuetask(), looks like this: function enqueuetask(taskhandler, taskdata) { tasklist.push({ handler: taskhandler, data: taskdata }); totaltaskcount++; if (!taskhandle) { taskhandle = requestidlecallback(runtaskqueue, { timeout: 1000 }); } schedulestatusrefresh(); } enqueuetask() accepts as
input two parameters: taskhandler is a function which will be called to handle the task.
... taskdata is an object which is passed into the task handler as an
input parameter, to allow the task to receive custom data.
... we then create a new <div> element and set its contents to match the
input text.
ChannelSplitterNode - Web APIs
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.
... number of
inputs 1 number of outputs variable; default to 6.
...nction(data) { var source = ac.createbuffersource(); source.buffer = data; var splitter = ac.createchannelsplitter(2); source.connect(splitter); var merger = ac.createchannelmerger(2); // reduce the volume of the left channel only var gainnode = ac.creategain(); gainnode.gain.setvalueattime(0.5, ac.currenttime); splitter.connect(gainnode, 0); // connect the splitter back to the second
input of the merger: we // effectively swap the channels, here, reversing the stereo image.
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.
... var delay1; rangesynth.on
input = function() { delay1 = rangesynth.value; synthdelay.delaytime.setvalueattime(delay1, audioctx.currenttime); } specifications specification status comment web audio apithe definition of 'delaynode' in that specification.
DocumentOrShadowRoot.activeElement - Web APIs
often activeelement will return a html
inputelement or htmltextareaelement object if it has the text selection at the time.
...other times the focused element might be a <select> element (menu) or an <
input> element, of type "button", "checkbox", or "radio".
...for example, on macos systems, elements that aren't text
input elements are not typically focusable by default.
... note: focus (which element is receiving user
input events) is not the same thing as selection (the currently highlighted part of the document).
Element: compositionend event - Web APIs
the compositionend event is fired when a text composition system such as an
input method editor completes or cancels the current composition session.
... bubbles yes cancelable yes interface compositionevent event handler property none examples const
inputelement = document.queryselector('
input[type="text"]');
inputelement.addeventlistener('compositionend', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label> <
input type="text" id="example" name="example"> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="25">...
...</textarea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-template-areas: "control log"; } .control { grid-area: control; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; }
input[type="text"] { margin: .5rem 0; } kbd { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } js const
inputelement = document.queryselector('
input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(event) { log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; }
inputelement...
....addeventlistener('compositionstart', handleevent);
inputelement.addeventlistener('compositionupdate', handleevent);
inputelement.addeventlistener('compositionend', handleevent); result specifications specification status ui events working draft ...
Element: compositionstart event - Web APIs
the compositionstart event is fired when a text composition system such as an
input method editor starts a new composition session.
... bubbles yes cancelable yes interface compositionevent event handler property none examples const
inputelement = document.queryselector('
input[type="text"]');
inputelement.addeventlistener('compositionstart', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label> <
input type="text" id="example" name="example"> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="25">...
...</textarea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-template-areas: "control log"; } .control { grid-area: control; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; }
input[type="text"] { margin: .5rem 0; } kbd { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } js const
inputelement = document.queryselector('
input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(event) { log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; }
inputelement...
....addeventlistener('compositionstart', handleevent);
inputelement.addeventlistener('compositionupdate', handleevent);
inputelement.addeventlistener('compositionend', handleevent); result specifications specification status ui events working draft ...
Element: compositionupdate event - Web APIs
the compositionupdate event is fired when a new character is received in the context of a text composition session controlled by a text composition system such as an
input method editor.
... bubbles yes cancelable yes interface compositionevent event handler property none examples const
inputelement = document.queryselector('
input[type="text"]');
inputelement.addeventlistener('compositionupdate', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label> <
input type="text" id="example" name="example"> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="25"></textar...
...ea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-template-areas: "control log"; } .control { grid-area: control; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; }
input[type="text"] { margin: .5rem 0; } kbd { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } js const
inputelement = document.queryselector('
input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(event) { log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; }
inputelement.addeven...
...tlistener('compositionstart', handleevent);
inputelement.addeventlistener('compositionupdate', handleevent);
inputelement.addeventlistener('compositionend', handleevent); result specifications specification status ui events working draft ...
Element - Web APIs
element.tabstop is a boolean indicating if the element can receive
input focus via the tab key.
... composition events compositionend fired when a text composition system such as an
input method editor completes or cancels the current composition session.
... compositionstart fired when a text composition system such as an
input method editor starts a new composition session.
... compositionupdate fired when a new character is received in the context of a text composition session controlled by a text composition system such as an
input method editor.
FileReaderSync - Web APIs
methods filereadersync.readasarraybuffer() this method converts a specified blob or a file into an arraybuffer representing the
input data as a binary string.
... filereadersync.readasbinarystring() this method converts a specified blob or a file into a domstring representing the
input data as a binary string.
... filereadersync.readastext() this method converts a specified blob or a file into a domstring representing the
input data as a text string.
... filereadersync.readasdataurl() this method converts a specified blob or a file into a domstring representing the
input data as a data url.
Using FormData Objects - Web APIs
creating a formdata object from scratch you can build a formdata object yourself, instantiating it then appending fields to it by calling its append() method, like this: var formdata = new formdata(); formdata.append("username", "groucho"); formdata.append("accountnum", 123456); // number 123456 is immediately converted to a string "123456" // html file
input, chosen by user formdata.append("userfile", file
inputelement.files[0]); // javascript file-like object var content = '<a id="a"><b id="b">hey!</b></a>'; // the body of the new file...
... retrieving a formdata object from an html form to construct a formdata object that contains the data from an existing <form>, specify that form element when creating the formdata object: note: formdata will only use
input fields that use the name attribute.
...simply include an <
input> element of type file in your <form>: <form enctype="multipart/form-data" method="post" name="fileinfo"> <label>your email address:</label> <
input type="email" autocomplete="on" autofocus name="userid" placeholder="email" required size="32" maxlength="64" /><br /> <label>custom file label:</label> <
input type="text" name="filelabel" size="12" maxlength="32" /><br /> <label>file to stas...
...h:</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 ooutput = 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) { ooutput.innerhtml = "uploaded!"; } else { ooutput.innerhtml = "error " + oreq.status + " occurred when trying to upload your file.<br \/>"; } }; oreq.send(odata); ev.preventdefault(); }, false); note: if you pass in ...
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.
... the gain is a unitless value, changing with time, that is multiplied to each corresponding sample of all
input 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.
GlobalEventHandlers.onkeypress - Web APIs
examples basic example this example logs the keyboardevent.code value whenever you press a key inside the <
input> element.
... html <
input> <p id="log"></p> javascript const
input = document.queryselector('
input'); const log = document.getelementbyid('log');
input.onkeypress = logkey; function logkey(e) { log.textcontent += ` ${e.code}`; } result filter keys with a regular expression this example filters the characters typed into a form field using a regular expression.
... html <label>enter numbers only: <
input> </label> javascript function numbersonly(event) { return event.charcode === 0 || /\d/.test(string.fromcharcode(event.charcode)); } const
input = document.queryselector('
input');
input.onkeypress = numbersonly; // prevent pasting (since pasted content might include non-number characters)
input.onpaste = event => false; result capture the typing of a hidden word the following javascript function will do something after the user types the word "exit" in any point of a page.
... const ssecret = /* choose your hidden word...: */ "exit"; let noffset = 0; document.onkeypress = function(opevt) { let oevent = opevt || window.event, nchr = oevent.charcode, snodetype = oevent.target.nodename.touppercase(); if (nchr === 0 || oevent.target.contenteditable.touppercase() === "true" || snodetype === "textarea" || snodetype === "
input" && oevent.target.type.touppercase() === "text") { return true; } if (nchr !== ssecret.charcodeat(noffset)) { noffset = nchr === ssecret.charcodeat(0) ?
HTMLFormElement: submit event - Web APIs
bubbles yes (although specified as a simple event that doesn't bubble) cancelable yes interface submitevent event handler property globaleventhandlers.onsubmit note that the submit event fires on the <form> element itself, and not on any <button> or <
input type="submit"> inside it.
... the submit event fires when the user clicks a submit button (<button> or <
input type="submit">) or presses enter while editing a field (e.g.
... <
input type="text">) in a form.
... html <form id="form"> <label>test field: <
input type="text"></label> <br><br> <button type="submit">submit form</button> </form> <p id="log"></p> javascript function logsubmit(event) { log.textcontent = `form submitted!
HTMLSelectElement - Web APIs
htmlselectelement.autofocus a boolean reflecting the autofocus html attribute, which indicates whether the control should have
input focus when the page loads, unless the user overrides it, for example by typing in a different control.
... htmlselectelement.blur() removes
input focus from this element.
... htmlselectelement.focus() gives
input focus to this element.
... events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface:
input event fires when the value of an <
input>, <select>, or <textarea> element has been changed.
Checking when a deadline is due - Web APIs
recording the date information to provide a reasonable user experience on mobile devices, and to cut down on ambiguities, i decided to create an html form with: a text
input for entering a title for your to-do list.
... number
inputs for the hour and minute parts of the deadline.
...on others you just get a standard text
input, which is okay.
... <select> elements for
inputting the day, month and year of the deadline.
KeyboardEvent.code - Web APIs
if the
input device isn't a physical keyboard, but is instead a virtual keyboard or accessibility device, the returned value will be set by the browser to match as closely as possible to what would happen with a physical keyboard, to maximize compatibility between physical and virtual
input devices.
... this property is useful when you want to handle keys based on their physical positions on the
input device rather than the characters associated with those keys; this is especially common when writing code to handle
input for games that simulate a gamepad-like environment using keys on the keyboard.
... handle keyboard events in a game this example establishes an event listener for keydown events that handle keyboard
input for a game that uses the typical "wasd" keyboard layout for steering forward, left, backward, and right.
...this function takes as
input the distance the ship is to be moved, where positive is a forward movement and negative is a backward movement.
LayoutShift - Web APIs
layoutshift.hadrecent
input returns true if there was a user
input in the past 500 milliseconds.
... layoutshift.last
inputtime returns the time of the most recent user
input.
...// https://bugs.webkit.org/show_bug.cgi?id=209216 try { let cumulativelayoutshiftscore = 0; const observer = new performanceobserver((list) => { for (const entry of list.getentries()) { // only count layout shifts without recent user
input.
... if (!entry.hadrecent
input) { cumulativelayoutshiftscore += entry.value; } } }); observer.observe({type: 'layout-shift', buffered: true}); document.addeventlistener('visibilitychange', () => { if (document.visibilitystate === 'hidden') { // force any pending records to be dispatched.
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 "video
input", "audio
input" or "audiooutput".
... navigator.mediadevices.enumeratedevices() .then(function(devices) { devices.foreach(function(device) { console.log(device.kind + ": " + device.label + " id = " + device.deviceid); }); }) .catch(function(err) { console.log(err.name + ": " + err.message); }); this might produce: video
input: id = cso9c0ypaf274oucpua53cne0yhlir2yxci+sqfbzz8= audio
input: id = rkxxbyjnabbadgqnnzqlvldmxls0yketycibg+xxnvm= audio
input: id = r2/xw1xupiyzunfv1lgrkoma5wtovckwfz368xcndm0= or if one or more media streams are active, or if persistent permissions have been granted: video
input: facetime hd camera (built-in) id=cso9c0ypaf274oucpua53cne0yhlir2yxci+sqfbzz8= audio
input: default (built-in microphone...
...) id=rkxxbyjnabbadgqnnzqlvldmxls0yketycibg+xxnvm= audio
input: built-in microphone id=r2/xw1xupiyzunfv1lgrkoma5wtovckwfz368xcndm0= specifications specification status comment media capture and streamsthe definition of 'mediadevicesinfo' in that specification.
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.
... navigator.mediadevices.enumeratedevices() .then(function(devices) { devices.foreach(function(device) { console.log(device.kind + ": " + device.label + " id = " + device.deviceid); }); }) .catch(function(err) { console.log(err.name + ": " + err.message); }); this might produce: video
input: id = cso9c0ypaf274oucpua53cne0yhlir2yxci+sqfbzz8= audio
input: id = rkxxbyjnabbadgqnnzqlvldmxls0yketycibg+xxnvm= audio
input: id = r2/xw1xupiyzunfv1lgrkoma5wtovckwfz368xcndm0= or if one or more mediastreams are active or persistent permissions are granted: video
input: facetime hd camera (built-in) id=cso9c0ypaf274oucpua53cne0yhlir2yxci+sqfbzz8= audio
input: default (built-in microphone) id=rkxxb...
...yjnabbadgqnnzqlvldmxls0yketycibg+xxnvm= audio
input: built-in microphone id=r2/xw1xupiyzunfv1lgrkoma5wtovckwfz368xcndm0= specifications specification status comment media capture and streamsthe definition of 'mediadevices: enumeratedevices' in that specification.
MediaDevices - Web APIs
the mediadevices interface provides access to connected media
input devices like cameras and microphones, as well as screen sharing.
... 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.
... getusermedia() with the user's permission through a prompt, turns on a camera and/or a microphone on the system and provides a mediastream containing a video track and/or an audio track with the
input.
MediaStreamAudioSourceNode - Web APIs
a mediastreamaudiosourcenode has no
inputs and exactly one output, and is created using the audiocontext.createmediastreamsource() method.
... 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.
... 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) { v...
... // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); // get new mouse pointer coordinates when mouse is moved // then set new gain value range.on
input = function() { biquadfilter.gain.value = range.value; } }) .catch(function(err) { console.log('the following gum error occured: ' + err); }); } else { console.log('getusermedia not supported on your browser!'); } // dump script to pre element pre.innerhtml = myscript.innerhtml; note: as a consequence of calling createmediastreamsource(), audio playba...
Using the MediaStream Recording API - Web APIs
when used with navigator.mediadevices.getusermedia(), it provides an easy way to record from the user's
input devices and instantly use the result in web apps.
...it even gives you a visualization of your device's sound
input, using the web audio api.
... all, we style the <label> how we want it, making sure that it has enough z-index to always sit above the other elements and therefore be focusable/clickable: label { font-family: 'notocoloremoji'; font-size: 3rem; position: absolute; top: 2px; right: 3px; z-index: 5; cursor: pointer; } then we hide the actual checkbox, because we don't want it cluttering up our ui:
input[type=checkbox] { position: absolute; top: -100px; } next, we style the information screen (wrapped in an <aside> element) how we want it, give it fixed position so that it doesn't appear in the layout flow and affect the main ui, transform it to the position we want it to sit in by default, and give it a transition for smooth showing/hiding: aside { position: fixed; top: 0; left:...
... height: 100%; transform: translatex(100%); transition: 0.6s all; background-color: #999; background-image: linear-gradient(to top right, rgba(0,0,0,0), rgba(0,0,0,0.5)); } last, we write a rule to say that when the checkbox is checked (when we click/focus the label), the adjacent <aside> element will have its horizontal translation value changed and transition smoothly into view:
input[type=checkbox]:checked ~ aside { transform: translatex(0); } basic app setup to grab the media stream we want to capture, we use getusermedia().
MediaStream Recording API - Web APIs
examining potential
input sources if your goal is to record camera and/or microphone
input, you may wish to examine the available
input devices before beginning the process of constructing the mediarecorder.
...you can then examine that list and identify the potential
input sources, and even filter the list based on desired criteria.
... in this code snippet, enumeratedevices() is used to examine the available
input devices, locate those which are audio
input devices, and create <option> elements that are then added to a <select> element representing an
input source picker.
... navigator.mediadevices.enumeratedevices() .then(function(devices) { devices.foreach(function(device) { let menu = document.getelementbyid("
inputdevices"); if (device.kind == "audio
input") { let item = document.createelement("option"); item.innerhtml = device.label; item.value = device.deviceid; menu.appendchild(item); } }); }); code similar to this can be used to let the user restrict the set of devices they wish to use.
Capabilities, constraints, and settings - Web APIs
the constraint exerciser lets you experiment with the results of different constraint sets being applied to the audio and video tracks coming from the computer's a/v
input devices (such as its webcam and microphone).
...in addition, the only acceptable
input device is a camera facing the user (a "selfie cam").
... you can specify one or more media
input device ids to establish restrictions on which
input sources are allowed.
...this returns a mediastream with the audio and video from a source matching the
inputs (typically a webcam, although if you provide the right constraints you can get media from other sources).
RTCDataChannel: open event - Web APIs
it enables the message
input box and send button as well as enabling the disconnect button and disabling the connect button.
... finally, the message
input box is focused so the user can immediately begin to type.
... dc.addeventlistener("open", ev => { message
inputbox.disabled = false; sendmessagebutton.disabled = false; disconnectbutton.disabled = false; connectbutton.disabled = true; message
inputbox.focus(); }, false); this can also be done by directly setting the value of the channel's onopen event handler property.
... dc.onopen = ev => { message
inputbox.disabled = false; sendmessagebutton.disabled = false; disconnectbutton.disabled = false; connectbutton.disabled = true; message
inputbox.focus(); } ...
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.
... example in our stereopannernode example (see source code) html we have a simple <audio> element along with a slider <
input> to increase and decrease pan value.
...we then use an on
input event handler to change the value of the stereopannernode.pan parameter and update the pan value display when the slider is moved.
... = document.queryselector('.panning-value'); pre.innerhtml = myscript.innerhtml; // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a stereo panner var pannode = audioctx.createstereopanner(); // event handler function to increase panning to the right and left // when the slider is moved pancontrol.on
input = function() { pannode.pan.setvalueattime(pancontrol.value, audioctx.currenttime); panvalue.innerhtml = pancontrol.value; } // connect the mediaelementaudiosourcenode to the pannode // and the pannode to the destination, so we can play the // music and adjust the panning using the controls source.connect(pannode); pannode.connect(audioctx.destination); specifications specification...
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 serversocket(80); try { system.out.println("server has started on 127.0.0.1:80.\r\nwaiting for a connection..."); socket client = server.accept(); system.out.println("a client connected."); socket methods: java.net.socket get
inputstream() returns an
input stream for this socket.
...
inputstream methods: read(byte[] b, int off, int len) reads up to len bytes of data from the
input stream into an array of bytes.
...
inputstream in = client.get
inputstream(); outputstream out = client.getoutputstream(); 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.
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
this is demonstrated in the example implementing rotation based on non-xr
inputs, which demonstrates a way to use this method to let the user use their mouse to pitch and yaw their viewing angle.
... implementing rotation based on non-xr
inputs the
input controls supported directly by webxr are all dedicated vr or ar
input devices.
... in order to use mouse, keyboard, or other
input devices to move or otherwise transform objects in the 3d space—or to allow the user to move through the space—you'll need to write some code to read the
inputs and move perform the movements.
... this new reference space is one in which the viewer's position is unchanged, but their orientation has been altered based on the pitch and yaw values generated from the accumulated mouse
inputs.
XRSession: select event - Web APIs
the webxr event select is sent to an xrsession when one of the session's
input sources has completed a primary action.
... bubbles yes cancelable no interface xr
inputsourceevent event handler property onselect for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in
inputs and
input sources.
...the handler fetches the pose representing the target ray for tracked-pointer
inputs and sends the pose's transform to a function called myhandleselectwithray().
... xrsession.addeventlistener("select", event => { if (event.
inputsource.targetraymode == "tracked-pointer") { let targetraypose = event.frame.getpose(event.
inputsource.targetrayspace, myrefspace); if (targetraypose) { myhandleselectwithray(targetraypose.transform); } } }); you can of course also set up a handler for select events by setting the xrsession object's onselect event handler property to a function that handles the event: xrsession.onselect = event => { if (event.
inputsource.targetraymode == "tracked-pointer") { let targetraypose = event.frame.getpose(event.
inputsource.targetrayspace, myrefspace); if (targetraypose) { myhandleselectwithray(targetraypose.transform); } } }; specif...
XRSession: selectend event - Web APIs
the webxr event selectend is sent to an xrsession when one of its
input sources ends its primary action or when an
input source that's in the process of handling an ongoing primary action is disconnected without successfully completing the action.
... bubbles yes cancelable no interface xr
inputsourceevent event handler property onselectend for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in
inputs and
input sources.
... upon receiving a select event, the mydropobject() function is called with the target object and the current target ray pose transform as
inputs.
... xrsession.addeventlistener("selectstart", onselectionevent); xrsession.addeventlistener("select", onselectionevent); xrsession.addeventlistener("selectend", onselectionevent); function onselectionevent(event) { let source = event.
inputsource; let targetobj = null; if (source.targetraymode != "tracked-pointer") { return; } let targetraypose = event.frame.getpose(source.targetrayspace, myrefspace); if (!targetraypose) { return; } switch(event.type) { case "selectstart": targetobj = mybegintracking(targetraypose.matrix); break; case "select": mydropobject(targetobj, targetraypose.
XRSession: selectstart event - Web APIs
the webxr event selectstart is sent to an xrsession when the user begins a primary action on one of its
input sources.
... bubbles yes cancelable no interface xr
inputsourceevent event handler property onselectstart for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in
inputs and
input sources.
... upon receiving a select event, the mydropobject() function is called with the target object and the current target ray pose transform as
inputs.
... xrsession.addeventlistener("selectstart", onselectionevent); xrsession.addeventlistener("select", onselectionevent); xrsession.addeventlistener("selectend", onselectionevent); function onselectionevent(event) { let source = event.
inputsource; let targetobj = null; if (source.targetraymode != "tracked-pointer") { return; } let targetraypose = event.frame.getpose(source.targetrayspace, myrefspace); if (!targetraypose) { return; } switch(event.type) { case "selectstart": targetobj = mybegintracking(targetraypose.matrix); break; case "select": mydropobject(targetobj, targetraypose.
XRSession: squeezeend event - Web APIs
the webxr event squeezeend is sent to an xrsession when one of its
input sources ends its primary action or when an
input source that's in the process of handling an ongoing primary action is disconnected without successfully completing the action.
... bubbles yes cancelable no interface xr
inputsourceevent event handler property onsqueezeend for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in
inputs and
input sources.
... upon receiving a squeeze event, the mydropobject() function is called with the target object and the current target ray pose transform as
inputs.
... xrsession.addeventlistener("squeezestart", onsqueezeevent); xrsession.addeventlistener("squeeze", onsqueezeevent); xrsession.addeventlistener("squeezeend", onsqueezeevent); function onsqueezeevent(event) { let source = event.
inputsource; let targetobj = null; if (source.targetraymode != "tracked-pointer") { return; } let targetraypose = event.frame.getpose(source.targetrayspace, myrefspace); if (!targetraypose) { return; } switch(event.type) { case "squeezestart": targetobj = mybegintracking(targetraypose.matrix); break; case "squeeze": mydropobject(targetobj, targetraypos...
XRSession: squeezestart event - Web APIs
the webxr event squeezestart is sent to an xrsession when the user begins a primary squeeze action on one of its
input sources.
... bubbles yes cancelable no interface xr
inputsourceevent event handler property onsqueezestart for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in
inputs and
input sources.
... upon receiving a squeeze event, the mydropobject() function is called with the target object and the current target ray pose transform as
inputs.
... xrsession.addeventlistener("squeezestart", onsqueezeevent); xrsession.addeventlistener("squeeze", onsqueezeevent); xrsession.addeventlistener("squeezeend", onsqueezeevent); function onsqueezeevent(event) { let source = event.
inputsource; let targetobj = null; if (source.targetraymode != "tracked-pointer") { return; } let targetraypose = event.frame.getpose(source.targetrayspace, myrefspace); if (!targetraypose) { return; } switch(event.type) { case "squeezestart": targetobj = mybegintracking(targetraypose.matrix); break; case "squeeze": mydropobject(targetobj, targetraypos...
Web APIs
ontentelement htmldlistelement htmldataelement htmldatalistelement htmldetailselement htmldialogelement htmldivelement htmldocument htmlelement htmlembedelement htmlfieldsetelement htmlfontelement htmlformcontrolscollection htmlformelement htmlframesetelement htmlhrelement htmlheadelement htmlheadingelement htmlhtmlelement htmlhyperlinkelementutils htmliframeelement htmlimageelement html
inputelement htmlisindexelement htmlkeygenelement htmllielement htmllabelelement htmllegendelement htmllinkelement htmlmapelement htmlmarqueeelement htmlmediaelement htmlmenuelement htmlmenuitemelement htmlmetaelement htmlmeterelement htmlmodelement htmlolistelement htmlobjectelement htmloptgroupelement htmloptionelement htmloptionscollection htmlorforeignelement htmloutputelement htmlparagraph...
... idbenvironment idbenvironmentsync idbfactory idbfactorysync idbindex idbindexsync idbkeyrange idblocaleawarekeyrange idbmutablefile idbobjectstore idbobjectstoresync idbopendbrequest idbrequest idbtransaction idbtransactionsync idbversionchangeevent idbversionchangerequest iirfilternode idledeadline imagebitmap imagebitmaprenderingcontext imagecapture imagedata index
inputdevicecapabilities
inputevent installevent installtrigger intersectionobserver intersectionobserverentry interventionreportbody k keyboard keyboardevent keyboardlayoutmap keyframeeffect keyframeeffectoptions l largestcontentfulpaint layoutshift layoutshiftattribution linearaccelerationsensor linkstyle localfilesystem localfilesystemsync localmediastream location lock lockmana...
...ger lockedfile m midiaccess midiconnectionevent midi
input midi
inputmap midimessageevent midioutputmap mscandidatewindowhide mscandidatewindowshow mscandidatewindowupdate msgestureevent msgraphicstrust msmanipulationevent msrangecollection mssitemodeevent magnetometer mathmlelement mediacapabilities mediacapabilitiesinfo mediaconfiguration mediadecodingconfiguration mediadeviceinfo mediadevices mediaelementaudiosourcenode mediaencodingconfiguration mediaerror mediaimage mediakeymessageevent mediakeysession mediakeystatusmap mediakeysystemaccess mediakeysystemconfiguration mediakeys medialist mediametadata mediapositionstate mediaquerylist mediaquerylistevent mediaquerylistlistener mediarecorder mediarecordererrorevent mediasession mediasessionactiondetails mediasettingsrange med...
...ation workernavigator worklet writablestream writablestreamdefaultcontroller writablestreamdefaultwriter x xdomainrequest xmldocument xmlhttprequest xmlhttprequesteventtarget xmlhttprequestresponsetype xmlserializer xpathevaluator xpathexception xpathexpression xpathnsresolver xpathresult xrboundedreferencespace xrenvironmentblendmode xreye xrframe xrframerequestcallback xrhandedness xr
inputsource xr
inputsourcearray xr
inputsourceevent xr
inputsourceeventinit xr
inputsourceschangeevent xr
inputsourceschangeeventinit xrpermissiondescriptor xrpermissionstatus xrpose xrreferencespace xrreferencespaceevent xrreferencespaceeventinit xrreferencespacetype xrrenderstate xrrenderstateinit xrrigidtransform xrsession xrsessionevent xrsessioneventinit xrsessioninit xrsessionmode xrspace xrsyst...
ARIA: button role - Accessibility
<div id="savechanges" tabindex="0" role="button" aria-pressed="false">save</div> the above example creates a simple button which is first in the focus order, though <button> or <
input> with type="button" should be used for buttons: <button id="savechanges">save</button> note: if using role="button" instead of the semantic <button> or <
input type="button"> elements, you will need to make the element focusable and have to define event handlers for click and keydown events, including the enter and space keys, in order to process the user's
input.
... html <h1>aria button example</h1> <ul id="namelist"></ul> <label for="newname">enter your name: </label> <
input type="text" id="newname"> <span role="button" tabindex="0" onclick="handlecommand()" onkeydown="handlecommand()">add name</span> css [role="button"] { padding: 2px; background-color: navy; color: white; cursor: default; } [role="button"]:hover, [role="button"]:focus, [role="button"]:active { background-color: white; color: navy; } ul { list-style: none; } javascript f...
...unction handlecommand(event) { // handles both mouse clicks and keyboard // activate with enter or space // get the new name value from the
input element let newname
input = document.getelementbyid('newname'); let name = newname
input.value; newname
input.value = ''; // clear the text field newname
input.focus(); // give the text field focus to enable entering and additional name.
... where possible, it is recommended to use native html buttons (<button>, <
input type="button">, <
input type="submit">, <
input type="reset"> and <
input type="image">) rather than the button role, as native html buttons are supported by all user agents and assistive technology and provide keyboard and focus requirements by default, without need for additional customization.
Text labels and names - Accessibility
examples <form> <fieldset> <legend>choose your favorite monster</legend> <
input type="radio" id="kraken" name="monster"> <label for="kraken">kraken</label><br/> <
input type="radio" id="sasquatch" name="monster"> <label for="sasquatch">sasquatch</label><br/> <
input type="radio" id="mothman" name="monster"> <label for="mothman">mothman</label> </fieldset> </form> you can see a live, interactive version of this example on the <fieldset> reference page.
...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.
... <
input type="checkbox" id="terms"> </label> <
input type="checkbox" id="emailoptin"> <label for="emailoptin">yes, please send me news about this product.</label> form elements should have a visible text label in addition to having a <label> for every form element, those labels should be visible, not hidden.
...this includes svg images, <img>, <canvas>, <map>, and <area> elements, as well as <
input> elements where type=image and <object> elements where the type starts with image/.
::-moz-range-thumb - CSS: Cascading Style Sheets
the ::-moz-range-thumb css pseudo-element is a mozilla extension that represents the thumb (i.e., virtual knob) of an <
input> of type="range".
... the user can move the thumb along the
input's track to alter its numerical value.
... note: using ::-moz-range-thumb with anything but an <
input type="range"> doesn't match anything and has no effect.
... syntax ::-moz-range-thumb examples html <
input type="range" min="0" max="100" step="5" value="50"/> css
input[type=range]::-moz-range-thumb { background-color: green; } result a progress bar using this style might look something like this: specifications not part of any standard.
:checked - CSS: Cascading Style Sheets
the :checked css pseudo-class selector represents any radio (<
input type="radio">), checkbox (<
input type="checkbox">), or option (<option> in a <select>) element that is checked or toggled to an on state.
... syntax :checked examples basic example html <div> <
input type="radio" name="my-
input" id="yes"> <label for="yes">yes</label> <
input type="radio" name="my-
input" id="no"> <label for="no">no</label> </div> <div> <
input type="checkbox" name="my-checkbox" id="opt-in"> <label for="opt-in">check me!</label> </div> <select name="my-select" id="fruit"> <option value="opt1">apples</option> <option value="opt2">grapes</option> <option value="o...
...pt3">pears</option> </select> css div, select { margin: 8px; } /* labels for checked
inputs */
input:checked + label { color: red; } /* radio element, when checked */
input[type="radio"]:checked { box-shadow: 0 0 0 3px orange; } /* checkbox element, when checked */
input[type="checkbox"]:checked { box-shadow: 0 0 0 3px hotpink; } /* option elements, when selected */ option:checked { box-shadow: 0 0 0 3px lime; color: red; } result toggling elements with a hidden checkbox this example utilizes the :checked pseudo-class to let the user toggle content based on the state of a checkbox, all without using javascript.
... html <
input type="checkbox" id="expand-toggle" /> <table> <thead> <tr><th>column #1</th><th>column #2</th><th>column #3</th></tr> </thead> <tbody> <tr class="expandable"><td>[more text]</td><td>[more text]</td><td>[more text]</td></tr> <tr><td>[cell text]</td><td>[cell text]</td><td>[cell text]</td></tr> <tr><td>[cell text]</td><td>[cell text]</td><td>[cell text]</td></tr> <tr class="expandable"><td>[more text]</td><td>[more text]</td><td>[more text]</td></tr> <tr class="expandable"><td>[more text]</td><td>[more text]</td><td>[more text]</td></tr> </tbody> </table> <label for="expand-toggle" id="expand-btn">toggle hidden rows</label> css /* hide the toggle checkbox */ #expand-toggle { display: none; } /* hide expandable content by default */ .expandabl...
:default - CSS: Cascading Style Sheets
what this selector matches is defined in html standard §4.16.3 pseudo-classes — it may match the <button>, <
input type="checkbox">, <
input type="radio">, and <option> elements: a default option element is the first one with the selected attribute, or the first enabled option in dom order.
... <
input type="checkbox"> and <
input type="radio"> match if they have the checked attribute.
...this also applies to <
input> types that submit forms, like image or submit.
... syntax :default examples html <fieldset> <legend>favorite season</legend> <
input type="radio" name="season" id="spring"> <label for="spring">spring</label> <
input type="radio" name="season" id="summer" checked> <label for="summer">summer</label> <
input type="radio" name="season" id="fall"> <label for="fall">fall</label> <
input type="radio" name="season" id="winter"> <label for="winter">winter</label> </fieldset> css
input:default { box-shadow: 0 0 2px 1px coral; }
input:default + label { color: coral; } result specifications specification status comment html living standardthe definition of ':default' in that specification.
:placeholder-shown - CSS: Cascading Style Sheets
the :placeholder-shown css pseudo-class represents any <
input> or <textarea> element that is currently displaying placeholder text.
... html <
input placeholder="type something here!"> css
input { border: 1px solid black; padding: 3px; }
input:placeholder-shown { border-color: teal; color: purple; font-style: italic; } result overflowing text when form fields are too small, placeholder text can get cropped in an undesirable way.
... html <
input id="
input1" placeholder="name, rank, and serial number"> <br><br> <
input id="
input2" placeholder="name, rank, and serial number"> css #
input2:placeholder-shown { text-overflow: ellipsis; } result customized
input field the following example highlights the branch and id code fields with a custom style.
... html <form id="test"> <p> <label for="name">enter student name:</label> <
input id="name" placeholder="student name"/> </p> <p> <label for="branch">enter student branch:</label> <
input id="branch" placeholder="student branch"/> </p> <p> <label for="sid">enter student id:</label> <
input type="number" pattern="[0-9]{8}" title="8 digit id" id="sid" class="studentid" placeholder="8 digit id"/> </p> <
input type="submit"/> </form> css
input { background-color: #e8e8e8; color: black; }
input.studentid:placeholder-shown { background-color: yellow; color: red; font-style: italic; } result specifications specification status comment selectors level 4the definition of ':placeholder-shown' in that specification.
:read-only - CSS: Cascading Style Sheets
the :read-only css pseudo-class represents an element (such as
input or textarea) that is not editable by the user.
...
input:read-only, textarea:read-only { background-color: #ccc; } p:read-only { background-color: #ccc; } syntax :read-only examples confirming form information in read-only/read-write controls one use of readonly form controls is to allow the user to check and verify information that they may have entered in an earlier form (for example, shipping details), while still being able to submit the information along with the rest of the form.
... the :read-only pseudo-class is used to remove all the styling that makes the
inputs look like clickable fields, making them look more like read-only paragraphs.the :read-write pseudo-class on the other hand is used to provide some nicer styling to the editable <textarea>.
...
input:-moz-read-only, textarea:-moz-read-only,
input:read-only, textarea:read-only { border: 0; box-shadow: none; background-color: white; } textarea:-moz-read-write, textarea:read-write { box-shadow: inset 1px 1px 3px #ccc; border-radius: 5px; } you can find the full source code at readonly-confirmation.html; this renders like so: styling read-only non-form controls this selector doesn't just select <
input>/<textarea> elements — it will select any element that cannot be edited by the user.
:read-write - CSS: Cascading Style Sheets
the :read-write css pseudo-class represents an element (such as
input or textarea) that is editable by the user.
...
input:read-write, textarea:read-write { background-color: #bbf; } p:read-write { background-color: #bbf; } syntax :read-write examples confirming form information in read-only/read-write controls one use of readonly form controls is to allow the user to check and verify information that they may have entered in an earlier form (for example, shipping details), while still being able to submit the information along with the rest of the form.
... the :read-only pseudo-class is used to remove all the styling that makes the
inputs look like clickable fields, making them look more like read-only paragraphs.the :read-write pseudo-class on the other hand is used to provide some nicer styling to the editable <textarea>.
...
input:-moz-read-only, textarea:-moz-read-only,
input:read-only, textarea:read-only { border: 0; box-shadow: none; background-color: white; } textarea:-moz-read-write, textarea:read-write { box-shadow: inset 1px 1px 3px #ccc; border-radius: 5px; } you can find the full source code at readonly-confirmation.html; this renders like so: styling read-write non-form controls this selector doesn't just select <
input>/<textarea> elements — it will select any element that can be edited by the user, such as a <p> element with contenteditable set on it.
any-hover - CSS: Cascading Style Sheets
the any-hover css media feature can be used to test whether any available
input mechanism can hover over elements.
... none none of the available
input mechanism(s) can hover conveniently, or there is no pointing
input mechanism.
... hover one or more available
input mechanisms can conveniently hover over elements.
... examples testing whether
input methods can hover html <a href="#">try hovering over me!</a> css @media (any-hover: hover) { a:hover { background: yellow; } } result specifications specification status comment media queries level 4the definition of 'any-hover' in that specification.
pointer - CSS: Cascading Style Sheets
none the primary
input mechanism does not include a pointing device.
... coarse the primary
input mechanism includes a pointing device of limited accuracy.
... fine the primary
input mechanism includes an accurate pointing device.
... html <
input id="test" type="checkbox" /> <label for="test">look at me!</label> css
input[type="checkbox"] { -moz-appearance: none; -webkit-appearance: none; appearance: none; border: solid; margin: 0; }
input[type="checkbox"]:checked { background: gray; } @media (pointer: fine) {
input[type="checkbox"] { width: 15px; height: 15px; border-width: 1px; border-color: blue; } } @media (pointer: coarse) {
input[type="checkbox"] { width: 30px; height: 30px; border-width: 2px; border-color: red; } } result specifications specification status comment media queries le...
@media - CSS: Cascading Style Sheets
name summary notes any-hover does any available
input mechanism allow the user to hover over elements?
... any-pointer is any available
input mechanism a pointing device, and if so, how accurate is it?
... height height of the viewport hover does the primary
input mechanism allow the user to hover over elements?
... pointer is the primary
input mechanism a pointing device, and if so, how accurate is it?
Typical use cases of Flexbox - CSS: Cascading Style Sheets
a common pattern is to have an <
input> element paired with a <button>, perhaps for a search form or where you simply want your visitor to enter an email address.
...i have contained my <button> and <
input> field in a wrapper which i have given a border and set to display: flex.
... i then use the flex properties to allow the <
input> field to grow, while the button does not grow.
...the stretchy
input field now has a little less space to play with but it uses the space left after the two items are accounted for.
<filter-function> - CSS: Cascading Style Sheets
the <filter-function> css data type represents a graphical effect that can change the appearance of an
input image.
... saturate() super-saturates or desaturates the
input image.
...label> <select id="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% } output { 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' || fil...
<length> - CSS: Cascading Style Sheets
examples length unit comparison the following demo provides you with an
input field in which you can enter a <length> value (e.g.
... html <div class="outer"> <div class="
input-container"> <label>enter width:</label> <
input type="text" id="length"> </div> <div class="inner"> </div> </div> <div class="results"> </div> css html { font-family: sans-serif; font-weight: bold; box-sizing: border-box; } .outer { width: 100%; height: 50px; background-color: #eee; position: relative; } .inner { height: 50px; background-color: #999; box-shadow: inset 3px 3px 5px rgba(255,255,255,0.5), inset -3px -3px 5px rgba(0,0,0,0.5); } .result { height: 20px; background-color: #999; box-shadow: inset 3px...
... 3px 5px rgba(255,255,255,0.5), inset -3px -3px 5px rgba(0,0,0,0.5); background-color: orange; display: flex; align-items: center; margin-top: 10px; } .result code { position: absolute; margin-left: 20px; } .results { margin-top: 10px; } .
input-container { position: absolute; display: flex; justify-content: flex-start; align-items: center; height: 50px; } label { margin: 0 10px 0 20px; } javascript const
inputdiv = document.queryselector('.inner'); const
inputelem = document.queryselector('
input'); const resultsdiv = document.queryselector('.results');
inputelem.addeventlistener('change', () => {
inputdiv.style.width =
inputelem.value; const result = document.createelement('div'); result.classname = 'result'; result.style.width =
inputelem...
....value; result.innerhtml = `<code>width: ${
inputelem.value}</code>`; resultsdiv.appendchild(result);
inputelem.value = '';
inputelem.focus(); }) result specifications specification status comment css values and units module level 4the definition of '<length>' 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.
...this includes support for selecting multiple files using the <
input> of type file html element's new multiple attribute.
...this can be used as an
input device (e.g., to make games that react to the position of the device) or to adapt the layout of a page to the orientation of the screen (portrait or landscape).
HTML attribute: max - HTML: Hypertext Markup Language
the max attribute defines the maximum value that is acceptable and valid for the
input containing the attribute.
... valid for the numeric
input types, including the date, month, week, time, datetime-local, number and range types, and both the <progress> and <meter> elements, the max attribute is a number that specifies the most positive value a form control to be considered valid.
... syntax syntax for max values by
input type
input type syntax example date yyyy-mm-dd <
input type="date" max="2019-12-25" step="1"> month yyyy-mm <
input type="month" max="2019-12" step="12"> week yyyy-w## <
input type="week" max="2019-w23" step=""> time hh:mm <
input type="time" max="17:00" step="900"> datetime-local yyyy-mm-ddthh:mm <
input type="datetime-local" min="2019-12-25t23:59"> number <number> <
input type="number" min="0" step="5" max="100"> range <number> <
input type="range" min="60" step=...
... syntax for max values for other elements
input type syntax example <progress> <number> <progress id="file" max="100" value="70"> 70% </progress> <meter> <number> <meter id="fuel" min="0" max="100" low="33" high="66" optimum="80" value="40"> at 40/100</meter> ...
HTML attribute: maxlength - HTML: Hypertext Markup Language
the maxlength attribute defines the maximum number of characters (as utf-16 code units) the user can enter into an <
input> or <textarea>.
...if no maxlength is specified, or an invalid value is specified, the
input or textarea has no maximum length.
...the
input will fail constraint validation if the length of the text value of the field is greater than maxlength utf-16 code units long.
... examples <
input type="password" maxlength="4"/> specifications specification status html living standardthe definition of 'maxlength attribute' in that specification.
Autoplay guide for media and Web Audio APIs - Web media technologies
this includes both the use of html attributes to autoplay media as well as the user of javascript code to start playback outside the context of handling user
input.
... consider this html for a media element: <video src="myvideo.mp4" autoplay onplay=handlefirstplay(event)"> here we have a <video> element whose autoplay attribute is set, with an onplay event handler set up; the event is handled by a function called handlefirstplay(), which receives as
input the play event.
... the play() method the term "autoplay" also refers to scenarios in which a script tries to trigger the playback of media that includes audio, outside the context of handling a user
input event.
...doing so outside the context of handling a user
input event is subject to autoplay rules.
in2 - SVG: Scalable Vector Graphics
the in2 attribute identifies the second
input for the given filter primitive.
... feblend for <feblend>, in2 defines the second
input image to the blending operation.
... value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes fecomposite for <fecomposite>, in2 defines the second
input image to the compositing operation.
... value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes fedisplacementmap for <fedisplacementmap>, in2 defines the second
input image, which is used to displace the pixels in the image defined in the in attribute.
textLength - SVG: Scalable Vector Graphics
example let's create a simple example that presents text you can resize using an <
input> element of type "range".
... html the html is also simple, with only two displayed elements contained inside a grouping <div>: <div class="controls"> <
input type="range" id="widthslider" min="80" max="978"> <span id="widthdisplay"></span> </div> the <
input> element, of type "range", is used to create the slider control the user will manipulate to change the width of the text.
...shing references to the elements it will need to access, using document.getelementbyid(): const widthslider = document.getelementbyid("widthslider"); const widthdisplay = document.getelementbyid("widthdisplay"); const textelement = document.getelementbyid("hello"); const baselength = math.floor(textelement.textlength.baseval.value); widthslider.value = baselength; widthslider.addeventlistener("
input", function(event) { textelement.textlength.baseval.newvaluespecifiedunits( svglength.svg_lengthtype_px, widthslider.valueasnumber); widthdisplay.innertext = widthslider.value; }, false); widthslider.dispatchevent(new event("
input")); after fetching the element references, an eventlistener is established by calling addeventlistener() on the slider control, to receive any
input events...
... when an "
input" event occurs, we call svglength.newvaluespecifiedunits() to set the value of textlength to the slider's new value, using the svglength interface's svg_lengthtype_px unit type to indicate that the value represents pixels.
xChannelSelector - SVG: Scalable Vector Graphics
/filter> <text x="10" y="60" font-size="50" filter="url(#displacementfilter)">some displaced text</text> <text x="10" y="120" font-size="50" filter="url(#displacementfilter2)">some displaced text</text> </svg> usage notes value r | g | b | a default value a animatable yes r this keyword specifies that the red color channel of the
input image defined in in2 will be used to displace the pixels of the
input image defined in in along the x-axis.
... g this keyword specifies that the green color channel of the
input image defined in in2 will be used to displace the pixels of the
input image defined in in along the x-axis.
... b this keyword specifies that the blue color channel of the
input image defined in in2 will be used to displace the pixels of the
input image defined in in along the x-axis.
... a this keyword specifies that the alpha channel of the
input image defined in in2 will be used to displace the pixels of the
input image defined in in along the x-axis.
yChannelSelector - SVG: Scalable Vector Graphics
/filter> <text x="10" y="60" font-size="50" filter="url(#displacementfilter)">some displaced text</text> <text x="10" y="120" font-size="50" filter="url(#displacementfilter2)">some displaced text</text> </svg> usage notes value r | g | b | a default value a animatable yes r this keyword specifies that the red color channel of the
input image defined in in2 will be used to displace the pixels of the
input image defined in in along the y-axis.
... g this keyword specifies that the green color channel of the
input image defined in in2 will be used to displace the pixels of the
input image defined in in along the y-axis.
... b this keyword specifies that the blue color channel of the
input image defined in in2 will be used to displace the pixels of the
input image defined in in along the y-axis.
... a this keyword specifies that the alpha channel of the
input image defined in in2 will be used to displace the pixels of the
input image defined in in along the y-axis.
<feConvolveMatrix> - SVG: Scalable Vector Graphics
a convolution combines pixels in the
input image with neighboring pixels to produce a resulting image.
... a matrix convolution is based on an n-by-m matrix (the convolution kernel) which describes how a given pixel value in the
input image is combined with its neighboring pixel values to produce a resulting pixel value.
... to illustrate, suppose you have a
input image which is 5 pixels by 5 pixels, whose color values for one of the color channels are as follows: 0 20 40 235 235 100 120 140 235 235 200 220 240 235 235 225 225 255 255 255 225 225 255 255 255 and you define a 3-by-3 convolution kernel as follows: 1 2 3 4 5 6 7 8 9 let's focus on the color value at the second row and second column of the image (source pixel value is 120).
... assuming the simplest case (where the
input image's pixel grid aligns perfectly with the kernel's pixel grid) and assuming default values for attributes ‘divisor’, ‘targetx’ and ‘targety’, then resulting color value will be: (9* 0 + 8* 20 + 7* 40 + 6*100 + 5*120 + 4*140 + 3*200 + 2*220 + 1*240) / (9+8+7+6+5+4+3+2+1) usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in order kernelmatrix divisor bias targetx targety edgemode kernelunitlength preservealpha dom interface this element implements the svgfeconvolvematrixelement interface.
context-menu - Archive of obsolete content
this includes non-
input elements with the contenteditable attribute set to true.
...if the menu was invoked in an
input text box or area, this is the selection of that element, otherwise the selection in the contents of the window.
... value the current contents of a
input text box or area if the menu was invoked in one, null otherwise.
io/text-streams - Archive of obsolete content
der = fileio.open(filename, "r"); if (!textreader.closed) { text = textreader.read(); textreader.close(); } } return text; } function writetexttofile(text, filename) { var fileio = require("sdk/io/file"); var textwriter = fileio.open(filename, "w"); if (!textwriter.closed) { textwriter.write(text); textwriter.close(); } } globals constructors textreader(
inputstream, charset) creates a buffered
input stream that reads text from a backing stream using a given text encoding.
... parameters
inputstream : stream the backing stream, an nsi
inputstream.
... charset : string
inputstream is expected to be in the character encoding named by this value.
Creating Reusable Modules - Archive of obsolete content
we can adapt it like this: var {cc, ci} = require("chrome"); // return the two-digit hexadecimal code for a byte function tohexstring(charcode) { return ("0" + charcode.tostring(16)).slice(-2); } function md5file(path) { var f = cc["@mozilla.org/file/local;1"] .createinstance(ci.nsilocalfile); f.initwithpath(path); var istream = cc["@mozilla.org/network/file-
input-stream;1"] .createinstance(ci.nsifile
inputstream); // open for reading istream.init(f, 0x01, 0444, 0); var ch = cc["@mozilla.org/security/hash;1"] .createinstance(ci.nsicryptohash); // we want to use the md5 algorithm ch.init(ch.md5); // this tells updatefromstream to read the entire file const pr_uint32_max = 0xffffffff; ch.updatefromstream(istream, pr_...
...e the hash, and log the hash to the console: var {cc, ci} = require("chrome"); // return the two-digit hexadecimal code for a byte function tohexstring(charcode) { return ("0" + charcode.tostring(16)).slice(-2); } function md5file(path) { var f = cc["@mozilla.org/file/local;1"] .createinstance(ci.nsilocalfile); f.initwithpath(path); var istream = cc["@mozilla.org/network/file-
input-stream;1"] .createinstance(ci.nsifile
inputstream); // open for reading istream.init(f, 0x01, 0444, 0); var ch = cc["@mozilla.org/security/hash;1"] .createinstance(ci.nsicryptohash); // we want to use the md5 algorithm ch.init(ch.md5); // this tells updatefromstream to read the entire file const pr_uint32_max = 0xffffffff; ch.updatefromstream(istream, pr_...
...md5file; the complete file looks like this: var {cc, ci} = require("chrome"); // return the two-digit hexadecimal code for a byte function tohexstring(charcode) { return ("0" + charcode.tostring(16)).slice(-2); } function md5file(path) { var f = cc["@mozilla.org/file/local;1"] .createinstance(ci.nsilocalfile); f.initwithpath(path); var istream = cc["@mozilla.org/network/file-
input-stream;1"] .createinstance(ci.nsifile
inputstream); // open for reading istream.init(f, 0x01, 0444, 0); var ch = cc["@mozilla.org/security/hash;1"] .createinstance(ci.nsicryptohash); // we want to use the md5 algorithm ch.init(ch.md5); // this tells updatefromstream to read the entire file const pr_uint32_max = 0xffffffff; ch.updatefromstream(istream, pr_...
XUL user interfaces - Archive of obsolete content
margin-bottom: 1em; } .demo-group column { margin-right: .5em; } .demo-group row { margin-bottom: .5em; } .demo-group .buttons { -moz-box-pack: end; } /* the day-of-week labels */ .day { margin-left: 1em; } .day[disabled] { color: #777; } .day:first-child { margin-left: 4px; } /* the left column labels */ .text-prompt { padding-top: .25em; } /* the date
input box */ #date-text { max-width: 8em; } /* the status bar */ statusbar { width: 100%; border: 1px inset -moz-dialog; margin: 4px; padding: 0px 4px; } #status { padding: 4px; } #status[warning] { color: red; } make a new text file, script7.js.
... discover the class of its html:
input element.
... this is the element that actually receives user
input.
Nanojit - Archive of obsolete content
the
input for nanojit is a stream of nanojit lir instructions.
...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.
... then a pointer to a function is used, which takes an int as
input and returns the sum of that parameter with two.
Venkman Introduction - Archive of obsolete content
type /commands in the
input area (the text box) to list all of the commands available.
... the
input area supports command history and tab-completion for command names.
... in the interactive session's
input field, enter this.fpaused venkman evaluates the expression, giving you [boolean] false back.
Using the Editor from XUL - Archive of obsolete content
editor event handling editing operations happen in response to user events: mouse, key, drag and drop, and ime (international text
input) events.
...in response to the handletext event, the editor sets the inline
input composition string.
...we call into the normal insertion code, which loops through the
input string looking for linebreaks, and inserts each text run, followed by a <br> when necessary.
Dialogs in XULRunner - Archive of obsolete content
xul has a wide range of
input controls you can use in a dialog.
... in the future, i will try to go into more detail on some of the existing and planned xul
input controls.
... future articles in this series will look at
input controls, printing, the clipboard, and xpcom.
-ms-accelerator - Archive of obsolete content
when alt + n is pressed, the <
input> element that defines an accesskey attribute value of "n" receives the focus.
... <!doctype html> <html> <head> <title>accelerator</title> </head> <body> <label for="oname"><u style="-ms-accelerator: true; accelerator: true">n</u>ame: </label> <
input type="text" id="oname" size="25" accesskey="n" value="your name here" /> </body> </html> specifications not part of any specification.
...the user presses the alt key and holds it while pressing the character to move
input focus to the object, and to invoke the default event associated with the object.
-ms-ime-align - Archive of obsolete content
the -ms-ime-align css property is a microsoft extension aligning the
input method editor (ime) candidate window box relative to the element on which the ime composition is active.
... ime candidate lists are positioned on the screen with sufficient size to allow basic text
input.
... in the case of -ms-ime-align: after, an ime might adjust the candidate window and keyboard
input behavior to provide a better user experience, such as using a horizontal candidate list and allowing some keys to be sent to the app for suggestion list navigation.
::-ms-check - Archive of obsolete content
the ::-ms-check css pseudo-element is a microsoft extension that represents checkboxes and radio button groups created by <
input type="checkbox"> and <
input type="radio">.
... display (values block, inline-block, none) @font-face font-size font-style font-weight height 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-check example html <form> <label for="redbutton">red</label> <
input type="radio" id="redbutton"><br> <label for="greencheckbox">green</label> <
input type="checkbox" id="greencheckbox"> </form> css
input, label { display: inline; }
input[type=radio]::-ms-check { border-color: red; /* this will make the border red when the button is checked.
...*/ }
input[type=checkbox]::-ms-check { border-color: green; /* this will make the box green when the button is checked.
XForms Alert Element - Archive of obsolete content
examples <xforms:model> <xforms:instance> <data xmlns=""> <x>10</x> </data> </xforms:instance> <xforms:bind id="x" nodeset="x" type="xsd:integer"/> </xforms:model> <style> @namespace xforms url("http://www.w3.org/2002/xforms"); xforms|
input:invalid xforms|alert.inline { display: inline; font-style: italic; width: 40%; } } </style> <xforms:
input bind="x"> <xforms:label>you can type only numbers (validation happens on blur): </xforms:label> <xforms:alert>wrong value!
... you should type only numbers!</xforms:alert> </xforms:
input> <xforms:
input bind="x"> <xforms:label>you can type only numbers (validation happens on blur): </xforms:label> <xforms:alert class="inline">wrong value!
... you should type only numbers!</xforms:alert> </xforms:
input> ...
Desktop gamepad controls - Game development
first off, we'll create a small library that will take care of handling the
input for us.
... the pressed() function gets the
input data and sets the information about it in our object, and the axes property stores the array containing the values signifying the amount an axis is pressed in the x and y directions, represented by a float in the (-1, 1) range.
...after a certain threshold is reached we can assume the
input is done deliberately by the user and can act accordingly.
2D maze game with device orientation - Game development
ball.mainmenu.prototype = { create: function() { this.add.sprite(0, 0, 'screen-mainmenu'); this.gametitle = this.add.sprite(ball._width*0.5, 40, 'title'); this.gametitle.anchor.set(0.5,0); this.startbutton = this.add.button(ball._width*0.5, 200, 'button-start', this.startgame, this, 2, 0, 1); this.startbutton.anchor.set(0.5,0); this.startbutton.
input.usehandcursor = true; }, startgame: function() { this.game.state.start('howto'); } }; to create a new button there's add.button method with the following list of optional arguments: top absolute position on canvas in pixels.
...let’s focus on the keyboard first by adding the following to the create() function : this.keys = this.game.
input.keyboard.createcursorkeys(); as you can see there’s a special phaser function called createcursorkeys(), which will give us an object with event handlers for the four arrow keys to play with: up, down, left and right.
...the this.keys object will be checked against player
input, so the ball can react accordingly with the predefined force: if(this.keys.left.isdown) { this.ball.body.velocity.x -= this.movementforce; } else if(this.keys.right.isdown) { this.ball.body.velocity.x += this.movementforce; } if(this.keys.up.isdown) { this.ball.body.velocity.y -= this.movementforce; } else if(this.keys.down.isdown) { this.ball.body.velocity.y += this.movementforce; } that way we can check which key is pressed at the given frame and apply the defined force to the ball, thus increase the velocity in the proper direction.
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
the controller the controller contains logic that updates the model and/or view in response to
input from the users of the app.
... so for example, our shopping list could have
input forms and buttons that allow us to add or delete items.
... these actions require the model to be updated, so the
input is sent to the controller, which then manipulates the model as appropriate, which then sends updated data to the view.
caret - MDN Web Docs Glossary: Definitions of Web-related terms
a caret (sometimes called a "text cursor") is an indicator displayed on the screen to indicate where text
input will be inserted.
... on the web, a caret is used to represent the insertion point in <
input> and <textarea> elements, as well as any elements whose contenteditable attribute is set, thereby allowing the contents of the element to be edited by the user.
... <
input type="text"> <
input type="password"> <
input type="search"> <
input type="date">, <
input type="time">, <
input type="datetime">, and <
input type="datetime-local"> <
input type="number">, <
input type="range"> <
input type="email">, <
input type="tel">, and <
input type="url"> <textarea> any element with its contenteditable attribute set ...
Test your skills: HTML accessibility - Learn web development
html accessibility 2 in the second task, you have a form containing three
input fields.
... you need to: semantically associate the
input with their labels.
... assume that these
inputs will be part of a larger form, and wrap them in an element that associates them all together as a single related group.
Fundamental text and font styling - Learn web development
playable code <div class="body-wrapper" style="font-family: 'open 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: 10...
...em;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 html
input = document.queryselector(".html-
input"); const css
input = document.queryselector(".css-
input"); const reset = document.getelementbyid("reset"); let htmlcode = html
input.value; let csscode = css
input.value; const output = document.queryselector(".output"); const styleelem = document.createelement('style'); const headelem = document.queryselector('head'); headelem.appendchild(styleelem); function drawoutput() { output.innerhtml = html
input.value; styleelem.textcontent = css
input.value; } reset.addeventlistener("click", function() { html
input.value = htmlcode; css
input.value = csscode; drawoutpu...
...t(); }); html
input.addeventlistener("
input", drawoutput); css
input.addeventlistener("
input", drawoutput); window.addeventlistener("load", drawoutput); test your skills!
Styling lists - Learn web development
playable code <div class="body-wrapper" style="font-family: 'open 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;"><ul> <li>first, light the candle.</li> <li>next, open the box.</li> <li>finally, place the three magic items in the box, in this exact order, to complete the spell: <ol> <li>the book of spells</li> <li>the shiny rod</li> <li>the goblin statue</li> ...
...</ol> </li> </ul></textarea> <h2>css
input</h2> <textarea id="code" class="css-
input" style="width: 90%;height: 10em;padding: 10px;border: 1px solid #0095dd;"></textarea> <h2>output</h2> <div class="output" style="width: 90%;height: 12em;padding: 10px;border: 1px solid #0095dd;overflow: auto;"></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 html
input = document.queryselector(".html-
input"); var css
input = document.queryselector(".css-
input"); var reset = document.getelementbyid("reset"); var htmlcode = html
input.value; var csscode = css
input.value; var output = document.queryselector(".output"); var solut...
...ion = document.getelementbyid("solution"); var styleelem = document.createelement('style'); var headelem = document.queryselector('head'); headelem.appendchild(styleelem); function drawoutput() { output.innerhtml = html
input.value; styleelem.textcontent = css
input.value; } reset.addeventlistener("click", function() { html
input.value = htmlcode; css
input.value = csscode; drawoutput(); }); solution.addeventlistener("click", function() { html
input.value = htmlcode; css
input.value = 'ul {\n list-style-type: square;\n}\n\nul li, ol li {\n line-height: 1.5;\n}\n\nol {\n list-style-type: lower-alpha\n}'; drawoutput(); }); html
input.addeventlistener("
input", drawoutput); css
input.addeventlistener("
input", drawoutput); window.addeventlistener("load", drawoutput); ...
Web forms — Working with user data - Learn web development
the different form controls basic native form controls we start off this section by looking at the functionality of the the original html <
input> types in detail, looking at what options are available to collect different types of data.
... the html5
input types here we continue our deep dive into the <
input> element, looking at the additional
input types provided when html5 was released, and the various ui controls and data collection enhancements they provide.
... other form controls next we take a look at all the non-<
input> form controls and associated tools, such as <select>, <textarea>, <meter>, and <progress>.
Debugging HTML - Learn web development
this webpage takes an html document as an
input, goes through it, and gives you a report to tell you what is wrong with your html.
... to specify the html to validate, you can provide a web address, upload an html file, or directly
input some html code.
... switch to the validate by direct
input tab.
Rendering a list of Vue components - Learn web development
while it would be great to use the name field, this field will eventually be controlled by user
input, which means we can't guarantee that the names would be unique.
...tribute to :label="item.label", and the :done="false" attribute to :done="item.done", as seen in context below: <ul> <li v-for="item in todoitems" :key="item.id"> <to-do-item :label="item.label" :done="item.done"></to-do-item> </li> </ul> now when you look at your running app, it'll show the todo items with their proper names, and if you inspect the source code you'll see that the
inputs all have unique ids, taken from the object in the app component.
... what we really need next is the ability to allow our users to enter their own todo items into the app, and for that we'll need a text <
input>, an event to fire when the data is submitted, a method to fire upon submission to add the data and rerender the list, and a model to control the data.
Using the Browser API
() { browser.getcangoback().then(function(result) { if (result) { back.disabled = false; console.log("it's possible to navigate the history backward."); } else { back.disabled = true; console.log("it's not possible to navigate the history backward."); } }); } implementing the url bar the url bar for our simple browser is a <form> containing a single text <
input>.
...when this fires, we set the value inside the url bar
input to be equal to the event object detail property — this is so that the url displayed continues to match the website being shown when the user navigates back and forth through the history.
... var searchactive = false; prev.disabled = true; next.disabled = true; next, we add an event listener to the searchform so that when it is submitted, the htmliframeelement.findall() method is used to do a search for the string entered into the search
input element (searchbar) within the text of the current page (the second parameter can be changed to 'case-insensitive' if you want a case-insensitive search.) we then enable the previous and next buttons, set searchactive to true, and blur() the search bar to make the keyboard disappear and stop taking up our screen once the search is submitted.
Localization and Plurals
install pluralform checker v0.3 extension extension
input it would be good to keep this list updated with all the words that need plural forms.
... people using the extension can then copy/paste this
input.
... 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 javascript module, pluralform.jsm.
NSPR Poll Method
in_flags [
input argument] the in_flags argument specifies the events at the top layer of the i/o layer stack that the caller is interested in.
...for example, consider an i/o layer that buffers
input data.
... if the caller wishes to test for read ready (that is, pr_poll_read is set in in_flags) and the layer has
input data buffered, the poll method would set the pr_poll_read event in *out_flags.
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_standard
input, pr_standardoutput, or pr_standarderror.
... description type prspecialfd is defined as follows: typedef enum prspecialfd{ pr_standard
input, pr_standardoutput, pr_standarderror } prspecialfd; #define pr_stdin pr_getspecialfd(pr_standard
input) #define pr_stdout pr_getspecialfd(pr_standardoutput) #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.
NSS Sample Code Utilities_1
ord(char *cp) { 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), inpu...
...ame, pr_geterror(), pr_getoserror()); rv = secfailure; goto cleanup; } if (ascii) { /* first convert ascii to binary */ secitem filedata; char *asc, *body; /* read in ascii data */ rv = filetoitem(&filedata, infile); asc = (char *)filedata.data; if (!asc) { pr_fprintf(pr_stderr, "unable to read data from
input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and remove them */ if ((body = strstr(asc, "-----begin")) != null) { char *trailer = null; asc = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(asc, '\r'); /* maybe this is a mac file */ ...
... if (body) trailer = strstr(++body, "-----end"); if (trailer != null) { *trailer = '\0'; } else { pr_fprintf(pr_stderr, "
input has header but no trailer\n"); port_free(filedata.data); rv = secfailure; goto cleanup; } } else { body = asc; } /* convert to binary */ rv = atob_convertasciitoitem(der, body); if (rv) { pr_fprintf(pr_stderr, "error converting ascii to binary %s\n", port_geterror()); port_free(filedata.data); rv = secfailure; goto cleanup; } port_free(filedata.data); } else { /* read in binary ...
FC_InitPIN
syntax ck_rv fc_initpin( ck_session_handle hsession, ck_char_ptr ppin, ck_ulong ulpinlen ); parameters fc_initpin() takes three parameters: hsession[
input] session handle.
... ppin[
input] pointer to the pin being set.
... ulpinlen [
input] length of the pin.
Necko Architecture
one of the arguments to the ondataavailable() notification is an nsi
inputstream (which can be considered the underlying data).
...nsi
inputstream is read from.
...when you receive the ondataavailable() callback, you are handed an nsi
inputsteam which you can read the data from (you will more than likely need to be able to handle multiple ondataavailable() callbacks, buffering the data you receive as necessary).
Tracing JIT
nanojit/lir.* the nanojit/lir.cpp and nanojit/lir.h files define the intermediate representation lir, which is used as
input to nanojit.
... an assembler runs in a single pass over its
input, transforming one lins value to zero or more nins values.
... it is important to keep in mind that this pass runs backwards from the last lins in the
input lir code to the first, generating native code in reverse.
JS_ClearRegExpStatics
clear the pending regexp
input and flags.
... description js_clearregexpstatics clears the pending
input string and flags of the built-in regexp object.
... see also mxr id search for js_clearregexpstatics js_newregexpobject js_newucregexpobject js_setregexp
input regexp ...
JS_ExecuteRegExp
execute a new regexp object to given
input string.
... chars const char16_t * a pointer to the string contains a
input string.
... description js_executeregexp and js_newregexpobjectnostatics execute the regexp object, reobj, to the specified
input string, chars, from *indexp index.
Gecko object attributes
event-from-
input was the root cause of this event explicit user
input?
... applied to: any widget that accepts
input exposed via aria: aria-datatype exposed in xforms: from boud instance node datatype draggable true when the accessible object can be grabbed.
...the line number is relative to the top of the currently focused area (the document, a rich text editable area, or an
input control).
XForms Accessibility
input a key xforms element to show and change the instance data to which it is bound (see the spec, the docs).
... the follwoing representations
input element are accessible: text field - see the docs.
... secret used for
inputting passwords (see the spec, the docs).
Building the WebLock UI
in this tutorial, focusing as it is on the weblock functionality (rather than the ui), we'll assume the strings we get from the ui itself are urls we actually want to write to the white list: function addthissite() { var tf = document.getelementbyid("dialog.
input"); // weblock is global and declared above weblock.addsite(tf.value); } this javascript function can be called directly from the xul widget, where the
input string is retrieved as the value property of the textbox element.
... <separator class="thin"/> <hbox align="center"> <textbox id="url.
input" flex="1"/> <button label="add this url" oncommand="addthissite();"/> </hbox> this snippet introduces a couple of new general layout widgets in xul.
...ww.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="web lock manager" style="width: 30em;" persist="screenx screeny" screenx="24" screeny="24"> <script src="chrome://weblock/content/weblock.js"/> <hbox> <separator orient="vertical" class="thin"/> <vbox flex="1"> <separator class="thin"/> <hbox align="center"> <textbox id="dialog.
input" flex="1"/> <button label="add this url" oncommand="addthissite();"/> </hbox> <hbox align="center"> <radiogroup onchange="togglelock();"> <radio label="lock"/> <radio label="unlock"/> </radiogroup> <spacer flex="1"/> </hbox> </vbox> </hbox> </dialog> overlaying new user interface into mozilla you've go...
inIDOMUtils
unsigned long aselectorindex); nsidomfontfacelist getusedfontfaces(in nsidomrange arange); bool haspseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); boolean isignorablewhitespace(in nsidomcharacterdata adatanode); bool isinheritedproperty(in astring apropertyname); void parsestylesheet(in nsidomcssstylesheet asheet, in domstring a
input); void removepseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); astring rgbtocolorname(in octet ar, in octet ag, in octet ab); bool selectormatcheselement(in nsidomelement aelement, in nsidomcssstylerule arule, in unsigned long aselectorindex, [optional] in domstring apseudo); void setcontentstate(in nsidomelement aelement, in unsigned long...
... void parsestylesheet( in nsidomcssstylesheet asheet, in domstring a
input ); parameters asheet a domcssstylesheet.
... a
input a domstring.
nsIAsyncOutputStream
any successful status code passed to this method is treated as ns_base_stream_closed, which has an effect equivalent to nsi
inputstream.close().
... note: this method exists in part to support pipes, which have both an
input end and an output end.
... if the output end of a pipe is closed, then reads from the
input end of the pipe will fail.
nsIChannel
method overview void asyncopen(in nsistreamlistener alistener, in nsisupports acontext); nsi
inputstream open(); attributes attribute type description contentcharset acstring the character set of the channel's content if available and if applicable.
... nsi
inputstream open(); parameters none.
... return value blocking
input stream to the channel's data.
nsICompositionStringSynthesizer
you need to use nsitext
inputprocessor instead of this.
...endcompositionevent("compositioncommit", "foo-bar-buzz", ""); method overview void appendclause(in unsigned long alength, in unsigned long aattribute); boolean dispatchevent(); void setcaret(in unsigned long aoffset, in unsigned long alength); void setstring(in astring astring); constants constant value description attr_raw_
input 0x02 a clause attribute.
...i.e., raw text of user
input.
nsIDOMSimpleGestureEvent
the following events are generated: mozswipegesture - generated when the user completes a swipe across across the
input device.
... moztapgesture - generated when the user executes a two finger tap gesture on the
input device.
...(xxx not implemented on mac) mozpresstapgesture - generated when the user executes a press and tap two finger gesture (first finger down, second finger down, second finger up, first finger up) on the
input device.
nsIEditorIMESupport
handles the start of inline
input composition.
... void begincomposition( in nstexteventreplyptr areply ); parameters areply endcomposition() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) handles the end of inline
input composition.
...sets the inline
input composition string.
nsIFaviconService
for chrome, this will do nothing and return the
input uri.
...for chrome, the output will be the same as the
input.
... for chrome, the output will be the same as the
input.
nsIFeedProcessor
to create an instance, use: var feedprocessor = components.classes["@mozilla.org/feed-processor;1"] .createinstance(components.interfaces.nsifeedprocessor); method overview void parseasync(in nsirequestobserver requestobserver, in nsiuri uri); void parsefromstream(in nsi
inputstream stream, in nsiuri uri); void parsefromstring(in astring str, in nsiuri uri); attributes attribute type description listener nsifeedresultlistener the feed result listener that will respond to feed events.
... parsefromstream() parses a feed from an nsi
inputstream.
... void parsefromstream( in nsi
inputstream stream, in nsiuri uri ); parameters stream pointer to the nsi
inputstream from which to read and parse the feed.
nsIHttpUpgradeListener
method overview void ontransportavailable(in nsisockettransport atransport, in nsiasync
inputstream asocketin, in nsiasyncoutputstream 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 nsiasync
inputstream asocketin, in nsiasyncoutputstream 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.
... asocketin the nsiasync
inputstream object representing the
input stream for data coming from the server over the socket connection.
nsISHEntry
an instance, use: var shentry = components.classes["@mozilla.org/browser/session-history-entry;1"] .createinstance(components.interfaces.nsishentry); method overview void addchildshell(in nsidocshelltreeitem shell); nsidocshelltreeitem childshellat(in long index); void clearchildshells(); nsishentry clone(); void create(in nsiuri uri, in astring title, in nsi
inputstream
inputstream, in nsilayouthistorystate layouthistorystate, in nsisupports cachekey, in acstring contenttype, in nsisupports owner, in unsigned long long docshellid, in boolean dynamiccreation); native code only!
... postdata nsi
inputstream post data for the document.
...void create( in nsiuri uri, in astring title, in nsi
inputstream
inputstream, in nsilayouthistorystate layouthistorystate, in nsisupports cachekey, in acstring contenttype, in nsisupports owner, in unsigned long long docshellid, in boolean dynamiccreation ); parameters uri title
inputstream layouthistorystate cachekey contenttype owner docshellid dynamiccreation violates the xpcom interface guidelines forgeteditordata() ...
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 binary
inputstream = cc('@mozilla.org/binary
inputstream;1', 'nsibinary
inputstream', 'set
inputstream'); var binaryoutputstream = cc('@mozilla.org/binaryoutputstream;1', 'nsibinaryoutputstream', 'setoutputstream'); var storagestream = cc('@mozilla.org/storagestream;1', 'nsistoragestream', 'init'); function tracinglistener() { this.receivedchunks = []; // array for incoming data.
...estatuscode; this.deferreddone = { promise: null, resolve: null, reject: null }; this.deferreddone.promise = new promise(function(resolve, reject) { this.resolve = resolve; this.reject = reject; }.bind(this.deferreddone)); object.freeze(this.deferreddone); this.promisedone = this.deferreddone.promise; } tracinglistener.prototype = { ondataavailable: function(arequest, acontext, a
inputstream, aoffset, acount) { var istream = new binary
inputstream(a
inputstream) // binarya
inputstream 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 binaryoutputstream(sstream.getoutputstream(0)); // binaryoutputstream // copy received data as they come.
... var data = istream.readbytes(acount); this.receivedchunks.push(data); ostream.writebytes(data, acount); this.originallistener.ondataavailable(arequest, acontext, sstream.new
inputstream(0), aoffset, acount); }, onstartrequest: function(arequest, acontext) { this.originallistener.onstartrequest(arequest, acontext); }, onstoprequest: function(arequest, acontext, astatuscode) { this.responsebody = this.receivedchunks.join(""); delete this.receivedchunks; this.responsestatus = astatuscode; this.originallistener.onstoprequest(arequest, acontext, astatuscode); this.deferreddone.resolve(); }, queryinterface: function(aiid) { if (aiid.equals(ci.nsistreamlistener) || aiid.equals(ci.nsisupports)) { return this; } throw cr.ns_nointerface; } }; var httpresponseobserv...
nsIUTF8ConverterService
the most common case is the
input is in 7bit non-ascii character sets like iso-2022-jp, hz or utf-7 (in its original form or a modified form used in imap folder names).
... aallowsubstitution when true, allow the decoder to substitute invalid
input sequences by replacement characters.
...make sure that all characters outside us-ascii in your
input spec are url-escaped if your spec is not in utf-8 (before url-escaping) because the presence of non-ascii characters is blindly regarded as an indication that your
input spec is in unescaped utf-8 and it will be returned without further processing.
nsIUploadChannel
inherits from: nsisupports last changed in gecko 1.7 method overview void setuploadstream(in nsi
inputstream astream, in acstring acontenttype, in long acontentlength); attributes attribute type description uploadstream nsi
inputstream get the stream (to be) uploaded by this channel.
...most implementations of this interface require that the stream: implement threadsafe addref and release implement nsi
inputstream.readsegments() implement nsiseekablestream.seek().
...void setuploadstream( in nsi
inputstream astream, in acstring acontenttype, in long acontentlength ); parameters astream the stream to be uploaded by this channel.
nsIUploadChannel2
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void explicitsetuploadstream(in nsi
inputstream astream, in acstring acontenttype, in long long acontentlength, in acstring amethod, in boolean astreamhasheaders); methods explicitsetuploadstream() sets a stream to be uploaded by this channel with the specified content-type and content-length header values.
... most implementations of this interface require that the stream: implement threadsafe addref and release implement nsi
inputstream.readsegments() implement nsiseekablestream.seek().
... void explicitsetuploadstream( in nsi
inputstream astream, in acstring acontenttype, in long long acontentlength, in acstring amethod, in boolean astreamhasheaders ); parameters astream the stream to be uploaded by this channel.
XPCOM Interface Reference by grouping
browser autocomplete nsiautocompletecontroller nsiautocomplete
input nsiautocompletesearch console nsiconsolelistener nsiconsolemessage nsiconsoleservice document nsidocshell dom device nsidomgeogeolocation nsidomgeoposition nsidomgeopositionaddress nsidomgeopositioncallback nsidomgeopositioncoords nsidomgeopositionerror nsidomgeopositionerrorcallback nsidomgeopositionoptions nsidomg...
... filesystem nsidirectoryenumerator nsidirectoryiterator nsidirectoryservice nsidirectoryserviceprovider nsidirectoryserviceprovider2 nsidirindex nsidirindexlistener nsidirindexparser nsifile nsilocalfile stream nsiasync
inputstream nsiasyncoutputstream nsiasyncstreamcopier nsibinary
inputstream nsibinaryoutputstream nsicontentsniffer nsiconverter
inputstream nsifile
inputstream nsifileoutputstream nsi
inputstream nsi
inputstreamcallback nsioutputstream nsioutputstreamcallback ...
... nsiscriptable
inputstream nsistreamlistener url nsiioservice nsistandardurl user nsiprompt nsipromptservice zipfile nsizipentry nsizipreader nsizipreadercache nsizipwriter file nsifilepicker nsifileprotocolhandler nsifilespec nsifilestreams nsifileutilities nsifileview memory nsimemory network channel nsichannel nsichanneleventsink nsirequest ...
Address Book examples
for example, in order to register a load listener for a contact, the following should take place within the scope of the contact editor dialog: /* an example load listener for a contact * acard the nsiabcard being loaded * adocument a reference to the contact editor document */ function foo(acard, adocument) { // do something useful, like disabling //
input fields that cards for this // address book type do not support.
...each photo handler must implement the following interface: /* * onload: function(acard, adocument): * called when the editor wants to populate the contact editor *
input fields with information about acard's photo.
... * the onshow method should take the
input fields in the document, * and render the requested photo in the img tag with id * atargetid.
Filelink Providers
example: <form id="provider-form" onsubmit="return false;"> <label for="username">username:</label> <
input id="username" type="text" required="true" /> <label for="server">server:</label> <
input id="server" type="text" required="true" /> <label for="port">port:</label> <
input id="port" pattern="[0-9]+" required="true" /> </form> the form is expected to use html5 form validation.
... for each
input event, the checkvalidity method of the form is automatically called.
... for example, the hightail implementation provides the following function: function extraargs() { var usernamevalue = document.getelementbyid("username").value; return { "username": {type: "char", value: usernamevalue}, }; } in this example, the username value is read from the
input, and then the specially-crafted object is returned.
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.
... const clock = lib.declare("clock", ctypes.default_abi, ctypes.unsigned_long); console.log("clocks since startup: " + clock()); the clock() function requires no
input parameters; it simply returns an unsigned long.
... example: multiple
input parameters this example declares the libc asctime() function, which converts a time structure into a string.
Set event listener breakpoints - Firefox Developer Tools
now when a keydown, keyup, keypress, or
input event occurs, execution will pause as soon as it enters the listener code.
...text
input, which can also be found at the top of the event listener breakpoints list.
... when you click in this
input and type a search term, the list of event listener types will filter by that term allowing you to find the events you want to break on more easily.
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.
... the number of channels in the
input must be between 0 and the maxchannelcount value or an exception is raised.
... 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.
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.
... // 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 ...
BaseAudioContext.createStereoPanner() - Web APIs
example in our stereopannernode example (see source code) html we have a simple <audio> element along with a slider <
input> to increase and decrease pan value.
...we then use an on
input event handler to change the value of the stereopannernode.pan parameter and update the pan value display when the slider is moved.
... = document.queryselector('.panning-value'); pre.innerhtml = myscript.innerhtml; // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a stereo panner var pannode = audioctx.createstereopanner(); // event handler function to increase panning to the right and left // when the slider is moved pancontrol.on
input = function() { pannode.pan.setvalueattime(pancontrol.value, audioctx.currenttime); panvalue.innerhtml = pancontrol.value; } // connect the mediaelementaudiosourcenode to the pannode // and the pannode to the destination, so we can play the // music and adjust the panning using the controls source.connect(pannode); pannode.connect(audioctx.destination); specifications specification...
BiquadFilterNode.getFrequencyResponse() - Web APIs
the two output arrays, magresponseoutput and phaseresponseoutput, must be created before calling this method; they must be the same size as the array of
input frequency values (frequencyarray).
... phaseresponseoutput a float32array to receive the computed phase response values in radians for each frequency value in the
input frequencyarray.
...we first create the float32arrays we need, one containing the
input frequencies, and two to receive the output magnitude and phase values: var myfrequencyarray = new float32array(5); myfrequencyarray[0] = 1000; myfrequencyarray[1] = 2000; myfrequencyarray[2] = 3000; myfrequencyarray[3] = 4000; myfrequencyarray[4] = 5000; var magresponseoutput = new float32array(5); var phaseresponseoutput = new float32array(5); next we create a <ul> element in our html to cont...
CanvasPattern.setTransform() - Web APIs
r matrix = svg1.createsvgmatrix(); var img = new image(); img.src = 'https://mdn.mozillademos.org/files/222/canvas_createpattern.png'; img.onload = function() { var pattern = ctx.createpattern(img, 'repeat'); pattern.settransform(matrix.rotate(-45).scale(1.5)); ctx.fillstyle = pattern; ctx.fillrect(0, 0, 400, 400); }; note that newer browser versions started to support dommatrix as an
input to settransform(), so for example you could replace the svgmatrix in the above example with the following: const matrix = new dommatrix([1, .2, .8, 1, 0, 0]); edit the code below and see your changes update live in the canvas: playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <svg id="svg1" style="display:none"></svg> <div class="playable-buttons"> ...
... <
input id="edit" type="button" value="edit" /> <
input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code" style="height:120px"> var img = new image(); img.src = 'https://mdn.mozillademos.org/files/222/canvas_createpattern.png'; img.onload = function() { var pattern = ctx.createpattern(img, 'repeat'); pattern.settransform(matrix.rotate(-45).scale(1.5)); ctx.fillstyle = pattern; ctx.fillrect(0, 0, 400, 400); };</textarea> var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var edit = document.getelementbyid('edit'); var code = textarea.value; var svg1 = document.getelementbyid('svg1'); var matrix = svg1.createsvgmatrix()...
...; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener('click', function() { textarea.focus(); }) textarea.addeventlistener('
input', drawcanvas); window.addeventlistener('load', drawcanvas); specifications specification status comment html living standardthe definition of 'canvaspattern.settransform' in that specification.
CanvasRenderingContext2D.filter - Web APIs
a value of 0 leaves the
input unchanged.
...a value of 0% will create an image that is completely black, while a value of 100% leaves the
input unchanged.
...a value of 0deg leaves the
input unchanged.
Applying styles and colors - Web APIs
function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); // clear canvas ctx.clearrect(0, 0, 150, 150); // draw guides ctx.strokestyle = '#09f'; ctx.linewidth = 2; ctx.strokerect(-5, 50, 160, 50); // set line styles ctx.strokestyle = '#000'; ctx.linewidth = 10; // check
input if (document.getelementbyid('miterlimit').value.match(/\d+(\.\d+)?/)) { ctx.miterlimit = parsefloat(document.getelementbyid('miterlimit').value); } else { alert('value must be a positive number'); } // draw lines ctx.beginpath(); ctx.moveto(0, 100); for (i = 0; i < 24 ; i++) { var dy = i % 2 == 0 ?
... 25 : -25; ctx.lineto(math.pow(i, 1.5) * 2, 75 + dy); } ctx.stroke(); return false; } <table> <tr> <td><canvas id="canvas" width="150" height="150"></canvas></td> <td>change the <code>miterlimit</code> by entering a new value below and clicking the redraw button.<br><br> <form onsubmit="return draw();"> <label>miter limit</label> <
input type="number" size="3" id="miterlimit"/> <
input type="submit" value="redraw"/> </form> </td> </tr> </table> document.getelementbyid('miterlimit').value = document.getelementbyid('canvas').getcontext('2d').miterlimit; draw(); screenshotlive sample using line dashes the setlinedash method and the linedashoffset property specify the dash pattern for lines.
...as you can see here, both the strokestyle and fillstyle properties can accept a canvasgradient object as valid
input.
Document.forms - Web APIs
note: similarly, you can access a list of a form's component user
input elements using the htmlformelement.elements property.
... examples getting form information <!doctype html> <html lang="en"> <head> <title>document.forms example</title> </head> <body> <form id="robby"> <
input type="button" onclick="alert(document.forms[0].id);" value="robby's form" /> </form> <form id="dave"> <
input type="button" onclick="alert(document.forms[1].id);" value="dave's form" /> </form> <form id="paul"> <
input type="button" onclick="alert(document.forms[2].id);" value="paul's form" /> </form> </body> </html> getting an element from within a form var selectform = document.forms[in...
...dex]; var selectformelement = document.forms[index].elements[index]; named form access <!doctype html> <html lang="en"> <head> <title>document.forms example</title> </head> <body> <form name="login"> <
input name="email" type="email"> <
input name="password" type="password"> <button type="submit">log in</button> </form> <script> var loginform = document.forms.login; // or document.forms['login'] loginform.elements.email.placeholder = 'test@example.com'; loginform.elements.password.placeholder = 'password'; </script> </body> </html> specifications specification status comment html living standardthe definition of 'document.forms' in that specification.
Document - Web APIs
globaleventhandlers.onauxclick an eventhandler called when an auxclick event is sent, indicating that a non-primary button has been pressed on an
input device (e.g.
... globaleventhandlers.on
input is an eventhandler representing the code to be called when the
input event is raised.
... document.
inputencoding read only alias of document.characterset.
Examples of web and XML development using the DOM - Web APIs
attributes <!doctype html> <html lang="en"> <head> <title>modifying an image border</title> <script> function setborderwidth(width) { document.getelementbyid("img1").style.borderwidth = width + "px"; } </script> </head> <body> <p> <img id="img1" src="image1.gif" style="border: 5px solid green;" width="100" height="100" alt="border test"> </p> <form name="formname"> <
input type="button" value="make border 20px-wide" onclick="setborderwidth(20);" /> <
input type="button" value="make border 5px-wide" onclick="setborderwidth(5);" /> </form> </body> </html> example 3: manipulating styles in this simple example, some basic style properties of an html paragraph element are accessed using the style object on the element and that object's css style properties, which ...
... <!doctype html> <html lang="en"> <head> <title>changing color and font-size example</title> <script> function changetext() { var p = document.getelementbyid("pid"); p.style.color = "blue" p.style.fontsize = "18pt" } </script> </head> <body> <p id="pid" onclick="window.location.href = 'http://www.cnn.com/';">linker</p> <form> <p><
input value="rec" type="button" onclick="changetext();" /></p> </form> </body> </html> example 4: using stylesheets the stylesheets property on the document object returns a list of the stylesheets that have been loaded on that document.
...tview.getcomputedstyle(refdiv, null).getpropertyvalue("background-color"); txtbackgroundcolor.value = b_style; } </script> <style> #d1 { margin-left: 10px; background-color: rgb(173, 216, 230); height: 20px; max-width: 20px; } </style> </head> <body> <div id="d1"> </div> <form action=""> <p> <button type="button" onclick="cstyles();">getcomputedstyle</button> height<
input id="t1" type="text" value="1" /> max-width<
input id="t2" type="text" value="2" /> bg-color<
input id="t3" type="text" value="3" /> </p> </form> </body> </html> example 7: displaying event object properties this example uses dom methods to display all the properties of the window.onload event object and their values in a table.
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.
Element: keydown event - Web APIs
keyboard events are only generated by <
inputs>, <textarea> and anything with the contenteditable attribute or with tabindex="-1".
... do something like this (229 is a special value set for a keycode relating to an event that has been processed by an ime): eventtarget.addeventlistener("keydown", event => { if (event.iscomposing || event.keycode === 229) { return; } // do something }); examples addeventlistener keydown example this example logs the keyboardevent.code value whenever you press down a key inside the <
input> element.
... <
input placeholder="click here, then press down a key." size="40"> <p id="log"></p> const
input = document.queryselector('
input'); const log = document.getelementbyid('log');
input.addeventlistener('keydown', logkey); function logkey(e) { log.textcontent += ` ${e.code}`; } onkeydown equivalent
input.onkeydown = logkey; specifications specification status ui events working draft ...
Element: keypress event - Web APIs
since this event has been deprecated, you should look to use before
input or keydown instead.
... interface keyboardevent bubbles yes cancelable yes default action varies: keypress event; launch text composition system; blur and focus events; domactivate event; other event examples addeventlistener keypress example this example logs the keyboardevent.code value whenever you press a key after focussing the <
input> element.
... <div> <label for="sample">focus the
input and type something:</label> <
input type="text" name="text" id="sample"> </div> <p id="log"></p> const log = document.getelementbyid('log'); const
input = document.queryselector('
input');
input.addeventlistener('keypress', logkey); function logkey(e) { log.textcontent += ` ${e.code}`; } onkeypress equivalent
input.onkeypress = logkey; specifications specification status ui events working draft ...
Using Fetch - Web APIs
onst data = { username: 'example' }; fetch('https://example.com/profile', { method: 'post', // or 'put' headers: { 'content-type': 'application/json', }, body: json.stringify(data), }) .then(response => response.json()) .then(data => { console.log('success:', data); }) .catch((error) => { console.error('error:', error); }); uploading a file files can be uploaded using an html <
input type="file" />
input element, formdata() and fetch().
... const formdata = new formdata(); const filefield = document.queryselector('
input[type="file"]'); formdata.append('username', 'abc123'); formdata.append('avatar', filefield.files[0]); fetch('https://example.com/profile/avatar', { method: 'put', body: formdata }) .then(response => response.json()) .then(result => { console.log('success:', result); }) .catch(error => { console.error('error:', error); }); uploading multiple files files can be uploaded using an html <
input type="file" multiple />
input element, formdata() and fetch().
... const formdata = new formdata(); const photos = document.queryselector('
input[type="file"][multiple]'); formdata.append('title', 'my vegas vacation'); for (let i = 0; i < photos.files.length; i++) { formdata.append('photos', photos.files[i]); } fetch('https://example.com/posts', { method: 'post', body: formdata, }) .then(response => response.json()) .then(result => { console.log('success:', result); }) .catch(error => { console.error('error:', error); }); processing a text file line by line the chunks that are read from a response are not broken neatly at line boundaries and are uint8arrays, not strings.
FileReader: abort event - Web APIs
bubbles no cancelable no interface progressevent event handler property filereader.onabort examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <
input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { wi...
...m; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const file
input = document.queryselector('
input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.r...
...ader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = file
input.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdataurl(selectedfile); } reader.abort(); } file
input.addeventlistener('change', handleselected); result specifications specification status file api working draft ...
FileReader: load event - Web APIs
bubbles no cancelable no interface progressevent event handler property filereader.onload examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <
input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; borde...
...r: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const file
input = document.queryselector('
input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function a...
...ader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = file
input.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdataurl(selectedfile); } } file
input.addeventlistener('change', handleselected); result specifications specification status file api working draft ...
FileReader: loadend event - Web APIs
bubbles no cancelable no interface progressevent event handler property filereader.onloadend examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <
input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; he...
...ight: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const file
input = document.queryselector('
input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; ...
...ader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = file
input.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdataurl(selectedfile); } } file
input.addeventlistener('change', handleselected); result specifications specification status file api working draft ...
FileReader: loadstart event - Web APIs
bubbles no cancelable no interface progressevent event handler property filereader.onloadstart examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <
input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem;...
... border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const file
input = document.queryselector('
input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } fu...
...ader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = file
input.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdataurl(selectedfile); } } file
input.addeventlistener('change', handleselected); result specifications specification status file api working draft ...
FileReader: progress event - Web APIs
bubbles no cancelable no interface progressevent event handler property filereader.onprogress examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <
input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5r...
...em; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const file
input = document.queryselector('
input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } ...
...ader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = file
input.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdataurl(selectedfile); } } file
input.addeventlistener('change', handleselected); result specifications specification status file api working draft ...
FileSystemDirectoryEntry.getDirectory() - Web APIs
receives as its sole
input parameter a fileerror object describing the error which occurred.
...firefox for androidopera for androidsafari on iossamsung internetgetdirectory experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, the errorcallback's
input parameter is a domexception rather than a fileerror object.ie no support noopera no support nosafari full support 11.1webview android full support ≤37chrome android full support ...
... 18firefox android full support 50notes full support 50notes notes in firefox, the errorcallback's
input parameter is a domexception rather than a fileerror object.opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no supportexperimental.
FileSystemDirectoryEntry.getFile() - Web APIs
receives as its sole
input parameter a fileerror object describing the error which occurred.
...droidfirefox for androidopera for androidsafari on iossamsung internetgetfile experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, the errorcallback's
input parameter is a domexception rather than a fileerror object.ie no support noopera no support nosafari full support 11.1webview android full support ≤37chrome android full support ...
... 18firefox android full support 50notes full support 50notes notes in firefox, the errorcallback's
input parameter is a domexception rather than a fileerror object.opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no supportexperimental.
FileSystemDirectoryEntry - Web APIs
oid full support yesgetdirectory experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, the errorcallback's
input parameter is a domexception rather than a fileerror object.ie no support noopera no support nosafari full support 11.1webview android full support ≤37chrome android full support ...
... 18firefox android full support 50notes full support 50notes notes in firefox, the errorcallback's
input parameter is a domexception rather than a fileerror object.opera android no support nosafari ios full support 11.3samsung internet android full support yesgetfile experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, the ...
...errorcallback's
input parameter is a domexception rather than a fileerror object.ie no support noopera no support nosafari full support 11.1webview android full support ≤37chrome android full support 18firefox android full support 50notes full support 50notes notes in firefox, the errorcallback's
input parameter is a domexception rather than a fileerror object.opera android no support nosafari ios full support ...
FileSystemDirectoryReader.readEntries() - Web APIs
the function receives a single
input parameter: an array of file system entry objects, each based on filesystementry.
...it receives one
input parameter: a fileerror object describing the error which occurred.
...this function takes as
input a filesystementry representing an entry in the file system to be scanned and processed (the item parameter), and an element into which to insert the list of contents (the container parameter).
File and Directory Entries API - Web APIs
only for accessing files which are selected by the user in a file <
input> element (see html
inputelement as well) or when a file or directory is provided to the web site or app using drag and drop.
... the html
inputelement.webkitentries property lets you access the filesystemfileentry objects for the currently selected files, but only if they are dragged-and-dropped onto the file chooser (bug 1326031).
... if html
inputelement.webkitdirectory is true, the <
input> element is instead a directory picker, and you get filesystemdirectoryentry objects for each selected directory.
GlobalEventHandlers.onchange - Web APIs
note: unlike on
input, the onchange event handler is not necessarily called for each alteration to an element's value.
... example this example logs the number of characters in an <
input> element, every time you modify its contents and then change focus away from it.
... html <
input type="text" placeholder="type something here, then click outside of the field." size="50"> <p id="log"></p> javascript let
input = document.queryselector('
input'); let log = document.getelementbyid('log');
input.onchange = handlechange; function handlechange(e) { log.textcontent = `the field's value is ${e.target.value.length} character(s) long.`; } result specification specification status comment html living standardthe definition of 'onchange' in that specification.
GlobalEventHandlers.onfocus - Web APIs
for onfocus to fire on non-
input elements, they must be given the tabindex attribute (see building keyboard accessibility back in for more details).
... example this example uses onblur and onfocus to change the text within an <
input> element.
... html <
input type="text" value="click here"> javascript let
input = document.queryselector('
input');
input.onblur =
inputblur;
input.onfocus =
inputfocus; function
inputblur() {
input.value = 'focus has been lost'; } function
inputfocus() {
input.value = 'focus is here'; } result try clicking in and out of the form field, and watch its contents change accordingly.
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.
... <form id="my-form"> <
input type="text" name="username"> <
input type="text" name="full-name"> <
input type="password" name="password"> </form> var
inputs = document.getelementbyid("my-form").elements; var
inputbyindex =
inputs[0]; var
inputbyname =
inputs["username"]; accessing form controls this example gets the form's element list, then iterates over the list, looking for <
input> elements of type "text" so that some form of processing can be performed on them.
... var
inputs = document.getelementbyid("my-form").elements; // iterate over the form controls for (i = 0; i <
inputs.length; i++) { if (
inputs[i].nodename === "
input" &&
inputs[i].type === "text") { // update text
input inputs[i].value.tolocaleuppercase(); } } disabling form controls var
inputs = document.getelementbyid("my-form").elements; // iterate over the form controls for (i = 0; i <
inputs.length; i++) { // disable all form controls
inputs[i].setattribute("disabled", ""); } specifications specification status comment html living standardthe definition of 'htmlformelement.elements' in that specification.
HkdfParams - Web APIs
unlike the
input key material passed into derivekey(), salt does not need to be kept secret.
...this is used to bind the derived key to an application or context, and enables you to derive different keys for different contexts while using the same
input key material.
... it's important that this should be independent of the
input key material itself.
IIRFilterNode.getFrequencyResponse() - Web APIs
the two output arrays, magresponseoutput and phaseresponseoutput, must be created before calling this method; they must be the same size as the array of
input frequency values (frequencyarray).
... phaseresponseoutput a float32array to receive the computed phase response values in radians for each frequency value in the
input frequencyarray.
...we first create the float32array objects we need, one containing the
input frequencies, and two to receive the output magnitude and phase values: var myfrequencyarray = new float32array(5); myfrequencyarray[0] = 1000; myfrequencyarray[1] = 2000; myfrequencyarray[2] = 3000; myfrequencyarray[3] = 4000; myfrequencyarray[4] = 5000; var magresponseoutput = new float32array(5); var phaseresponseoutput = new float32array(5); next we create a <ul> element in our html to cont...
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.
KeyboardEvent - Web APIs
when you need to handle text
input, use the
input event instead.
... keyboardevent.location read only returns a number representing the location of the key on the keyboard or other
input device.
...for example, manually firing a key event does not cause that letter to appear in a focused text
input.
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.
... properties midiaccess.
inputs read only returns an instance of midi
inputmap which provides access to any available midi
input 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.
MIDIMessageEvent - Web APIs
the midimessageevent interface of the web midi api represents the event passed to the onmidimessage event handler of the midi
input interface.
... a midimessage event is fired every time a midi message is sent from a device represented by a midi
input, for example when a midi keyboard key is pressed, a knob is tweaked, or a slider is moved.
... examples // printing all messages to console navigator.requestmidiaccess().then(midiaccess => { array.from(midiaccess.
inputs).foreach(
input => {
input[1].onmidimessage = console.log; }) }); specifications specification status comment web midi apithe definition of 'midimessageevent' in that specification.
Media Capture and Streams API (Media Stream) - Web APIs
mediastream objects have a single
input and a single output.
... a mediastream object generated by getusermedia() is called local, and has as its source
input one of the user's cameras or microphones.
... blobevent canvascapturemediastreamtrack
inputdeviceinfo mediadevicekind mediadeviceinfo mediadevices mediastream mediastreamconstraints mediastreamevent mediastreamtrack mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints overconstrainederror url early versions of the media capture and streams api specification included separate audiostreamtrack and videostreamtrack interfaces�...
PointerEvent - Web APIs
a pointer is a hardware agnostic representation of
input devices (such as a mouse, pen or contact point on a touch-enable surface).
... pointerevent.pressure read only the normalized pressure of the pointer
input in the range 0 to 1, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively.
... pointerevent.tangentialpressure read only the normalized tangential pressure of the pointer
input (also known as barrel pressure or cylinder stress) in the range -1 to 1, where 0 is the neutral position of the control.
RTCPeerConnection.addIceCandidate() - Web APIs
this function receives no
input parameters and doesn't return a value.
...receives as
input a domexception object describing why failure occurred.
...the promise does not receive any
input parameters.
ScriptProcessorNode: audioprocess event - Web APIs
the audioprocess event of the scriptprocessornode interface is fired when an
input buffer of a script processor is ready to be processed.
... 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); // loo...
...p through 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) { ...
SpeechSynthesis - Web APIs
inside the
inputform.onsubmit handler, we stop the form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <
input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
... var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('.txt'); var voiceselect = document.queryselector('select'); var pitch = document.queryselector('#pitch'); var pitchvalue = document.queryselector('.pitch-value'); var rate = document.queryselector('#rate'); var ratevalue = document.queryselector('.rate-value'); var voices = []; function populatevoicelist() { voices = synth.getvoices(); for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voi...
...ces[i].name); voiceselect.appendchild(option); } } populatevoicelist(); if (speechsynthesis.onvoiceschanged !== undefined) { speechsynthesis.onvoiceschanged = populatevoicelist; }
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.pitch = pitch.value; utterthis.rate = rate.value; synth.speak(utterthis);
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'speechsynthesis' in that specification.
StereoPannerNode.pan - Web APIs
example in our stereopannernode example (see source code) html we have a simple <audio> element along with a slider <
input> to increase and decrease pan value.
...we then use an on
input event handler to change the value of the stereopannernode.pan parameter and update the pan value display when the slider is moved.
... = document.queryselector('.panning-value'); pre.innerhtml = myscript.innerhtml; // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a stereo panner var pannode = audioctx.createstereopanner(); // event handler function to increase panning to the right and left // when the slider is moved pancontrol.on
input = function() { pannode.pan.setvalueattime(pancontrol.value, audioctx.currenttime); panvalue.innerhtml = pancontrol.value; } // connect the mediaelementaudiosourcenode to the pannode // and the pannode to the destination, so we can play the // music and adjust the panning using the controls source.connect(pannode); pannode.connect(audioctx.destination); specifications specification...
SubtleCrypto.digest() - Web APIs
a digest is a short fixed-length value derived from some variable-length
input.
... cryptographic digests should exhibit collision-resistance, meaning that it's hard to come up with two different
inputs that have the same digest value.
... 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.
SubtleCrypto.unwrapKey() - Web APIs
this means that it takes as its
input a key that has been exported and then encrypted (also called "wrapped").
...*/ function bytestoarraybuffer(bytes) { const bytesasarraybuffer = new arraybuffer(bytes.length); const bytesuint8 = new uint8array(bytesasarraybuffer); bytesuint8.set(bytes); return bytesasarraybuffer; } /* get some key material to use as
input to the derivekey method.
...*/ function bytestoarraybuffer(bytes) { const bytesasarraybuffer = new arraybuffer(bytes.length); const bytesuint8 = new uint8array(bytesasarraybuffer); bytesuint8.set(bytes); return bytesasarraybuffer; } /* get some key material to use as
input to the derivekey method.
UIEvent - Web APIs
several interfaces are direct or indirect descendants of this one: mouseevent, touchevent, focusevent, keyboardevent, wheelevent,
inputevent, and compositionevent.
... uievent.sourcecapabilities read only returns an instance of the
inputdevicecapabilities interface, which provides information about the physical device responsible for generating a touch event.
... specifications specification status comment
inputdevicecapabilities draft added sourcecapabilities property.
ValidityState - Web APIs
bad
input read only a boolean that is true if the user has provided
input that the browser is unable to convert.
... toolong read only a boolean that is true if the value exceeds the specified maxlength for html
inputelement or htmltextareaelement objects, or false if its length is less than or equal to the maximum length.
... tooshort read only a boolean that is true if the value fails to meet the specified minlength for html
inputelement or htmltextareaelement objects, or false if its length is greater than or equal to the minimum length.
Adding 2D content to a WebGL context - Web APIs
its job is to transform the
input vertex from its original coordinate system into the clip space coordinate system used by webgl, in which each axis has a range from -1.0 to 1.0, regardless of aspect ratio, actual size, or any other factors.
...der object gl.shadersource(shader, source); // compile the shader program gl.compileshader(shader); // see if it compiled successfully if (!gl.getshaderparameter(shader, gl.compile_status)) { alert('an error occurred compiling the shaders: ' + gl.getshaderinfolog(shader)); gl.deleteshader(shader); return null; } return shader; } the loadshader() function takes as
input the webgl context, the shader type, and the source code, then creates and compiles the shader as follows: a new shader is created by calling gl.createshader().
... to use this code we call it like this const shaderprogram = initshaderprogram(gl, vssource, fssource); after we've created a shader program we need to look up the locations that webgl assigned to our
inputs.
Fundamentals of WebXR - Web APIs
webxr additionally provides support for accepting
inputs from control devices such as handheld vr controllers or specialized mixed reality gamepads.
... another key difference is that webxr has integrated support for the advanced
input controllers that are used with most mixed reality headsets, while webvr relied on the gamepad api to support the controllers.
... a-frame (specifically designed for creating webxr-based apps) babylon.js three.js game toolkits the game toolkits are designed for game developers and often include gaming-specific features such as physics models,
input control systems, asset management, 3d sound playback, and the like.
Window.prompt() - Web APIs
the window.prompt() displays a dialog with an optional message prompting the user to
input some text.
... default optional a string containing the default value displayed in the text
input field.
...gn = window.prompt(); // open the blank prompt window sign = prompt(); // open the blank prompt window sign = window.prompt('are you feeling lucky'); // open the window with text "are you feeling lucky" sign = window.prompt('are you feeling lucky', 'sure'); // open the window with text "are you feeling lucky" and default value "sure" when the user clicks the ok button, text entered in the
input field is returned.
Window.speechSynthesis - Web APIs
inside the
inputform.onsubmit handler, we stop the form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <
input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
... var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); function populatevoicelist() { voices = synth.getvoices(); for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } } populatevoicelist(); if (speechsynthesis.onvoiceschanged !== undefined) { speechsynthesis.onvoiceschanged = populatevoicelist; }
inputform.onsubmit = function...
...(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis);
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'speechsynthesis' in that specification.
WindowOrWorkerGlobalScope.setInterval() - Web APIs
nam turpis nunc, suscipit a hendrerit vitae, volutpat non ipsum.</p> <form> <p>phasellus ac nisl lorem: <
input type="text" /><br /> <textarea style="width: 400px; height: 200px;">nullam commodo suscipit lacus non aliquet.
...cras sodales eleifend interdum.</textarea></p> <
input type="submit" value="send" /> </form> <p>duis lobortis sapien quis nisl luctus porttitor.
... example usage your html page: <!doctype html> <html> <head> <meta charset="utf-8" /> <title>minidaemin example - mdn</title> <script type="text/javascript" src="minidaemon.js"></script> <style type="text/css"> #sample_div { visibility: hidden; } </style> </head> <body> <p> <
input type="button" onclick="fadeinout.start(false /* optional */);" value="fade in" /> <
input type="button" onclick="fadeinout.start(true);" value="fade out"> <
input type="button" onclick="fadeinout.pause();" value="pause" /> </p> <div id="sample_div">some text here</div> <script type="text/javascript"> function opacity (nindex, nlength, bbackwards) { this.style.opacity = nin...
XRPose.emulatedPosition - Web APIs
if the position is precisely gbased on direct sensor
inputs, the value is false.
...any such data is taken from other sources, such as keyboard or mouse
inputs or game controllers.
...this is because emulating a position based on accelerometer
inputs and models tends to introduce minor errors which accumulate over time.
XRSession.onselect - Web APIs
to learn more about how webxr actions work, see
inputs and
input sources.
... example this example handles select event which occur on the user's main hand (as given by a user object's handedness property); if that value matches the value of the xr
inputsource property handedness, we know that the device is held in the user's main hand.
... xrsession.onselect = event => { let source = event.
inputsource; if (source.handedness == user.handedness) { if (source.targetraymode == "tracked-pointer") { let targetraypose = event.frame.getpose(source.targetrayspace, myrefspace); if (targetraypose) { myhandleselectwithray(targetraypose); } } } }; specifications specification status comment webxr device apithe definition of 'xrsession.onselect' in that specification.
XRSession.onsqueezestart - Web APIs
the xrsession interface's onsqueezestart event handler property can be set to a function which is then invoked to handle the squeezestart event that's sent when the user successfully begins a primary squeeze action on a webxr
input device.
... to learn more about how to use and handle webxr controller
inputs, see
inputs and
input sources.
... xrsession.onsqueezestart = event => { if (event.
inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.
inputsource.targetrayspace, myrefspace; if (targetraypose) { user.heldobject = findobjectusingray(targetraypose.transform); } } }; specifications specification status comment webxr device apithe definition of 'xrsession.onsqueezestart' in that specification.
XRSession.requestAnimationFrame() - Web APIs
the callback takes two parameters as
inputs: an xrframe describing the state of all tracked objects for the session, and a time stamp you can use to compute any animation updates needed.
... syntax requestid = xrsession.requestanimationframe(animationframecallback); parameters animationframecallback a function which is called before the next repaint in order to allow you to update and render the xr scene based on elapsed time, animation, user
input changes, and so forth.
... the callback receives as
input two parameters: time a domhighrestimestamp indicating the time offset at which the updated viewer state was received from the webxr device.
XRSession.visibilityState - Web APIs
input controllers are not being handled for the session.
...to that end, the session's requestanimationframe() callbacks are being processed at the xr device's native refresh rate and
input controllers are being processed as normal.
...
input controllers are not being processed for the session.
XRVisibilityState - Web APIs
input controllers are not being handled for the session.
...to that end, the session's requestanimationframe() callbacks are being processed at the xr device's native refresh rate and
input controllers are being processed as normal.
...
input controllers are not being processed for the session.
msCapsLockWarningOff - Web APIs
the mscapslockwarningoff read/write property turns automatic caps lock warning on or off for validated password
input fields.
... starting with internet explorer 10,
input type=password fields will automatically display a warning if the caps lock is on.
...document.mscapslockwarningoff == false) { document.mscapslockwarningoff = true; document.getelementbyid("caps").innerhtml = "warning off"; } else { document.mscapslockwarningoff = false; document.getelementbyid("caps").innerhtml = "warning on"; } } </script> </head> <body> <label>type a password: <
input type="password" /></label><br /> <button id="caps" onclick="capsoff();">warning off</button> </body> </html> ...
Using the aria-invalid attribute - Accessibility
the aria-invalid attribute is used to indicate that the value entered into an
input field does not conform to the format expected by the application.this may include formats such as email addresses or telephone numbers.
...note that since the default value for aria-required is false, it is not strictly necessary to add the attribute to
input.
... <
input name="name" id="name" aria-required="true" aria-invalid="false" onblur="checkvalidity('name', ' ', 'invalid name entered (requires both first and last name)');"/> <br /> <
input name="email" id="email" aria-required="true" aria-invalid="false" onblur="checkvalidity('email', '@', 'invalid e-mail address');"/> note that it is not necessary to validate the fields immediately on blur; the application could wait until the form is submitted (though this is not necessarily recommended).
Using the slider role - Accessibility
the application will programmatically update the value of aria-valuenow in response to user
input.
... <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" on
input="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.
... <label id="day-label">days</label> <div class="day-slider"> <div id="day-handle" class="day-slider-handle" role="slider" aria-labelledby="day-label" aria-valuemin="1" aria-valuemax="7" aria-valuenow="2" aria-valuetext="monday"> </div> </div> the code snippet below shows a function that responds to user
input and updates the aria-valuenow and aria-valuetext attributes: var daynames = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]; var updateslider = function (newvalue) { var handle = document.getelementbyid("day-handle"); handle.setattribute("aria-valuenow", newvalue.tostring()); handle.setattribute("aria-valuetext", daynames[newvalue]); }; working exampl...
ARIA annotations - Accessibility
you’ll see examples of most of these later on in the article, but briefly: aria-label="" can be set on an element to provide a brief descriptive label when it isn't appropriate to have the label actually appearing in the ui, for example a search
input in a horizontal nav bar.
...ve a poll/voting ui widget that shows numbers of votes, but you want to summarize the purpose of the widget in a clear description because the ui does not make it clear: <section aria-description="choose your favourite fruit — the fruit with the highest number of votes will be added to the lunch options next week."> <p>pick your favourite fruit:</p> <form> <ul> <li><label>apple: <
input type="radio" name="fruit" value="apple"></label></li> <li><label>orange: <
input type="radio" name="fruit" value="orange"></label></li> <li><label>banana: <
input type="radio" name="fruit" value="banana"></label></li> </ul> </form> </section> if the descriptive text does appear in the ui, you can link the description to the widget using aria-describedby, like so: <p id="fruit-de...
...sc">choose your favourite fruit — the fruit with the highest number of votes will be added to the lunch options next week.</p> <section aria-describedby="fruit-desc"> <form> <ul> <li><label>apple: <
input type="radio" name="fruit" value="apple"></label></li> <li><label>orange: <
input type="radio" name="fruit" value="orange"></label></li> <li><label>banana: <
input type="radio" name="fruit" value="banana"></label></li> </ul> </form> </section> insertions and deletions a common wish in online document systems like google docs is to be able to track changes, to see what reviewers or editors have suggested as changes to the text, before the managing editor or author accepts or rejects those changes.
ARIA: form role - Accessibility
even if you are using the form landmark instead of <form>, you are encouraged to use native html form controls like button,
input, select, and textarea associated wai-aria roles, states, and properties no role specific states or properties.
... examples <div role="form" id="send-comment" aria-label="add a comment"> <label for="username">username</label> <
input id="username" name="username" autocomplete="nickname" autocorrect="off" type="text"> <label for="email">email</label> <
input id="email" name="email" autocomplete="email" autocapitalize="off" autocorrect="off" spellcheck="false" type="text"> <label for="comment">comment</label> <textarea id="comment" name="comment"></textarea> <
input value="comment" type="submit"> </div> it is recom...
...
inputs are not forms you do not need to declare role="form" on every form element (
inputs, text areas, selects, etc.).
WAI-ARIA Roles - Accessibility
the position of each cell is significant and can be focused using keyboard
input.aria: gridcell rolethe gridcell role is used to make a cell in a grid or treegrid.
...isplays its associated tabpanel.aria: table rolethe table value of the aria role attribute identifies the element containing the role as having a non-interactive table structure containing data arranged in rows and columns, similar to the native <table> html element.aria: tabpanel rolethe aria tabpanel role indicatesaria: textbox rolethe textbox role is used to identify an element that allows the
input of free-form text.
... alertdialog banner combobox command columnheader (estelle) complementary composite definition directory feed gridcell (eric e) group
input landmark link - old page listbox log - old page marquee math menu menubar menuitem menuitemcheckbox menuitemradio none note option presentation progressbar - old page radio - old page radiogroup range region roletype rowheader(estelle) scrollbar searchbox section sectionhead select separator slider - old page spinbutton status - old page structure tab tablist (m...
Basic form hints - Accessibility
note that each <
input> element has an id, and each <label> element has a for attribute, indicating the id of the associated <
input>.
... <form> <ul> <li> <
input id="wine-1" type="checkbox" value="riesling"/> <label for="wine-1">berg rottland riesling</label> </li> <li> <
input id="wine-2" type="checkbox" value="pinot-blanc"/> <label for="wine-2">pinot blanc</label> </li> <li> <
input id="wine-3" type="checkbox" value="pinot-grigio"/> <label for="wine-3">pinot grigio</label> </li> <li> <
input id="wine-4" type="checkbox" value="gewurztraminer"/> <label for="wine-4">gewürztraminer</label> </li> </ul> </form> labeling with aria the html <label> element is appropriate for form-related elements, but many form controls are implemented as a dynamic javascript widget, using <div>s or <span>s.
... <form> <div> <label for="name">* name:</label> <
input type="text" value="name" id="name" aria-required="true"/> </div> <div> <label for="phone">phone:</label> <
input type="text" value="phone" id="phone" aria-required="false"/> </div> <div> <label for="email">* e-mail:</label> <
input type="text" value="email" id="email" aria-required="true"/> </div> </form> the script that validates the form entry would look something like ...
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
both aria-labelledby and aria-describedby are specified on the form element that is to be labelled, for example an <
input> in both cases, the label for/label control bindings that may also exist are overridden by aria-labelledby.
... example: shut down computer after minutes <
input aria-labelledby="labelshutdown shutdowntime shutdownunit" type="checkbox" /> <span id="labelshutdown">shut down computer after</span> <
input aria-labelledby="labelshutdown shutdowntime shutdownunit" id="shutdowntime" type="text" value="10" /> <span id="shutdownunit"> minutes</span> a note for jaws 8 users jaws 8.0 has its own logic to find labels, causing it to always override the accessiblename the textbox of an htm...
... community member ben millard has pointed out in a blog post that controls can be embedded in labels as shown in the above example using html 4, simply by embedding the
input into the label.
An overview of accessible web applications and widgets - Accessibility
html for a tooltip <div class="text"> <label id="tp1-label" for="first">first name:</label> <
input type="text" id="first" name="first" size="20" aria-labelledby="tp1-label" aria-describedby="tp1" aria-required="false" /> <div id="tp1" class="tooltip" role="tooltip" aria-hidden="true">your first name is optional</div> </div> the css for this markup is shown in example 2b.
...a developer might be tempted to implement the "view" mode using a read-only text <
input> element and setting its aria role to button, then switching to "edit" mode by making the element writable and removing the role attribute in "edit" mode (since <
input> elements have their own role semantics).
...instead, implement the "view" mode using a different element altogether, such as a <div> or <span> with a role of button, and the « edit » mode using a text <
input> element.
HTML To MSAA - Accessibility
em_ default if @type attribute has value "submit" n/a "press" n/a caption bstr role n/a n/a n/a description_for (0x100f), points to table element div bstr role n/a n/a n/a n/a n/a n/a fieldset role_system_ grouping text equivalent from child legend element n/a n/a labelled_by (1003), points to legend element n/a n/a hr role_system_ separator n/a n/a n/a n/a n/a n/a img,
input @type=image role_system_ graphic from @alt attribute, empty @alt attribute means name can't be calculated at all n/a state_system_ animated if image has more than one frame n/a "showlongdesc" if @longdesc attribute is presented n/a if @usemap attribute is used then image accessible has children for each map item
input @type=button, submit, reset role_system_ pushbutton from @value attribute, @a...
...lt attribute, default label, @src attribute, @data attribute n/a state_system_ default if @type attribute has value "submit" n/a "press" n/a
input @type=text, textarea role_system_ text n/a value property of
input dom element state_system_ readonly if @readonly attribute is used n/a "activate" n/a
input @type=password role_system_ text n/a n/a state_system_ readonly if @readonly attribute is used state_system_ protected n/a "activate" n/a
input type="checkbox" role_system_ checkbutton n/a n/a state_system_ marqueed used as state checkable state_system_ mixed for html 5 if intermediate property of dom element returns true state_system_ checked if checked property of dom element returns true n/a "check"/"uncheck"/"cycle" depending on state event_object_ statechange when state is ...
...changed
input type="radio" role_system_ radiobutton n/a n/a state_system_ marqueed used as state checkable state_system_ checked if checked property of dom element returns true n/a "select" event_object_ statechange when state is changed label role_system_ statictext from child nodes n/a n/a n/a n/a n/a legend role_system_ statictext n/a n/a n/a label_for (0x1002), points to caption element n/a n/a li and others role_system_ listitem n/a n/a state_system_ readonly n/a n/a n/a contains child accessible for list bullet ol, ul and others role_system_ list n/a n/a state_system_ readonly n/a n/a n/a optgroup bstr role n/a n/a n/a n/a n/a n/a option role_system_ listitem from @label attribute, from child text nodes n/a state_system_ selected if option is selected n/a "sele...
-webkit-text-security - CSS: Cascading Style Sheets
-webkit-text-security is a non-standard css property that obfuscates characters in a <form> field (such as <
input> or <textarea>) by replacing them with a shape.
... examples obscuring a text
input try typing in the field below.
... html <label for="name">name:</label> <
input type="text" name="name" id="name" /> css
input { -webkit-text-security: square; } result specifications not part of any standard.
::-moz-color-swatch - CSS: Cascading Style Sheets
the ::-moz-color-swatch css pseudo-element is a mozilla extension that represents the color selected in an <
input> of type="color".
... note: using ::-moz-color-swatch with anything but an <
input type="color"> doesn't match anything and has no effect.
... examples html <
input type="color" value="#de2020" /> css
input[type=color]::-moz-color-swatch { border-radius: 10px; border-style: none; } result specifications not part of any standard.
::-moz-range-progress - CSS: Cascading Style Sheets
the ::-moz-range-progress css pseudo-element is a mozilla extension that represents the lower portion of the track (i.e., groove) in which the indicator slides in an <
input> of type="range".
... note: using ::-moz-range-progress with anything but an <
input type="range"> doesn't match anything and has no effect.
... syntax ::-moz-range-progress examples html <
input type="range" min="0" max="100" step="5" value="50"/> css
input[type=range]::-moz-range-progress { background-color: green; height: 1em; } result a progress bar using this style might look something like this: specifications not part of any standard.
::-moz-range-track - CSS: Cascading Style Sheets
the ::-moz-range-track css pseudo-element is a mozilla extension that represents the track (i.e., groove) in which the indicator slides in an <
input> of type="range".
... note: using ::-moz-range-track with anything but an <
input type="range"> doesn't match anything and has no effect.
... syntax ::-moz-range-track examples html <
input type="range" min="0" max="100" step="5" value="50"/> css
input[type=range]::-moz-range-track { background-color: green; } result a progress bar using this style might look something like this: specifications not part of any standard.
::-webkit-inner-spin-button - CSS: Cascading Style Sheets
the ::-webkit-inner-spin-button css pseudo-element is used to style the inner part of the spinner button of number picker
input elements.
... changing the cursor in the spin controls in this example, the css cursor is changed to pointer whenever the cursor is positioned over the inner part of the
input's spin controls.
... html <
input type="number"> css
input[type=number]::-webkit-inner-spin-button { cursor: pointer; } result specifications not part of any standard.
::-webkit-outer-spin-button - CSS: Cascading Style Sheets
the ::-webkit-outer-spin-button css pseudo-element is used to style the outer part of the spinner button of number picker <
input> elements.
... hiding the spinner this example uses
input::-webkit-outer-spin-button to find <
input> elements' spinner widgets and set their -webkit-appearance to none, thus hiding them.
... html <
input type="number"> css
input::-webkit-outer-spin-button { -webkit-appearance: none; } result specifications not part of any standard.
:blank - CSS: Cascading Style Sheets
the :blank css pseudo-class selects empty user
input elements (eg.
... <
input> or <textarea>).
... syntax :blank examples simple :blank example in eventual supporting browsers, the :blank pseudo-class will enable developers to highlight in some way
input controls that are not required, but still have no content filled in, perhaps as a reminder to users.
:disabled - CSS: Cascading Style Sheets
/* selects any disabled <
input> */
input:disabled { background: #ccc; } syntax :disabled examples this example shows a basic shipping form.
... html <form action="#"> <fieldset id="shipping"> <legend>shipping address</legend> <
input type="text" placeholder="name"> <
input type="text" placeholder="address"> <
input type="text" placeholder="zip code"> </fieldset> <br> <fieldset id="billing"> <legend>billing address</legend> <label for="billing-checkbox">same as shipping address:</label> <
input type="checkbox" id="billing-checkbox" checked> <br> <
input type="text" placeholder="name" disabled> <
input type="text" placeholder="address" disabled> <
input type="text" placeholder="zip code" disabled> </fieldset> </form> css
input[type="text"]:disabled { background: #ccc; } javascript // wait for th...
...e page to finish loading document.addeventlistener('domcontentloaded', function () { // attach `change` event listener to checkbox document.getelementbyid('billing-checkbox').onchange = togglebilling; }, false); function togglebilling() { // select the billing text fields var billingitems = document.queryselectorall('#billing
input[type="text"]'); // toggle the billing text fields for (var i = 0; i < billingitems.length; i++) { billingitems[i].disabled = !billingitems[i].disabled; } } result specifications specification status comment html living standardthe definition of ':disabled' in that specification.
:focus-visible - CSS: Cascading Style Sheets
(many browsers show a “focus ring” by default in this case.) this selector is useful to provide a different focus indicator based on the user’s
input modality (mouse vs.
... <
input value="default styles"><br> <button>default styles</button><br> <
input class="focus-only" value=":focus only"><br> <button class="focus-only">:focus only</button><br> <
input class="focus-visible-only" value=":focus-visible only"><br> <button class="focus-visible-only">:focus-visible only</button>
input, button { margin: 10px; } .focus-only:focus { outline: 2px solid black; } .focus-visible...
...tips for designing useful and usable focus indicators cognition it may not be obvious as to why the focus indicator is appearing and disappearing if a person is using mixed forms of
input.
:focus-within - CSS: Cascading Style Sheets
(this includes descendants in shadow trees.) /* selects a <div> when one of its descendants is focused */ div:focus-within { background: cyan; } this selector is useful, to take a common example, for highlighting an entire <form> container when the user focuses on one of its <
input> fields.
... syntax :focus-within examples in this example, the form will receive special coloring styles when either text
input receives focus.
... html <p>try typing into this form.</p> <form> <label for="given_name">given name:</label> <
input id="given_name" type="text"> <br> <label for="family_name">family name:</label> <
input id="family_name" type="text"> </form> css form { border: 1px solid; color: gray; padding: 4px; } form:focus-within { background: #ff8; color: black; }
input { margin: 4px; } result specifications specification status comment selectors level 4the definition of ':focus-within' in that specification.
:focus - CSS: Cascading Style Sheets
the :focus css pseudo-class represents an element (such as a form
input) that has received focus.
... /* selects any <
input> when focused */
input:focus { color: red; } note: this pseudo-class applies only to the focused element itself.
... syntax :focus examples html <
input class="red-
input" value="i'll be red when focused."><br> <
input class="blue-
input" value="i'll be blue when focused."> css .red-
input:focus { background: yellow; color: red; } .blue-
input:focus { background: yellow; color: blue; } result accessibility concerns make sure the visual focus indicator can be seen by people with low vision.
:in-range - CSS: Cascading Style Sheets
the :in-range css pseudo-class represents an <
input> element whose current value is within the range limits specified by the min and max attributes.
... /* selects any <
input>, but only when it has a range specified, and its value is inside that range */
input:in-range { background-color: rgba(0, 255, 0, 0.25); } this pseudo-class is useful for giving the user a visual indication that a field's current value is within the permitted limits.
... <li> <
input id="value1" name="value1" type="number" placeholder="1 to 10" min="1" max="10" value="12"> <label for="value1">your value is </label> </li> </ul> </form> css li { list-style: none; margin-bottom: 1em; }
input { border: 1px solid black; }
input:in-range { background-color: rgba(0, 255, 0, 0.25); }
input:out-of-range { background-color: rgba(255, 0, 0, 0.25); border: 2px solid red; }
input:in-range + label::after { content: 'okay.'; }
input:out-of-ran...
:out-of-range - CSS: Cascading Style Sheets
the :out-of-range css pseudo-class represents an <
input> element whose current value is outside the range limits specified by the min and max attributes.
... /* selects any <
input>, but only when it has a range specified, and its value is outside that range */
input:out-of-range { background-color: rgba(255, 0, 0, 0.25); } this pseudo-class is useful for giving the user a visual indication that a field's current value is outside the permitted limits.
...in the absence of such a limitation, the element can neither be "in-range" nor "out-of-range." syntax :out-of-range examples html <form action="" id="form1"> <p>values between 1 and 10 are valid.</p> <ul> <li> <
input id="value1" name="value1" type="number" placeholder="1 to 10" min="1" max="10" value="12"> <label for="value1">your value is </label> </li> </ul> </form> css li { list-style: none; margin-bottom: 1em; }
input { border: 1px solid black; }
input:in-range { background-color: rgba(0, 255, 0, 0.25); }
input:out-of-range { background-color: rgba(255, 0, 0, 0.25); border: 2px solid red; }
input:in-range + label::after { content: 'okay.'; } inp...
any-pointer - CSS: Cascading Style Sheets
coarse at least one
input mechanism includes a pointing device of limited accuracy.
... fine at least one
input mechanism includes an accurate pointing device.
... html <
input id="test" type="checkbox" /> <label for="test">look at me!</label> css
input[type="checkbox"]:checked { background: gray; } @media (any-pointer: fine) {
input[type="checkbox"] { -moz-appearance: none; -webkit-appearance: none; appearance: none; width: 15px; height: 15px; border: 1px solid blue; } } @media (any-pointer: coarse) {
input[type="checkbox"] { -mo...
hover - CSS: Cascading Style Sheets
the hover css media feature can be used to test whether the user's primary
input mechanism can hover over elements.
... none the primary
input mechanism cannot hover at all or cannot conveniently hover (e.g., many mobile devices emulate hovering when the user performs an inconvenient long tap), or there is no primary pointing
input mechanism.
... hover the primary
input mechanism can conveniently hover over elements.
calc() - CSS: Cascading Style Sheets
let's look at some css:
input { padding: 2px; display: block; width: calc(100% - 1em); } #formbox { width: calc(100% / 6); border: 1px solid black; padding: 4px; } here, the form itself is established to use 1/6 of the available window width.
... then, to ensure that
input fields retain an appropriate size, we use calc() again to establish that they should be the width of their container minus 1em.
... then, the following html makes use of this css: <form> <div id="formbox"> <label>type something:</label> <
input type="text"> </div> </form> nested calc() with css variables you can also use calc() with css variables.
caret-color - CSS: Cascading Style Sheets
this is sometimes referred to as the text
input cursor.
... the caret appears in elements such as <
input> or those with the contenteditable attribute.
...)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples setting a custom caret color html <
input value="this field uses a default caret." size="64"/> <
input class="custom" value="i have a custom caret color!" size="64"/> <p contenteditable class="custom">this paragraph can be edited, and its caret has a custom color as well!</p> css
input { caret-color: auto; display: block; margin-bottom: .5em; }
input.custom { caret-color: red; } p.custom { caret-color: green; } result ...
Date and time formats used in HTML - HTML: Hypertext Markup Language
elements that use such formats include certain forms of the <
input> element that let the user choose or specify a date, time, or both, as well as the <ins> and <del> elements, whose datetime attribute specifies the date or date and time at which the insertion or deletion of content occurred.
... for <
input>, the values of type that return a value which contains a string representing a date and/or time are: date datetime datetime-local month time week examples before getting into the intricacies of how date and time strings are written and parsed in html, here are some examples that should give you a good idea what the more commonly-used date and time string formats look like.
... when you set the value of a datetime-local
input, the string is normalized into a standard form.
<isindex> - HTML: Hypertext Markup Language
<isindex> provided a single line text
input for entering a query string.
... <
input name="isindex"> </label> <hr> </form> history on june 1992, dan connolly would prefer a different anchor type instead of isindex.
...he proposed to have instead an
input element (idea supported by steve putz).
<output>: The Output element - HTML: Hypertext Markup Language
for a space-separated list of other elements’ ids, indicating that those elements contributed
input values to (or otherwise affected) the calculation.
... examples in the following example, the form provides a slider whose value can range between 0 and 100, and an <
input> element into which you can enter a second number.
... <form on
input="result.value=parseint(a.value)+parseint(b.value)"> <
input type="range" id="b" name="b" value="50" /> + <
input type="number" id="a" name="a" value="10" /> = <output name="result" for="a b">60</output> </form> accessibility concerns many browsers implement this element as an aria-live region.
autocapitalize - HTML: Hypertext Markup Language
the autocapitalize global attribute is an enumerated attribute that controls whether and how text
input is automatically capitalized as it is entered/edited by the user.
...instead, it affects the behavior of other
input mechanisms, such as virtual keyboards on mobile devices and voice
input.
... the autocapitalize attribute never causes autocapitalization to be enabled for an <
input> element with a type attribute whose value is url, email, or password.
dir - HTML: Hypertext Markup Language
the auto value should be used for data with an unknown directionality, like data coming from user
input, eventually stored in a database.
... browsers might allow users to change the directionality of <
input> and <textarea>s in order to assist with authoring content.
... chrome and safari provide a directionality option in the contextual menu of
input fields while internet explorer and edge use the key combinations ctrl + left shift and ctrl + right shift.
tabindex - HTML: Hypertext Markup Language
accessibility concerns avoid using the tabindex attribute in conjunction with non-interactive content to make something intended to be interactive focusable by keyboard
input.
...the content should be semantically described using interactive elements (<a>, <button>, <details>, <
input>, <select>, <textarea>, etc.) instead.
... recommendation only supported on <a>, <area>, <button>, <
input>, <object>, <select>, and <textarea>.
HTTP Index - HTTP
18 list of default accept values accept, content negotiation, http, reference this article documents the default values for the http accept header for specific
inputs and browser versions.
... 127 feature-policy: camera directive, feature policy, feature-policy, http, reference, camera the http feature-policy header camera directive controls whether the current document is allowed to use video
input devices.
... 137 feature-policy: microphone feature policy, feature-policy, http, header, microphone the http feature-policy header microphone directive controls whether the current document is allowed to use audio
input devices.
Grammar and types - JavaScript
the source text of javascript script gets scanned from left to right, and is converted into a sequence of
input elements which are tokens, control characters, line terminators, comments, or whitespace.
...in the following code, the variable
input is not assigned a value, and the if statement evaluates to true.
... var
input; if (
input === undefined) { dothis(); } else { dothat(); } the undefined value behaves as false when used in a boolean context.
Regular expression syntax cheatsheet - JavaScript
assertions if you are looking to contribute to this document, please also edit the original article boundary-type assertions characters meaning ^ matches the beginning of
input.
... $ matches the end of
input.
... the ^ character may also indicate the beginning of
input.
String.prototype.match() - JavaScript
input a copy of the search string.
... const str = 'for more information, see chapter 3.4.5.1'; const re = /see (chapter \d+(\.\d)*)/i; const found = str.match(re); console.log(found); // logs [ 'see chapter 3.4.5.1', // 'chapter 3.4.5.1', // '.1', // index: 22, //
input: 'for more information, see chapter 3.4.5.1' ] // 'see chapter 3.4.5.1' is the whole match.
...// the '
input' property is the original string that was parsed.
parseInt() - JavaScript
if radix is undefined, 0, or unspecified, javascript assumes the following: if the
input string begins with "0x" or "0x" (a zero, followed by lowercase or uppercase x), radix is assumed to be 16 and the rest of the string is parsed as a hexidecimal number.
... if the
input string begins with "0" (a zero), radix is assumed to be 8 (octal) or 10 (decimal).
... if the
input string begins with any other value, the radix is 10 (decimal).
Digital audio concepts - Web media technologies
sound enters the computer through a microphone or other
input in the form of a stream of electrons whose voltage varies to represent the amplitude of the sound wave.
...depending on the codec, but can include: specifying specific algorithms to use during particular phases of the encoding process parameters for those algorithms to use, such as how much predictive depth to use when trying to model the audio the number of passes to make while analyzing the audio, or the number of times given algorithms should be run lossy encoder parameters most codecs have
input values you can tune to optimize the compression in various ways, either for size or for quality.
... variable bit rate variable bit rate (vbr) encoding works by accepting as an
input into the encoder a constant quality setting.
Codecs used by WebRTC - Web media technologies
avc implementations for webrtc are required to support the special "filler payload" and "full frame freeze" sei messages; these are used to support switching among multiple
input streams seamlessly.
...the most efficient way is to use the static method rtcrtpsender.getcapabilities() (or the equivalent rtcrtpreceiver.getcapabilities() for a receiver), specifying the type of media as the
input parameter.
...ender.getcapabilities(kind).codecs; let recvcodecs = rtcrtpreceiver.getcapabilities(kind).codecs; if (kind === "video") { sendcodecs = prefercodec(mimetype); recvcodecs = prefercodec(mimetype); transceiver.setcodecpreferences([...sendcodecs, ...recvcodecs]); } }); peerconnection.onnegotiationneeded(); } in this sample, the function changevideocodec() takes as
input the mime type of the codec you wish to use.
Example - SVG: Scalable Vector Graphics
view the example <?xml version='1.0'?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> <head> <title>a swarm of motes</title> <style type='text/css'> <![cdata[ label,
input { width: 150px; display: block; float: left; margin-bottom: 10px; } label { text-align: right; width: 75px; padding-right: 20px; } br { clear: left; } ]]> </style> </head> <body onload='update()'> <svg:svg id='display' width='400' height='300'> <svg:circle id='cursor' cx='200' cy='150' r='7' fill='#0000ff' fill-opacity='0.5'/> </svg:svg> <p>a ...
... </div> <form action="" onsubmit="return false;"> <p> <label>number of motes:</label> <
input id='num_motes' value='5'/> <br/> <label>max.
... velocity:</label> <
input id='max_velocity' value='15'/> <br/> <label>attraction to cursor:</label> <
input id='attract_cursor' value='6'/> <br/> <label>repulsion from peers:</label> <
input id='repel_peer' value='5'/> <br/> </p> </form> <script type='text/javascript'> <![cdata[ // array of motes var motes; // get the display element.
Types of attacks - Web security
for endpoints that require a post request, it's possible to programmatically trigger a <form> submit (perhaps in an invisible <iframe>) when the page is loaded: <form action="https://bank.example.com/withdraw" method="post"> <
input type="hidden" name="account" value="bob"> <
input type="hidden" name="amount" value="1000000"> <
input type="hidden" name="for" value="mallory"> </form> <script>window.addeventlistener('domcontentloaded', (e) => { document.queryselector('form').submit(); }</script> there are a few techniques that should be used to prevent this from happening: get endpoints should be idempotent—actions t...
... a csrf token should be included in <form> elements via a hidden
input field.
...for all non-get requests that have the potential to perform an action, this
input field should be compared against the expected value.
io/byte-streams - Archive of obsolete content
eio.open(filename, "rb"); if (!bytereader.closed) { data = bytereader.read(); bytereader.close(); } } return data; } function writebinarydatatofile(data, filename) { var fileio = require("sdk/io/file"); var bytewriter = fileio.open(filename, "wb"); if (!bytewriter.closed) { bytewriter.write(data); bytewriter.close(); } } globals constructors bytereader(
inputstream) creates a binary
input stream that reads bytes from a backing stream.
... parameters
inputstream : stream the backing stream, an nsi
inputstream.
XPCOM Objects - Archive of obsolete content
this specifies that these are
input parameters, values that the method will use to perform its actions.
...the first parameter is an
input that tells the method where to start looking.
Index of archived content - Archive of obsolete content
building mozilla xforms community developing mozilla xforms 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 el...
...sing microformats in javascript popup window controls rdf in fifty words or less rdf in mozilla faq styling abbreviations and acronyms the business benefits of web standards using the right markup to invoke plugins windows media in netscape xquery xul booster xul parser in python
input archive ...
Using Dehydra - Archive of obsolete content
example: printing the location of type declarations save the following c++ code dumptypes.cc: typedef int myint; struct foo { int i; char *c; }; save the following analysis script dumptypes.js: function process_type(t) { print("type found: " + t.name + " location: " + t.loc); } function
input_end() { print("hello, world!"); } compile using the following command: $ g++ -fplugin=~/dehydra/gcc_dehydra.so -fplugin-arg=~/dumptypes.js -o/dev/null -c dumptypes.cc note:for g++4.5 and up use -fplugin-arg-gcc_dehydra-script= rather than -fplugin-arg it should print the following results: type found: foo location: test.cc:2:12 type found: myint location: test.cc:1:13 hello, world!
... see documentation for: process_type,
input_end, print, .loc property example: using attributes to mark a class as "final" save the following code as final.cc: // this class should not be subclassed!
JavaScript crypto - Archive of obsolete content
tes identity of user ca/ra sends wrapped encryption private key to kra kra sends escrow verification back to ca ca creates and signs certificates ca sends certificates back to the user (importusercertificates) typical use the ca's enrollment page could look something like this: <!doctype html> <h2>request a cert</h2> <form name="reqform" method="post" action="http://your.ra.site.org"> <p><
input type=hidden name=cert_request value=""> <p>name: <
input type=text name=name value=""> <p>password: <
input type=password name="password" value=""> <p><
input type=submit name="send" value="submit"> </form> <script> /* the following values could be filled in by the server cgi */ var authenticator = "server_magic"; var keytransportcert = null; var crmfobject = null; var form = document.forms[0]; fun...
... null, "rsa-dual-use"); } return false; } function setcrmfrequest() { form.cert_request.value = crmfobject.request; form.submit(); } form.onsubmit = validate; </script> on completion of the request, the ca may submit a page that looks something like this: <!doctype html> <h2>certificate request successful</h2> <p>hit 'load' to load your certificate</p> <form name="reqform"> <p><
input type=submit name="load" value="submit"></p> </form> <script> /* the following values could be filled in by the server cgi */ var nickname= "mycertnickname"; var cert = "mkjflakdjfiwjflaksufklasf ..."; var forcebackup = false; function loadcertificate() { window.crypto.importusercertificates(nickname, cert, forcebackup); return false; } document.forms[0].onsubmit = loadcertificate; </script>...
jspage - Archive of obsolete content
ent;},getwindow:function(){return this;}});native.implement([element,document],{getelement:function(a,b){return document.id(this.getelements(a,true)[0]||null,b); },getelements:function(a,d){a=a.split(",");var c=[];var b=(a.length>1);a.each(function(e){var f=this.getelementsbytagname(e.trim());(b)?c.extend(f):c=f; },this);return new elements(c,{ddup:b,cash:!d});}});(function(){var h={},f={};var i={
input:"checked",option:"selected",textarea:(browser.engine.webkit&&browser.engine.version<420)?"innerhtml":"value"}; var c=function(l){return(f[l]||(f[l]={}));};var g=function(n,l){if(!n){return;}var m=n.uid;if(browser.engine.trident){if(n.clearattributes){var q=l&&n.clonenode(false); n.clearattributes();if(q){n.mergeattributes(q);}}else{if(n.removeevents){n.removeevents();}}if((/object/i).test(n.tagna...
...ull; }}return document.id(m,n);},getselected:function(){return new elements($a(this.options).filter(function(l){return l.selected;}));},getcomputedstyle:function(m){if(this.currentstyle){return this.currentstyle[m.camelcase()]; }var l=this.getdocument().defaultview.getcomputedstyle(this,null);return(l)?l.getpropertyvalue([m.hyphenate()]):null;},toquerystring:function(){var l=[]; this.getelements("
input, select, textarea",true).each(function(m){if(!m.name||m.disabled||m.type=="submit"||m.type=="reset"||m.type=="file"){return;}var n=(m.tagname.tolowercase()=="select")?element.getselected(m).map(function(o){return o.value; }):((m.type=="radio"||m.type=="checkbox")&&!m.checked)?null:m.value;$splat(n).each(function(o){if(typeof o!="undefined"){l.push(m.name+"="+encodeuricomponent(o)); }});});return ...
NSC_SetPIN - Archive of obsolete content
syntax ck_rv nsc_setpin( ck_session_handle hsession, ck_char_ptr poldpin, ck_ulong uloldlen, ck_char_ptr pnewpin, ck_ulong ulnewlen ); parameters nsc_setpin takes five parameters: hsession [
input] poldpin [
input] .
... uloldlen [
input] .; pnewpin [
input] .; ulnewlen [
input] .
File object - Archive of obsolete content
properties static properties file.
input a file object that represents the standard
input (stdin).
...file.
input, file.output, file.error or a pipeline) methods file.open() opens the file, specifying file mode and type.
Anonymous Content - Archive of obsolete content
a sample xbl binding for the file widget might look as follows: <binding id="fileupload"> <content> <html:
input type="text"/> <html:
input type="button"/> </content> </binding> because this content is not visible to its parent element, it is said to be anonymous content.
... <xbl:binding id="fileuploadcontrol"> <xbl:content> <html:
input type="text" xbl:inherits="value"/> <html:
input type="button" value="browse..."/> </xbl:content> </xbl:binding> each entry in the inherits list can either simply list an attribute (such as value in the example above), or it can specify an = separated pair consisting of the attribute on the anonymous content that should be tied to the attribute on the bound element.
Learn XPI Installer Scripting by Example - Archive of obsolete content
able / 1024); // do the verification if(spaceavailable < spacerequired) { logcomment("insufficient disk space: " + dirpath); logcomment(" required : " + spacerequired + " k"); logcomment(" available: " + spaceavailable + " k"); return(false); } return(true); } in the verifydiskspace block, filegetdiskspaceavailable is called with dirpath as its expected
input.
... this
input is defined in line 22, where getfolder() is used to assign a value to the communicatorfolder variable representing the "program" folder on the local system: var communicatorfolder = getfolder("program"); spaceavailable = filegetdiskspaceavailable(dirpath); spacerequired, the other expected
input to the verifydiskspace function, is given as 17311 kilobytes on line 19.
spellcheck - Archive of obsolete content
--> <
input type="text" spellcheck="true" /><br /> <textarea spellcheck="true"></textarea> <div contenteditable="true" spellcheck="true">i am some content</div> <!-- spellcheck nothing!
... --> <
input type="text" spellcheck="false" /><br /> <textarea spellcheck="false"></textarea> <div contenteditable="true" spellcheck="false">i am some content</div> you can use spellcheck on
input, textarea, and contenteditable elements.
textbox.onblur - Archive of obsolete content
prior to gecko 1.9 (firefox 3), the script code would execute in the context of the anonymous html <
input> element inside the textbox binding.
... from gecko 1.9 to gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9), the script code would actually execute twice, once in the context of the anonymous html <
input> element and once in the context of the <textbox> element itself.
textbox.onfocus - Archive of obsolete content
prior to gecko 1.9 (firefox 3), the script code would execute in the context of the anonymous html <
input> element inside the textbox binding.
... from gecko 1.9 to gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9), the script code would actually execute twice, once in the context of the anonymous html <
input> element and once in the context of the <textbox> element itself.
Attribute (XUL) - Archive of obsolete content
stdayofweek firstpage first-tab fixed flags flex focused forcecomplete grippyhidden grippytooltiptext group handlectrltab height helpuri hidden hidechrome hidecolumnpicker hideheader hideseconds hidespinbuttons highlightnonmatches homepage href icon id ignoreblurwhilesearching ignorecase ignoreincolumnpicker ignorekeys image inactivetitlebarcolor increment index
inputtooltiptext insertafter insertbefore instantapply inverted iscontainer isempty key keycode keytext label lastpage lastselected last-tab left linkedpanel max maxheight maxlength maxpos maxrows maxwidth member menu menuactive min minheight minresultsforpopup minwidth mode modifiers mousethrough movetoclick multiline multiple name negate newlines next noautofocu...
...s noautohide noinitialfocus nomatch norestorefocus object observes onbeforeaccept onbookmarkgroup onchange onclick onclosetab oncommand oncommandupdate ondialogaccept ondialogcancel ondialogclosure ondialogextra1 ondialogextra2 ondialoghelp onerror onerrorcommand onextra1 onextra2 on
input onload onnewtab onpageadvanced onpagehide onpagerewound onpageshow onpaneload onpopuphidden onpopuphiding onpopupshowing onpopupshown onsearchcomplete onselect ontextcommand ontextentered ontextrevert ontextreverted onunload onwizardback onwizardcancel onwizardfinish onwizardnext open ordinal orient pack pageid pageincrement pagestep parent parsetype persist persistence phase pickertooltiptext placeholder popup position predicate preference pre...
XUL Events - Archive of obsolete content
attribute: ondragover
input this event is sent when a user enters text in a textbox.
... attribute: on
input overflow this event is only sent to a box or other layout element with a css overflow property set to a value other than 'visible'.
Uploading and Downloading Files - Archive of obsolete content
this is done by using an html <
input> element using the file type from within a form.
... function uploadput(posturl, filepath) { var req = new xmlhttprequest(); req.open("put", posturl); req.setrequestheader("content-type", "text/plain"); req.onload = function(event) { alert(event.target.responsetext); } req.send(new file(filepath)); } in this example, a new
input stream is created for a file, and is passed to the xmlhttprequest's send method.
maxWidth - Archive of obsolete content
note: prior to gecko 6.0, you could use this on <
input> elements; this was never intended, was a violation of the html specification, and has been fixed.
... use the size to set the maximum width of
input fields.
Sorting and filtering a custom tree view - Archive of obsolete content
xml-stylesheet href="chrome://global/skin/" type="text/css"?> <!doctype window> <window title="sorting a custom tree view example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="init()"> <script type="application/javascript" src="sort.js"/> <hbox align="center" id="search-box"> <label accesskey="f" control="filter">filter</label> <textbox id="filter" on
input="
inputfilter(event)" flex="1"/> <button id="clearfilter" oncommand="clearfilter()" label="clear" accesskey="c" disabled="true"/> </hbox> <tree id="tree" flex="1" persist="sortdirection sortresource" sortdirection="ascending" sortresource="description"> <treecols> <treecol id="name" label="name" flex="1" persist="width ordinal hidden" onclick="sort(this)" class="sortdirectionindicator" s...
...for strings, lowercases them function prepareforcomparison(o) { if (typeof o == "string") { return o.tolowercase(); } return o; } function gettopvisiblerow() { return tree.treeboxobject.getfirstvisiblerow(); } function settopvisiblerow(topvisiblerow) { return tree.treeboxobject.scrolltorow(topvisiblerow); } function
inputfilter(event) { //do this now rather than doing it at every comparison var value = prepareforcomparison(event.target.value); setfilter(value); document.getelementbyid("clearfilter").disabled = value.length == 0; } function clearfilter() { document.getelementbyid("clearfilter").disabled = true; var filterelement = document.getelementbyid("filter"); filterelement.focus(); filterelement.valu...
Anonymous Content - Archive of obsolete content
filename
input field example another example, this time for a field for entering a filename: <binding id="fileentry"> <content> <textbox/> <button label="browse..."/> </content> </binding> attaching this binding to an element will cause it to contain a field for entering text, followed by a browse button.
...s="dropbox"> <menupopup> <menuitem label="1000"/> <menuitem label="2000"/> </menupopup> </menu> css: menu.dropbox { -moz-binding: url('chrome://example/skin/example.xml#dropbox'); } xbl: <binding id="dropbox"> <content> <children/> <xul:textbox flex="1"/> <xul:button src="chrome://global/skin/images/dropbox.jpg"/> </content> </binding> this example creates an
input field with a button beside it.
Creating a Wizard - Archive of obsolete content
if it returns false, then the wizard does not close, which might occur if the function savedoginfo() encountered invalid
input, for example.
...this allows you to validate the
input entered on each page before the user continues.
The Box Model - Archive of obsolete content
the horizontal box is needed as we want the labels vbox and the
inputs vbox to be placed horizontally with each other.
...as you see in the image below, the label and text
input are placed side by side.
menulist - Archive of obsolete content
attributes accesskey, crop, disableautoselect, disabled, editable, focused, image, label, oncommand, open, preference, readonly, sizetopopup, tabindex, value properties accessibletype, crop, description, disableautoselect, disabled, editable, editor, image,
inputfield, itemcount, label, menuboxobject, menupopup, open, selectedindex, selecteditem, tabindex, value methods appenditem, contains, getindexofitem, getitematindex, insertitemat, removeallitems, removeitemat, select examples <menulist> <menupopup> <menuitem label="option 1" value="1"/> <menuitem label="option 2" value="2"/> <menuitem label="option 3" value="3"/> <menuite...
...
inputfield type: textbox element a reference to the textbox element used for editable menu lists.
tree - Archive of obsolete content
attributes disablekeynavigation, disabled, editable, enablecolumndrag, flags, hidecolumnpicker, onselect, rows, seltype, statedatasource, tabindex, treelines properties accessibletype, builderview, columns, contentview, currentindex, disablekeynavigation, disabled, editingcolumn, editingrow, enablecolumndrag, firstordinalcolumn,
inputfield, seltype, selstyle, tabindex, treeboxobject, view examples a tree with several columns <tree flex="1" rows="2"> <treecols> <treecol id="sender" label="sender" flex="1"/> <treecol id="subject" label="subject" flex="2"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="joe@somewhere.com"/> <treecell label="top secret plans"/> ...
...
inputfield type: textbox element read-only property that holds the textbox that is used for editing.
Gecko Compatibility Handbook - Archive of obsolete content
in older browsers, this results in the td cell tightly wrapping around the
input element.
... <table border="1"> <tr> <form name="form2"> <td> <
input type="text"> </td> </form> </tr> <table> this approach is commonly used to get around the fact that <form> is a block level element in html and will naturally begin on a new line in the page.
title - Archive of obsolete content
it is used to specify thetitle of a <channel>, an <image>, an <item>, or a <text
input>.
...td>?</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> </tr> <tr> <td>rss image element</td> <td><image></td> <td>✔</td> <td>✔</td> <td>✔</td> <td>✔</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> </tr> <tr> <td>rss item element</td> <td><item></td> <td>✔</td> <td>✔</td> <td>✔</td> <td>✔</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> </tr> <tr> <td>rss text
input element</td> <td><text
input></td> <td>✔</td> <td>✔</td> <td>✔</td> <td>✔</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> </tr> </table> </center> see also none rss element</td> <th colspan="9" style="text-align:center">rss version ...
SAX - Archive of obsolete content
nsisaxerrorhandler receive notification of errors in the
input stream.
...are }, endprefixmapping: function(prefix) { // don't care }, // nsisupports queryinterface: function(iid) { if(!iid.equals(components.interfaces.nsisupports) && !iid.equals(components.interfaces.nsisaxcontenthandler)) throw components.results.ns_error_no_interface; return this; } }; start parsing the xml reader component can parse xml from a string, an nsi
inputstream, or asynchronously via the nsistreamlistener interface.
Using the W3C DOM - Archive of obsolete content
orted dom-related properties the following ie proprietary document object properties are not supported in the w3c document object model: document.layers[] id_attribute_value document.all document.all.id_attribute_value document.all[id_attribute_value] the following form related properties (originally from internet explorer) are not supported in the w3c document object model: formname.
inputname.value
inputname.value formctrlname document.forms(0) (note: document.forms[0] (using square brackets) uses the dom standard forms collection) scripts that use these properties will throw errors in most standards-compliant browsers.
... ie-specific ways to access elements w3c web standards replacements id_attribute_value document.getelementbyid() document.all.id_attribute_value document.getelementbyid() document.all[id_attribute_value] document.getelementbyid() formname.
inputname.value document.forms["formname"].
inputname.value or document.forms["formname"].elements["
inputname"].value
inputname.value document.forms["formname"].
inputname.value or document.forms["formname"].elements["
inputname"].value formctrlname document.forms["formname"].formctrlname or document.forms["formname"].elements["formctrlname"] document.forms(...
-ms-scroll-chaining - Archive of obsolete content
remarks this property only applies to touch and touchpad
input.
... for keyboard
input the scroll does not chain regardless of the –ms-scroll-chaining value, and for mouse
input the scroll will always chain up to the nearest scrollable ancestor element.
::-ms-browse - Archive of obsolete content
the ::-ms-browse css pseudo-element is a microsoft extension that represents the button that opens the file picker of <
input type="file">.
...-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height 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.
::-ms-fill-upper - Archive of obsolete content
a slider control is one possible representation of <
input type="range">.
... see also ::-ms-fill-lower ::-ms-track ::-ms-thumb ::-moz-range-progress css-tricks: styling cross-browser compatible range
inputs with css quirksmode: styling and scripting sliders ...
::-ms-thumb - Archive of obsolete content
a slider control is one possible representation of <
input type="range">.
... see also ::-ms-track ::-ms-fill-upper ::-ms-fill-lower ::-webkit-slider-thumb ::-moz-range-thumb css-tricks: styling cross-browser compatible range
inputs with css quirksmode: styling and scripting sliders ...
::-ms-track - Archive of obsolete content
a slider control is one possible representation of <
input type="range">.
...-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-track see also ::-ms-thumb ::-ms-fill-upper ::-ms-fill-lower ::-webkit-slider-runnable-track ::-moz-range-track css-tricks: styling cross-browser compatible range
inputs with css quirksmode: styling and scripting sliders ...
::-ms-value - Archive of obsolete content
the ::-ms-value css pseudo-element is a microsoft extension that applies rules to the value of a text or password <
input> control or the content of a <select> control.
...e-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-value example
input::-ms-value { color: lime; font-style: italic; } to disable the default styling: select::-ms-value { background-color: transparent; color: inherit; } specifications not part of any specification.
E4X for templating - Archive of obsolete content
security and escaping function e (str) { if (typeof str === 'xml') {str = str.tostring();} return str; } function quot (s) { // useful for placing user
input within inline javascript; may be combined with escape function above as well if (typeof s === 'string') { return s.replace(/"/g, '"').replace(/'/g, '''); } if (typeof s === 'xml') { return s.tostring().replace(/"/g, '"').replace(/'/g, '''); } return string(s).replace(/"/g, '"').replace(/'/g, '''); } localization e4x works nicely w...
...ts> <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 or adapted accordingly).
Array comprehensions - Archive of obsolete content
the
input to an array comprehension does not itself need to be an array; iterators and generators can also be used.
... even strings may be used as
input; to achieve the filter and map actions (under array-like objects) above: var str = 'abcdef'; var consonantsonlystr = [for (c of str) if (!(/[aeiouaeiou]/).test(c)) c].join(''); // 'bcdf' var interpolatedzeros = [for (c of str) c + '0' ].join(''); // 'a0b0c0d0e0f0' again, the
input form is not preserved, so we have to use join() to revert back to a string.
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
importpackage( java.net ); // connect to the remote resource var u = new url( "http://www.mozilla.org/news.rdf" ); var c = u.openconnection(); c.connect(); // read in the raw data var s = new java.io.
inputstreamreader( c.get
inputstream() ); var b = new java.io.bufferedreader( s ); var l, str = ""; while( ( l = b.readline() ) != null ) { // skip if( l != "" ) { str = str + l + "\n"; } } // define the namespaces, first the default, // then additional namespaces default xml namespace = "http://purl.org/rss/1.0/"; var dc = new namespace( "http://purl.org/dc/elements/1.1/" ); var rdf = new namespac...
... btn_comments = new ext.button({ text: "submit", fieldlabel: "", handler: formhandler }); // create the form panel, attach the
inputs form_comments = new ext.form.formpanel({ labelalign: "right", width: 400, title: "comments", items: [ txt_name, txt_email, txt_message, btn_comments ], renderto: "form-comments" }); }); </script> the code in listing 6 starts by hooking in the ext js library which is used to produce the ui elements of the form.
Implementation Status - Archive of obsolete content
ception 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 ...
...core form controls section title status notes bugs 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...
XForms Repeat Element - Archive of obsolete content
example <model> <instance> <my:lines> <my:line name="a"> <my:price>3.00</my:price> </my:line> <my:line name="b"> <my:price>32.25</my:price> </my:line> </my:lines> </instance> </model> <repeat id="lineset" nodeset="/my:lines/my:line"> <
input ref="my:price"> <label>line item</label> </
input> <
input ref="@name"> <label>name</label> </
input> </repeat> <trigger> <label>insert a new item after the current one</label> <action ev:event="domactivate"> <insert nodeset="/my:lines/my:line" at="index('lineset')" position="after"/> <setvalue ref="/my:lines/my:line[index('lineset')]/@name"/> <setvalue ref="/my:...
...lete ev:event="domactivate" at="index('anonidgridrepeat')" xbl:inherits="model, bind, nodeset"/> </xf:trigger> </xf:repeat> </xbl:content> </xbl:binding> </xbl:bindings> <style> div.grid { -moz-binding: url('#grid'); } </style> <xf:model> <xf:instance> <data xmlns=""> <repeat> <item> <
input>
input1</
input> </item> <item> <
input>
input2</
input> </item> <item> <
input>
input3</
input> </item> </repeat> </data> </xf:instance> </xf:model> </head> <body> <xf:repeat nodeset="/data/repeat/item" id="gridrepeat"> <xf:
input ref="
input"/> </xf:repeat> <br/> <div class="grid" nodeset="/data/re...
XForms Textarea Element - Archive of obsolete content
single-node binding special
inputmode - isn't supported.
...characteristics analogous widgets are <xhtml:textarea/> and <xul:textbox multiline="true"/> if the incremental attribute has the value true, then the bound instance node is updated on every user
input.
Introduction to game development for the Web - Game development
as we like to say, "the web is the platform." let's take a look at the core of the web platform: function technology audio web audio api graphics webgl (opengl es 2.0)
input touch events, gamepad api, device sensors, webrtc, full screen api, pointer lock api language javascript (or c/c++ using emscripten to compile to javascript) networking webrtc and/or websockets storage indexeddb or the "cloud" web html, css, svg (and much more!) the business case as a game developer, whether you're an individual or a larg...
... pointer lock api the pointer lock api lets you lock the mouse or other pointing device within your game's interface so that instead of absolute cursor positioning you receive coordinate deltas that give you more precise measurements of what the user is doing, and prevent the user from accidentally sending their
input somewhere else, thereby missing important action.
Implementing game control mechanisms - Game development
if(this.game.
input.mousepointer.isdown) { // do something } // ...
... } this will be executed whenever the mouse button is pressed, and it will be checked against the
input's isdown boolean variable on every frame of the game.
Animations and tweens - Game development
update the first line inside update() as shown below: function update() { game.physics.arcade.collide(ball, paddle, ballhitpaddle); game.physics.arcade.collide(ball, bricks, ballhitbrick); paddle.x = game.
input.x || game.world.width*0.5; } then we can create the ballhitpaddle() function (having ball and paddle as default parameters), playing the wobble animation when it is called.
... compare your code you can check the finished code for this lesson in the live demo below, and play with it to understand better how it works: next steps animations and tweens look very nice, but we can add even more to our game — in the next section we'll look at handling button
inputs.
Extra lives - Game development
add the ballleavescreen() function definition at the end of our code: function ballleavescreen() { lives--; if(lives) { livestext.settext('lives: '+lives); lifelosttext.visible = true; ball.reset(game.world.width*0.5, game.world.height-25); paddle.reset(game.world.width*0.5, game.world.height-5); game.
input.ondown.addonce(function(){ lifelosttext.visible = false; ball.body.velocity.set(150, -150); }, this); } else { alert('you lost, game over!'); location.reload(); } } instead of instantly printing out the alert when you lose a life, we first subtract one life from the current number and check if it's a non-zero value.
... if yes, then the player still has some lives left and can continue to play — they will see the life lost message, the ball and paddle positions will be reset on screen and on the next
input (click or touch) the message will be hidden and the ball will start to move again.
First CPU idle - MDN Web Docs Glossary: Definitions of Web-related terms
first cpu idle measures when a page is minimally interactive, or when the window is quiet enough to handle user
input.
...generally, it occurs when most, but not necessarily all visible ui elements are interactive, and the user interface responds, on average, to most user
input within 50ms.
First interactive - MDN Web Docs Glossary: Definitions of Web-related terms
first interactive, also known as first cpu idle, is a non-standard web performance metric that measures when the user's window is quiet enough to handle user
input, or what is termed as minimally interactive.
... minimally interactive is defined as when some, but not necessarily all, ui elements on the page have loaded and are interactive, and, on average, respond to user
input in a reasonable amount of time.
RAIL - MDN Web Docs Glossary: Definitions of Web-related terms
the performance mantra of rail is "focus on the user; the end goal isn't to make your site perform fast on any specific device, it's to make users happy." there are 4 stages of interaction: page load, idle, response to
input, and scrolling and animation.
... in acronym order, the main tenets are: response respond to users immediately, acknowledging any user
input in 100ms or less.
SQL Injection - MDN Web Docs Glossary: Definitions of Web-related terms
sql injection takes advantage of web apps that fail to validate user
input.
... how to prevent before executing the queries for the user credentials, make some changes like the following: $id = $_get['id'] (1) $id = stripslashes($id) (2) $id = mysql_real_escape_string($id) so due to (1) each single quote (') in the
input string is replaced with double quotes ("), and due to (2) before every (') it adds (/).
MDN Web Docs Glossary: Definitions of Web-related terms
on encryption endianness engine entity entity header event exception expando f fallback alignment falsy favicon fetch directive fetch metadata request header firefox os firewall first contentful paint first cpu idle first
input delay first interactive first meaningful paint first paint first-class function flex flex container flex item flexbox forbidden header name forbidden response header name fork fragmentainer frame rate (fps) ftp ftu function fuzz testing ...
... http header http/2 http/3 https hyperlink hypertext i i18n iana icann ice ide idempotent identifier idl ietf iife imap immutable index indexeddb information architecture inheritance
input method editor instance internationalization internet intrinsic size ip address ipv4 ipv6 irc iso isp itu j jank java javascript jpeg jquery json k key keyword l latency ...
Assessment: Accessibility troubleshooting - Learn web development
the forms the <
input> element in the search form at the top could do with a label, but we don't want to add a visible text label that would potentially spoil the design and isn't really needed by sighted users.
... the two <
input> elements in the comment form have visible text labels, but they are not unambiguously associated with their labels — how do you achieve this?
Example - Learn web development
a simple form html content <form action="/my-handling-form-page" method="post"> <div> <label for="name">name:</label> <
input type="text" id="name" name="user_name"> </div> <div> <label for="mail">e-mail:</label> <
input type="email" id="mail" name="user_email"> </div> <div> <label for="msg">message:</label> <textarea id="msg" name="user_message"></textarea> </div> <div class="button"> <button type="submit">send your message</button> </div> </form> css content form { /* just to center the form on the page */ margin: 0 auto; width: 400px; /* to see the limits of the form */ padding: 1em; border: 1px solid #ccc; border-radius: 1em; } div + div { margin-top: 1...
...em; } label { /* to make sure that all label have the same size and are properly align */ display: inline-block; width: 90px; text-align: right; }
input, textarea { /* to make sure that all text field have the same font settings by default, textarea are set with a monospace font */ font: 1em sans-serif; /* to give the same size to all text field */ width: 300px; -moz-box-sizing: border-box; box-sizing: border-box; /* to harmonize the look & feel of text field border */ border: 1px solid #999; }
input:focus, textarea:focus { /* to give a little highligh on active elements */ border-color: #000; } textarea { /* to properly align multiline text field with their label */ vertical-align: top; /* to give enough room to type some text */ height: 5e...
Introducing asynchronous JavaScript - Learn web development
both contain a callback function that will run if the previous operation is successful, and each callback receives as
input the result of the previous successful operation, so you can go forward and do something else to it.
... however, promises are specifically made for handling async operations, and have many advantages over old-style callbacks: you can chain multiple async operations together using multiple .then() operations, passing the result of one into the next one as an
input.
Third-party APIs - Learn web development
the search term, which has to be specified in the q url parameter (the value is taken from the value of the searchterm text <
input>).
... next, we use a couple of if() statements to check whether the startdate and enddate <
input>s have had values filled in on them.
Silly story generator - Learn web development
this contains text strings that will act as
input into our program.
...in this block we are saying "if a value has been entered into the customname text
input, replace bob in the story with that custom name." inside the second if block, we are checking to see if the uk radio button has been selected.
JavaScript object basics - Learn web development
let's say we wanted users to be able to store custom value types in their people data, by typing the member name and value into two text
inputs.
... we could get those values like this: let mydataname = name
input.value; let mydatavalue = namevalue.value; we could then add this new member name and value to the person object like this: person[mydataname] = mydatavalue; to test this, try adding the following lines into your code, just below the closing curly brace of the person object: let mydataname = 'height'; let mydatavalue = '1.75m'; person[mydataname] = mydatavalue; now try saving and refreshing, and entering the following into your text
input: person.height adding a property to an object using the method above isn't possible with dot notation, which can only accept a literal member name, not a variable value pointing to a name.
Perceived performance - Learn web development
if
input elements are visible, the user should be able to interact with them without a lag.
... make things like type-ahead a progressive enhancement: use css to display
input modal, js to add typeahead/autocomplete as it is available make task initiators appear more interactive making a content request on keydown rather than waiting for keyup can shave 200ms off the perceived load of the content.
TypeScript support in Svelte - Learn web development
set its type to htmlelement like this: let nameel: htmlelement // reference to the name
input dom node last for this file, we need to specify the correct type for our autofocus variable; update its definition like this: export let autofocus: boolean = false todo.svelte now the only warnings that npm run validate emits are triggered by calling the todo.svelte component; let's fix them.
...it should end up looking like this: // actions.ts export function selectonfocus(node: html
inputelement) { if (node && typeof node.select === 'function' ) { // make sure node is defined and has a select() method const onfocus = () => node.select() // event handler node.addeventlistener('focus', onfocus) // when node gets focus call onfocus() return { destroy: () => node.removeeventlistener('focus', onfocus) /...
Using Vue computed properties - Learn web development
update the <
input> element in todoitem.vue to look like this.
... <
input type="checkbox" class="checkbox" :id="id" :checked="isdone" @change="$emit('checkbox-changed')" /> since all we need to do is emit that the checkbox was checked, we can include the $emit() inline.
Gecko info for Windows accessibility vendors
xul: <textbox> html: <
input type="text"> or <textarea> dhtml: role="wairole:textfield" or role="wairole:textarea" sets state_linked if within link.
... sets state_haspopup for autocomplete textfields role_pushbutton xul: <button> html: <
input type= "button"> or<button> dhtml: role="wairole:button" sets state_haspopup for buttons containing menus role_checkbutton xul: <checkbox> html: <
input type="checkbox"> dhtml: role="wairole:checkbox" fires event_state_change when checkbox is toggled role_radiobutton xul: <radio> html: <
input type="radio"> dhtml: role="wairole:radio" fires event_state_change when radiobutton is set role_combobox ...
Creating MozSearch plugins
the following xml is the bundled firefox 2 search plugin for searching using yahoo!: <searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <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" t...
... <searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <shortname>mdc</shortname> <description>mozilla developer center search</description> <
inputencoding>utf-8</
inputencoding> <image width="16" height="16">data:image/x-icon;base64,ivborw0kggoaaaansuheugaaabaaaaaqcayaaaaf8%2f9haaaabgdbtueaak%2finwwk6qaaabl0rvh0u29mdhdhcmuaqwrvymugsw1hz2vszwfkexhjztwaaahwsurbvhjayvz%2f%2fz8djqaggjiqoe%2ffv2fv7oz8rays%2fn%2bvkfg%2fiynjfyd%2f1%2brvq7ffu3dpfpsbaaheahibcj85c8bn2nj4vwsdw%2f8zqlwkio8ccroqu0dxqlwrdshuwzbaaigjmtnnpgya9j8uqhfelwpxf2mideirksn9fwsjorka...
Capturing a minidump
for example, if the application is hanging (not responding to
input, but hasn't crashed) then breakpad is not triggered, and it can be difficult to determine where the problem lies.
... you should now see a "command" text window with debug output at the top and an
input box at the bottom.
Reviewer Checklist
be careful when reading user
input, network
input, or files on disk.
... assume that
inputs will be too big, too short, empty, malformed, or malicious.
overflow-clip-box-block
/* keyword values */ overflow-clip-box-block: padding-box; overflow-clip-box-block: content-box; /* global values */ overflow-clip-box-block: inherited; overflow-clip-box-block: initial; overflow-clip-box-block: unset; note: on gecko, by default, padding-box is used everywhere, but <
input type="text"> and similar use the value content-box.
... examples padding-box html <div class="things"> <
input value="abcdefghijklmnopqrstuvwxyzÅÄÖ" class="scroll padding-box"> <div class="scroll padding-box"><span>abcdefghijklmnopqrstuvwxyzÅÄÖ</span></div> </div> css .scroll { overflow: auto; padding: 0 30px; width: 6em; border: 1px solid black; background: lime content-box; } .padding-box { overflow-clip-box-block: padding-box; } javascript function scrollsomeelements() { var elms = docu...
overflow-clip-box-inline
/* keyword values */ overflow-clip-box-inline: padding-box; overflow-clip-box-inline: content-box; /* global values */ overflow-clip-box-inline: inherited; overflow-clip-box-inline: initial; overflow-clip-box-inline: unset; note: on gecko, by default, padding-box is used everywhere, but <
input type="text"> and similar use the value content-box.
... examples padding-box html <div class="things"> <
input value="abcdefghijklmnopqrstuvwxyzÅÄÖ" class="scroll padding-box"> <div class="scroll padding-box"><span>abcdefghijklmnopqrstuvwxyzÅÄÖ</span></div> </div> css .scroll { overflow: auto; padding: 0 30px; width: 6em; border: 1px solid black; background: lime content-box; } .padding-box { overflow-clip-box-inline: padding-box; } javascript function scrollsomeelements() { var elms = doc...
overflow-clip-box
/* keyword values */ overflow-clip-box: padding-box; overflow-clip-box: content-box; /* two values */ overflow-clip-box: padding-box content-box; overflow-clip-box: content-box content-box; /* global values */ overflow-clip-box: inherit; overflow-clip-box: initial; overflow-clip-box: unset; note: on gecko, by default, padding-box is used everywhere, but <
input type="text"> and similar use the value content-box.
... formal syntax padding-box | content-box examples padding-box html <div class="things"> <
input value="abcdefghijklmnopqrstuvwxyzÅÄÖ" class="scroll padding-box"> <div class="scroll padding-box"><span>abcdefghijklmnopqrstuvwxyzÅÄÖ</span></div> </div> css .scroll { overflow: auto; padding: 0 30px; width: 6em; border: 1px solid black; background: lime content-box; } .padding-box { overflow-clip-box: padding-box; } js function scrollsomeelements() { var elms = docume...
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.
... before debugging can start, several commands must be entered into the one-line
input box at the bottom of the command window.
PRExplodedTime
on
input to nspr functions, only the essential members of prexplodedtime must be specified.
... the two nonessential members (day of week and day of year) are ignored by nspr functions as
input.
PR EnumerateAddrInfo
result on
input, a pointer to a prnetaddr structure.
...the principle
input, the praddrinfo structure, is not modified.
PR_EnumerateHostEnt
address on
input, a pointer to a prnetaddr structure.
...the principle
input, the prhostent structure, is not modified.
PR_GMTParameters
note: since this function requires gmt as
input, its primary use is as "filler" for cases in which you need a do-nothing callback.
... this is a trivial function; for any
input, it returns a prtimeparameters structure with both fields set to zero.
JSS FAQ
va org/mozilla/jss/pkix/cert/certificate.java org/mozilla/jss/pkix/cmmf/certrepcontent.java org/mozilla/jss/pkix/crmf/certreqmsg.java org/mozilla/jss/pkix/crmf/certtemplate.java org/mozilla/jss/pkix/primitive/name.java org/mozilla/jss/provider/javax/crypto/jsssecretkeyfactoryspi.java org/mozilla/jss/util/utf8converter.java org/mozilla/jss/util/base64
inputstream.java jss/samples/pqggen.java jss/samples/pkcs12.java if i don't call setcipherpolicy, is the domestic policy used by default?
... import java.io.bytearray
inputstream; [...] certificate cert = (certificate) asn1util.decode( certificate.gettemplate(),x509cert.getencoded() ); how do i convert org.mozilla.jss.pkix.cert to org.mozilla.jss.crypto.x509certificate?
NSS 3.12.4 release notes
id multiple encoding/decoding of pkix_pl_oid to and from ascii string bug 405297: problems building nss/lib/ckfw/capi/ with mingw gcc bug 420991: libpkix returns wrong nss error code bug 427135: add super-h (sh3,4) architecture support bug 431958: improve des and sha512 for x86_64 platform bug 433791: win16 support should be deleted from nss bug 449332: secu_parsecommandline does not validate its
inputs bug 453735: when using cert9 (sqlite3) db, set or change master password fails bug 463544: warning: passing enum* for an int* argument in pkix_validate.c bug 469588: coverity errors reported for softoken bug 470055: pkix_httpcertstore_findsocketconnection reuses closed socket bug 470070: multiple object leaks reported by tinderbox bug 470479: io timeout during cert fetching makes libpkix abort v...
...generation bug 491044: remove support for vms (a.k.a., openvms) from nss bug 491174: cert_pkixverifycert reports wrong error code when ee cert is expired bug 491919: cert.h doesn't have valid functions prototypes bug 492131: a failure to import a cert from a p12 file leaves error code set to zero bug 492385: crash freeing named crl entry on shutdown bug 493135: bltest crashes if it can't open the
input file bug 493364: can't build with --disable-dbm option when not cross-compiling bug 493693: sse2 instructions for bignum are not implemented on os/2 bug 493912: sqlite3_reset should be invoked in sdb_findobjectsinit when error occurs bug 494073: update rsa/dsa powerupself tests to be compliant for 2011 bug 494087: passing null as the value of cert_pi_trustanchors causes a crash in cert_pkixsetpar...
NSS Sample Code Sample1
// utility function to print hex data static void printbuffer(unsigned char *digest, unsigned int len) { int i; cout << "length: " << len << endl; for(i = 0;i < len;i++) printf("%02x ", digest[i]); cout << endl; } // xxx data protection // - takes an
input buffer, applies the encryption // and mac, and generates a buffer with the result.
...this becomes the
input to // the exportkeys method on the remote server.
NSS Sample Code Sample_1_Hashing
n > 76 || (i % 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)) ...
... 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.
Hashing - sample 1
> 76 || (i % 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)) ...
... 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.
sample1
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)) 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 tools : crlutil
-a use ascii format or allow the use of ascii format for
input and output.
...if options -m|-g is used and -c crl-script-file is not specified, crlutil will read script data from standard
input.
sslerr.html
sec_error_
input_len -8188 security library:
input length error.
...objects are still in use." sec_error_extra_
input -8052 "der-encoded message contained extra unused data." sec_error_unsupported_elliptic_curve -8051 "unsupported elliptic curve." sec_error_unsupported_ec_point_form -8050 "unsupported elliptic curve point form." sec_error_unrecognized_oid -8049 "unrecognized object identifier." sec_error_ocsp_invalid_signing_cert -8048 "invalid oc...
NSS Tools crlutil
-a use ascii format or allow the use of ascii format for
input and output.
...if options -m|-g is used and -c crl-script-file is not specified, crlutil will read script data from standard
input.
NSS tools : crlutil
-a use ascii format or allow the use of ascii format for
input and output.
...if options -m|-g is used and -c crl-script-file is not specified, crlutil will read script data from standard
input.
Multithreading in Necko
it simply promises to read from a nsi
inputstream (or write to a nsioutputstream) on a background thread.
...the jar protocol handler, for rexample, passes a special nsi
inputstream impl that does gzip decoding on the fly.
Introduction to the JavaScript shell
readline() reads a single line of
input from stdin, returning it to the caller.
... 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: 1...
JS_GetGlobalForObject
description js_getglobalforobject returns the last non-null object on the parent chain of the
input object.
... for function object
inputs, the result is "the global object" as referred to in the ecmascript specification.
Starting WebLock
for example, addsite is supposed to add the current url to the white list, but is the url an
input parameter to the method, is it the topmost web page in the gecko application, or is it something more random-a url picked from global history or that's been given context in some other way?
...append adds the
input string to the path already specified in the nsifile.
nsIAccessibleText
it represents the current
input position and will therefore typically be queried by at more often than other positions.
...it represents the current
input position and will therefore typically be queried by at more often than other positions.
nsIAuthPrompt
methods prompt() this method puts up a text
input dialog with ok and cancel buttons.
...one of the save_password_* constants defaulttext the default text for the text
input dialog box.
nsICryptoHMAC
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview acstring finish(in prbool aascii); void init(in unsigned long aalgorithm, in nsikeyobject akeyobject); void reset(); void update([const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsi
inputstream astream, in unsigned long alen); constants hashing algorithms.
...void updatefromstream( in nsi
inputstream astream, in unsigned long alen ); parameters astream an
input stream to read from.
nsIFileOutputStream
inherits from: nsioutputstream 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 nsifile
inputstream.
... see also nsifile
inputstream ...
nsILoginInfo
passwordfield astring the name attribute for the password
input in a form.
... usernamefield astring the name attribute for the username
input in a form.
nsILoginManager
to create an instance, use: var loginmanager = components.classes["@mozilla.org/login-manager;1"] .getservice(components.interfaces.nsiloginmanager); method overview void addlogin(in nsilogininfo alogin); nsiautocompleteresult autocompletesearch(in astring asearchstring, in nsiautocompleteresult apreviousresult, in nsidomhtml
inputelement aelement); unsigned long countlogins(in astring ahostname, in astring aactionurl, in astring ahttprealm); boolean fillform(in nsidomhtmlformelement aform); void findlogins(out unsigned long count, in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins); void getalldisabledhosts([option...
... nsiautocompleteresult autocompletesearch( in astring asearchstring, in nsiautocompleteresult apreviousresult, in nsidomhtml
inputelement aelement ); parameters asearchstring missing description apreviousresult missing description aelement missing description return value missing description countlogins() returns the number of logins matching the specified criteria.
nsILoginManagerStorage
count, [retval, array, 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 a
inputfile, in nsifile aoutputfile); 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 attr...
...void initwithfile( in nsifile a
inputfile, in nsifile aoutputfile ); parameters a
inputfile the file from which to read stored logins.
nsIMsgMessageService
mple, the next piece of code shows the selected message code on a dialog: (taken from mozillazine) var content = ""; var messageuri = getfirstselectedmessage(); var msgservice = messenger.messageservicefromuri(messageuri); var msgstream = components.classes["@mozilla.org/network/sync-stream-listener;1"].createinstance(); var consumer = msgstream.queryinterface(components.interfaces.nsi
inputstream); var script
input = components.classes["@mozilla.org/scriptable
inputstream;1"].createinstance(); var script
inputstream = script
input.queryinterface(components.interfaces.nsiscriptable
inputstream); script
inputstream.init(consumer); try { msgservice.streammessage(messageuri, msgstream, msgwindow, null, false, null); } catch (ex) { alert("error: "+ex) } script
inputstream ...
....available(); while (script
inputstream .available()) { content = content + script
inputstream .read(512); } alert(content streamheaders() this method streams a message's headers to the passed in consumer.
nsIPluginHost
void newpluginnativewindow( out nspluginnativewindowptr apluginnativewindow ); parameters apluginnativewindow native code only!parsepostbuffertofixheaders this method parses post buffer to find out case insensitive "content-length" string and cr or lf some where after that, then it assumes there is http headers in the
input buffer and continue to search for end of headers (crlfcrlf or lflf).
... 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.
nsIPromptService
var prompts = components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getservice(components.interfaces.nsipromptservice); var check = {value: false}; // default the checkbox to false var
input = {value: "bob"}; // default the edit field to bob var result = prompts.prompt(null, "title", "what is your name?",
input, null, check); // result is true if ok is pressed, false if cancel.
...
input.value holds the value of the edit field if "ok" was pressed.
nsIStreamConverter
stream converter contractid format (the stream converter root key is defined in this file): @mozilla.org/streamconv;1?from=from_mime_type&to=to_mime_type method overview void asyncconvertdata(in string afromtype, in string atotype, in nsistreamlistener alistener, in nsisupports actxt); nsi
inputstream convert(in nsi
inputstream afromstream, in string afromtype, in string atotype, in nsisupports actxt); methods asyncconvertdata() asynchronous version: converts data arriving via the converter's nsistreamlistener.ondataavailable() method from one type to another, pushing the converted data out to the caller via alistener::ondataavailable().
...nsi
inputstream convert( in nsi
inputstream afromstream, in string afromtype, in string atotype, in nsisupports actxt ); parameters afromstream the stream representing the original/raw data.
nsIWebBrowserPersist
ncelsave(); void savechannel(in nsichannel achannel, in nsisupports afile); void savedocument(in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn); void saveuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsi
inputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext); void saveprivacyawareuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsi
inputstream apostdata, in string aextraheaders, in nsisupports afile, in boolean aisprivate); attributes attribute type description current...
... void saveuri( in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsi
inputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext ); parameters auri uri to save to file.
nsIWebNavigation
method overview void goback void goforward void gotoindex( in long index ) void loaduri(in wstring uri , in unsigned long loadflags , in nsiuri referrer , in nsi
inputstream postdata, in nsi
inputstream headers) void reload(in unsigned long reloadflags) void stop(in unsigned long stopflags) constants load flags constant value description load_flags_mask 65535 this flag defines the range of bits that may be specified.
... void loaduri( wstring uri, unsigned long loadflags, nsiuri referrer, nsi
inputstream postdata, nsi
inputstream headers ); parameters uri the uri string to load.
nsIXULTemplateBuilder
a template builder, given an
input source of data, a template, and a reference point, generates a list of results from the
input, and copies part of the template for each result.
...this allows the query processor to be specific to a particular kind of
input data or query syntax, while the template builder remains independent of the kind of data being used.
Using nsIPasswordManager
adding a password to the password manager is easy: passwordmanager.adduser('host', 'username', 'password'); since there's no provision to include names of html
input fields, no password stored by this interface will be used to fill in passwords on web pages.
... nsiloginmanager, available in toolkit 1.9, does let you include
input field names.
Index - Firefox Developer Tools
81 paint flashing tool web performance the paint flashing tool, when activated, highlights the part of a page that the browser needs to repaint in response to some
input: for example, the user moving the mouse or scrolling.
... 151 the javascript
input interpreter debugging, web development, web console you can interpret javascript expressions in real time using the interpreter provided by the web console.
Paint Flashing Tool - Firefox Developer Tools
the paint flashing tool, when activated, highlights the part of a page that the browser needs to repaint in response to some
input: for example, the user moving the mouse or scrolling.
...this can then cause a site to be slow responding to user
input (also known as "janky").
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.
...the name of the variable appears as an
input to the interpreter, and its value appears as a response.
AudioBufferSourceNode.playbackRate - Web APIs
<
input class="playback-rate-control" type="range" min="0.25" max="3" step="0.05" value="1"> <span class="playback-rate-value">1.0</span> function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.d...
...quest.send(); } // wire up buttons to stop and play audio, and range slider control play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); playbackcontrol.removeattribute('disabled'); } stop.onclick = function() { source.stop(0); play.removeattribute('disabled'); playbackcontrol.setattribute('disabled', 'disabled'); } playbackcontrol.on
input = function() { source.playbackrate.value = playbackcontrol.value; playbackvalue.innerhtml = playbackcontrol.value; } specification specification status comment web audio apithe definition of 'playbackrate' in that specification.
AudioBufferSourceNode - Web APIs
t="_top"><rect x="561" 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.
... number of
inputs 0 number of outputs 1 channel count defined by the associated audiobuffer constructor audiobuffersourcenode() creates and returns a new audiobuffersourcenode object.
AudioContext.createJavaScriptNode() - Web APIs
syntax var jsnode = audioctx.createjavascriptnode(buffersize, num
inputchannels, numoutputchannels); 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
inputchannels the number of
input channels in the audio stream.
AudioContext.createMediaStreamSource() - Web APIs
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) { v...
... // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); // get new mouse pointer coordinates when mouse is moved // then set new gain value range.on
input = function() { biquadfilter.gain.value = range.value; } }) .catch(function(err) { console.log('the following gum error occured: ' + err); }); } else { console.log('getusermedia not supported on your browser!'); } // dump script to pre element pre.innerhtml = myscript.innerhtml; note: as a consequence of calling createmediastreamsource(), audio playba...
AudioNodeOptions - Web APIs
syntax var audionodeoptions = { "channelcount" : 2, "channelcountmode" : "max", "channelinterpretation" : "discrete" } properties channelcount optional represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any
inputs to the node.
... channelcountmode optional represents an enumerated value describing the way channels must be matched between the node's
inputs and outputs.
BaseAudioContext.createChannelMerger() - Web APIs
syntax baseaudiocontext.createchannelmerger(numberof
inputs); parameters numberof
inputs the number of channels in the
input audio streams, which the output stream will contain; the default is 6 if this parameter is not specified.
...nction(data) { var source = ac.createbuffersource(); source.buffer = data; var splitter = ac.createchannelsplitter(2); source.connect(splitter); var merger = ac.createchannelmerger(2); // reduce the volume of the left channel only var gainnode = ac.creategain(); gainnode.gain.setvalueattime(0.5, ac.currenttime); splitter.connect(gainnode, 0); // connect the splitter back to the second
input of the merger: we // effectively swap the channels, here, reversing the stereo image.
BaseAudioContext.createChannelSplitter() - Web APIs
syntax baseaudiocontext.createchannelsplitter(numberofoutputs); parameters numberofoutputs the number of channels in the
input audio stream that you want to output separately; the default is 6 if this parameter is not specified.
...nction(data) { var source = ac.createbuffersource(); source.buffer = data; var splitter = ac.createchannelsplitter(2); source.connect(splitter); var merger = ac.createchannelmerger(2); // reduce the volume of the left channel only var gainnode = ac.creategain(); gainnode.gain.setvalueattime(0.5, ac.currenttime); splitter.connect(gainnode, 0); // connect the splitter back to the second
input of the merger: we // effectively swap the channels, here, reversing the stereo image.
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.
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.
... // file
input is a html
inputelement: <
input type="file" multiple id="myfile
input"> var file
input = document.getelementbyid("myfile
input"); // files is a filelist object (simliar to nodelist) var files = file
input.files; for (var i = 0; i < files.length; i++) { console.log(files[i].name + " has a size of " + files[i].size + " bytes"); } specifications specification status comment file apithe definition of 'blob.size' in that specification.
CanvasRenderingContext2D.addHitRegion() - Web APIs
(if you don't see the full smiley, check the browser compatibility table to see if your current browser supports hit regions already; you might need to activate a preference.) playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <div class="playable-buttons"> <
input id="edit" type="button" value="edit" /> <
input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code" style="height:250px"> ctx.beginpath(); ctx.arc(100, 100, 75, 0, 2 * math.pi, false); ctx.linewidth = 5; ctx.stroke(); // eyes ctx.beginpath(); ctx.arc(70, 80, 10, 0, 2 * math.pi, false); ctx.arc(130, 80, 10, 0, 2 * math.pi, false); ctx.fill(); ctx.addhitregi...
...tion drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener("click", function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener("click", function() { textarea.focus(); }); canvas.addeventlistener("mousemove", function(event){ if(event.region) { alert("ouch, my eye :("); } }); textarea.addeventlistener("
input", drawcanvas); window.addeventlistener("load", drawcanvas); specifications canvas hit regions have been removed from the whatwg living standard, although discussions about future standardization are ongoing.
CanvasRenderingContext2D.arcTo() - Web APIs
you can play around with range
input to see how arc changes.
... 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.on
input = () => { controlout.textcontent = r = control.value; }; const mouse = { x: 0, y: 0 }; let r = 100; // radius const p0 = { x: 0, y: 50 }; const p1 = { x: 100, y: 100 }; const p2 = { x: 150, y: 50 }; const p3 = { x: 200, y: 100 }; const labelpoint = function (p, offset, i = 0){ const {x, y} = offset; ctx.beginpath()...
CanvasRenderingContext2D.miterLimit - Web APIs
playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <div class="playable-buttons"> <
input id="edit" type="button" value="edit" /> <
input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"> ctx.beginpath(); ctx.moveto(0,0); ctx.linewidth = 15; ctx.lineto(100, 100); ctx.stroke();</textarea> var canvas = document.getelementbyid("canvas"); var ctx = canvas.getcontext("2d"); var textarea = document.getelementbyid("code"); var reset = document.get...
...elementbyid("reset"); var edit = document.getelementbyid("edit"); var code = textarea.value; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener("click", function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener("click", function() { textarea.focus(); }) textarea.addeventlistener("
input", drawcanvas); window.addeventlistener("load", drawcanvas); screenshotlive sample specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.miterlimit' in that specification.
CanvasRenderingContext2D.scrollPathIntoView() - Web APIs
html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.fillrect(10, 10, 30, 30); ctx.scrollpathintoview(); edit the code below to see your changes update live in the canvas: playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"> <
input id="button" type="range" min="1" max="12"> </canvas> <div class="playable-buttons"> <
input id="edit" type="button" value="edit" /> <
input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"> ctx.beginpath(); ctx.rect(10, 10, 30, 30); ctx.scrollpathintoview();</textarea> var canvas = document.getelementbyid("canvas"); var ctx = canvas.getcontext("2d"); ...
...et = document.getelementbyid("reset"); var edit = document.getelementbyid("edit"); var code = textarea.value; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener("click", function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener("click", function() { textarea.focus(); }) textarea.addeventlistener("
input", drawcanvas); window.addeventlistener("load", drawcanvas); specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.scrollpathintoview' in that specification.
Drawing text - Web APIs
a textbaseline example edit the code below and see your changes update live in the canvas: ctx.font = '48px serif'; ctx.textbaseline = 'hanging'; ctx.stroketext('hello world', 0, 100); playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <div class="playable-buttons"> <
input id="edit" type="button" value="edit" /> <
input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"> ctx.font = "48px serif"; ctx.textbaseline = "hanging"; ctx.stroketext("hello world", 0, 100);</textarea> var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var textarea = document.getelementbyid('code'); var reset = document...
....getelementbyid('reset'); var edit = document.getelementbyid('edit'); var code = textarea.value; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener('click', function() { textarea.focus(); }) textarea.addeventlistener('
input', drawcanvas); window.addeventlistener('load', drawcanvas); advanced text measurements in the case you need to obtain more details about the text, the following method allows you to measure it.
Pixel manipulation with canvas - Web APIs
<canvas id="canvas" width="300" height="227"></canvas> <div> <
input id="grayscalebtn" value="grayscale" type="button"> <
input id="invertbtn" value="invert" type="button"> </div> var img = new image(); img.src = 'https://mdn.mozillademos.org/files/5397/rhino.jpg'; img.onload = function() { draw(this); }; function draw(img) { var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); ctx.drawimage(img, 0, 0); img.style.displa...
... zoom example <canvas id="canvas" width="300" height="227"></canvas> <canvas id="zoom" width="300" height="227"></canvas> <div> <label for="smoothbtn"> <
input type="checkbox" name="smoothbtn" checked="checked" id="smoothbtn"> enable image smoothing </label> </div> var img = new image(); img.src = 'https://mdn.mozillademos.org/files/5397/rhino.jpg'; img.onload = function() { draw(this); }; function draw(img) { var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); ctx.drawimage(img, 0, 0); img.style.display = ...
ChannelMergerNode() - Web APIs
options optional a channelmergeroptions dictionary object defining the properties you want the channelmergernode to have (also inherits parameters from the audionodeoptions dictionary): numberof
inputs: a number defining the number of
inputs the channelmergernode should have.
... example var ac = new audiocontext(); var options = { numberof
inputs : 2 } var mymerger = new channelmergernode(ac, options); specifications specification status comment web audio apithe definition of 'channelmergernode' in that specification.
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): numberofoutputs: a number defining the number of
inputs the channelsplitternode should have.
CompositionEvent.locale - Web APIs
the locale read-only property of the compositionevent interface returns the locale of current
input method (for example, the keyboard layout locale if the composition is associated with ime).
... syntax mylocale = compositionevent.locale value a domstring representing the locale of current
input method.
CompositionEvent - Web APIs
compositionevent.data read only returns the characters generated by the
input method that raised the event; its varies depending on the type of event that generated the compositionevent object.
... compositionevent.locale read only returns the locale of current
input method (for example, the keyboard layout locale if the composition is associated with ime).
ConstantSourceNode - Web APIs
a constantsourcenode has no
inputs and exactly one monaural (one-channel) output.
... number of
inputs 0 number of outputs 1 constructor constantsourcenode() creates and returns a new constantsourcenode instance, optionally specifying an object which establishes initial values for the object's properties.
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.
DOMMatrix - Web APIs
this is equivalent to the dot product a⋅b, where matrix a is the source matrix and b is the matrix given as an
input to the method.
...this is equivalent to the dot product b⋅a, where matrix a is the source matrix and b is the matrix given as an
input to the method.
Document.execCommand() - Web APIs
when an html document has been switched to designmode, its document object exposes an execcommand method to run commands that manipulate the current editable region, such as form
inputs or contenteditable elements.
... avalueargument for commands which require an
input argument, is a domstring providing that information.
Document: keyup event - Web APIs
note: if you're looking for a way to react to changes in an
input's value, you should use the
input event.
... some changes are not detectable by keyup, for example pasting text from the context menu in a text
input.
Document.querySelector() - Web APIs
here, the first <
input> element with the name "login" (<
input name="login"/>) located inside a <div> whose class is "user-panel main" (<div class="user-panel main">) in the document is returned: var el = document.queryselector("div.user-panel.main
input[name='login']"); negation as all css selector strings are valid, you can also negate selectors: var el = document.queryselector("div.user-panel:not(.main)
input[na...
...me='login']"); this will select an
input with a parent div with the user-panel class but not the main class.
DocumentOrShadowRoot.getSelection() - Web APIs
it is worth noting that currently getselection() doesn't work on the content of <
input> elements in firefox.
... html
inputelement.setselectionrange()) could be used to work around this.
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
example: creating an html table dynamically (sample1.html) html <
input type="button" value="generate a table." onclick="generate_table()"> javascript function generate_table() { // get the reference for the body var body = document.getelementsbytagname("body")[0]; // creates a <table> element and a <tbody> element var tbl = document.createelement("table"); var tblbody = document.createelement("tbody"); // creating all cells for (var i = 0; i < 2; ...
... html <body> <
input type="button" value="set paragraph background color" onclick="set_background()"> <p>hi</p> <p>hello</p> </body> javascript function set_background() { // get a list of all the body elements (there will only be one), // and then select the zeroth (or first) such element mybody = document.getelementsbytagname("body")[0]; // now, get all the p elements that are descendants of the body...
Element: blur event - Web APIs
bubbles no cancelable no interface focusevent event handler property onblur sync / async sync composed yes examples simple example html <form id="form"> <
input type="text" placeholder="text
input"> <
input type="password" placeholder="password"> </form> javascript const password = document.queryselector('
input[type="password"]'); password.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }); password.addeventlistener('blur', (event) => { event.target.style.background = ''; }); result event delegation there are ...
... html <form id="form"> <
input type="text" placeholder="text
input"> <
input type="password" placeholder="password"> </form> javascript const form = document.getelementbyid('form'); form.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }, true); form.addeventlistener('blur', (event) => { event.target.style.background = ''; }, true); result specifications specification status comment ui events working draft added info that this event is composed.
Element: focus event - Web APIs
bubbles no cancelable no interface focusevent event handler property onfocus sync / async sync composed yes examples simple example html <form id="form"> <
input type="text" placeholder="text
input"> <
input type="password" placeholder="password"> </form> javascript const password = document.queryselector('
input[type="password"]'); password.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }); password.addeventlistener('blur', (event) => { event.target.style.background = ''; }); result event delegation there are ...
... html <form id="form"> <
input type="text" placeholder="text
input"> <
input type="password" placeholder="password"> </form> javascript const form = document.getelementbyid('form'); form.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }, true); form.addeventlistener('blur', (event) => { event.target.style.background = ''; }, true); result specifications specification status comment ui events working draft added info that this event is composed.
Element: keyup event - Web APIs
sition, do something like this (229 is a special value set for a keycode relating to an event that has been processed by an ime): eventtarget.addeventlistener("keyup", event => { if (event.iscomposing || event.keycode === 229) { return; } // do something }); examples addeventlistener keyup example this example logs the keyboardevent.code value whenever you release a key inside the <
input> element.
... <
input placeholder="click here, then press and release a key." size="40"> <p id="log"></p> const
input = document.queryselector('
input'); const log = document.getelementbyid('log');
input.addeventlistener('keyup', logkey); function logkey(e) { log.textcontent += ` ${e.code}`; } onkeyup equivalent
input.onkeyup = logkey; specifications specification status ui events working draft ...
Element.name - Web APIs
it only applies to the following elements: <a>, <applet>, <button>, <form>, <frame>, <iframe>, <img>, <
input>, <map>, <meta>, <object>, <param>, <select>, and <textarea>.
... syntax htmlelement.name = string let elname = htmlelement.name let fcontrol = htmlformelement.elementname let controlcollection = htmlformelement.elements.elementname example <form action="" name="forma"> <
input type="text" value="foo"> </form> <script type="text/javascript"> // get a reference to the first element in the form let formelement = document.forms['forma'].elements[0] // give it a name formelement.name = '
inputa' // show the value of the
input alert(document.forms['forma'].elements['
inputa'].value) </script> notes in internet explorer (ie), the name property of dom objects...
Element: select event - Web APIs
for example, in html, select events can be dispatched only on form <
input type="text"> and <textarea> elements.
... examples selection logger <
input value="try selecting some text in this element."> <p id="log"></p> function logselection(event) { const log = document.getelementbyid('log'); const selection = event.target.value.substring(event.target.selectionstart, event.target.selectionend); log.textcontent = `you selected: ${selection}`; } const
input = document.queryselector('
input');
input.addeventlistener('select', logselection); onselect equivalent you can also set up the event handler using the onselect property:
input.onselect = logselection; specifications specification status ui eventsthe definition of 'select' in that specification.
Element.toggleAttribute() - Web APIs
example in the following example, toggleattribute() is used to toggle the readonly attribute of a <
input>.
... html <
input value="text"> <button>toggleattribute("readonly")</button> javascript var button = document.queryselector("button"); var
input = document.queryselector("
input"); button.addeventlistener("click", function(){
input.toggleattribute("readonly"); }); result dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattribut...
Event.preventDefault() - Web APIs
<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().
... html here's the form: <div class="container"> <p>please enter your name using lowercase letters only.</p> <form> <
input type="text" id="my-textbox"> </form> </div> css we use a little bit of css for the warning box we'll draw when the user presses an invalid key: .warning { border: 2px solid #f39389; border-radius: 2px; padding: 10px; position: absolute; background-color: #fbd8d4; color: #3b3c40; } javascript and here's the javascript code that does the job.
File.webkitRelativePath - Web APIs
the file.webkitrelativepath is a read-only property that contains a usvstring which specifies the file's path relative to the directory selected by the user in an <
input> element with its webkitdirectory attribute set.
... 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].
FileReader: error event - Web APIs
bubbles no cancelable no interface progressevent event handler property filereader.onerror examples const file
input = document.queryselector('
input[type="file"]'); const reader = new filereader(); function handleselected(e) { const selectedfile = file
input.files[0]; if (selectedfile) { reader.addeventlistener('error', () => { console.error(`error occurred reading file: ${selectedfile.name}`); }); reader.addeventlistener('load', () => { console.error(`file: ${selectedfile.name} read successfully`); }); reader.readasdataurl(selectedfile); ...
... } } file
input.addeventlistener('change', handleselected); specifications specification status file api working draft ...
FileReader.readAsDataURL() - Web APIs
example html <
input type="file" onchange="previewfile()"><br> <img src="" height="200" alt="image preview..."> javascript function previewfile() { const preview = document.queryselector('img'); const file = document.queryselector('
input[type=file]').files[0]; const reader = new filereader(); reader.addeventlistener("load", function () { // convert image file to base64 string preview.src = reader.r...
...esult; }, false); if (file) { reader.readasdataurl(file); } } live result example reading multiple files html <
input id="browse" type="file" onchange="previewfiles()" multiple> <div id="preview"></div> javascript function previewfiles() { var preview = document.queryselector('#preview'); var files = document.queryselector('
input[type=file]').files; function readandpreview(file) { // make sure `file.name` matches our extensions criteria if ( /\.(jpe?g|png|gif)$/i.test(file.name) ) { var reader = new filereader(); reader.addeventlistener("load", function () { var image = new image(); image.height = 100; image.title = file.name; image.src = this.result; preview.appendchild( image ); }, false); r...
FileReader.result - Web APIs
example this example presents a function, read(), which reads a file from a file
input.
... var file
input = document.queryselector('
input[type="file"]'); function read(callback) { var file = file
input.files.item(0); var reader = new filereader(); reader.onload = function() { callback(reader.result); } reader.readastext(file); } specifications specification status comment file apithe definition of 'result' in that specification.
FormData() - Web APIs
it will also encode file
input content.
...ormdata object: var formdata = new formdata(); // currently empty you could add a key/value pair to this using formdata.append: formdata.append('username', 'chris'); or you can specify the optional form argument when creating the formdata object, to prepopulate it with values from the specified form: <form id="myform" name="myform"> <div> <label for="username">enter name:</label> <
input type="text" id="username" name="username"> </div> <div> <label for="useracc">enter account number:</label> <
input type="text" id="useracc" name="useracc"> </div> <div> <label for="userfile">upload file:</label> <
input type="file" id="userfile" name="userfile"> </div> <
input type="submit" value="submit!"> </form> note: only successful form controls are included in a ...
FormData.append() - Web APIs
example the following line creates an empty formdata object: var formdata = new formdata(); // currently empty you can add key/value pairs to this using formdata.append: formdata.append('username', 'chris'); formdata.append('userpic', myfile
input.files[0], 'chris.jpg'); as with regular form data, you can append multiple values with the same name.
... for example (and being compatible with php's naming conventions by adding [] to the name): formdata.append('userpic[]', myfile
input.files[0], 'chris1.jpg'); formdata.append('userpic[]', myfile
input.files[1], 'chris2.jpg'); this technique makes it simpler to process multi-file uploads because the resultant data structure is more conducive to looping.
Geolocation.getCurrentPosition() - Web APIs
syntax navigator.geolocation.getcurrentposition(success[, error[, [options]]) parameters success a callback function that takes a geolocationposition object as its sole
input parameter.
... error optional an optional callback function that takes a geolocationpositionerror object as its sole
input parameter.
Geolocation.watchPosition() - Web APIs
syntax navigator.geolocation.watchposition(success[, error[, options]]) parameters success a callback function that takes a geolocationposition object as an
input parameter.
... error optional an optional callback function that takes a geolocationpositionerror object as an
input parameter.
GlobalEventHandlers.onauxclick - Web APIs
the auxclick event is raised when a non-primary button has been pressed on an
input device (e.g., a middle mouse button).
...historically, click has generally fired for the click of any device
input button, although with browser behavior being somewhat inconsistent.
GlobalEventHandlers.onblur - Web APIs
example this example uses onblur and onfocus to change the text within an <
input> element.
... html <
input type="text" value="click here"> javascript let
input = document.queryselector('
input');
input.onblur =
inputblur;
input.onfocus =
inputfocus; function
inputblur() {
input.value = 'focus has been lost'; } function
inputfocus() {
input.value = 'focus is here'; } result try clicking in and out of the form field, and watch its contents change accordingly.
GlobalEventHandlers.onkeydown - Web APIs
example this example logs the keyboardevent.code value whenever you press down a key inside the <
input> element.
... html <
input> <p id="log"></p> javascript const
input = document.queryselector('
input'); const log = document.getelementbyid('log');
input.onkeydown = logkey; function logkey(e) { log.textcontent += ` ${e.code}`; } result specifications specification status comment html living standardthe definition of 'onkeydown' in that specification.
GlobalEventHandlers.onkeyup - Web APIs
example this example logs the keyboardevent.code value whenever you release a key inside the <
input> element.
... html <
input> <p id="log"></p> javascript const
input = document.queryselector('
input'); const log = document.getelementbyid('log');
input.onkeyup = logkey; function logkey(e) { log.textcontent += ` ${e.code}`; } result specifications specification status comment html living standardthe definition of 'onkeyup' in that specification.
GlobalEventHandlers.onreset - Web APIs
the reset event fires when the user clicks a reset button in a form (<
input type="reset">).
... html <form id="form"> <label>test field: <
input type="text"></label> <br><br> <button type="reset">reset form</button> </form> <p id="log"></p> javascript function logreset(event) { log.textcontent = `form reset!
GlobalEventHandlers - Web APIs
globaleventhandlers.onauxclick an eventhandler called when an auxclick event is sent, indicating that a non-primary button has been pressed on an
input device (e.g.
... globaleventhandlers.on
input is an eventhandler representing the code to be called when the
input event is raised.
HTMLCanvasElement.mozFetchAsStream() - Web APIs
the htmlcanvaselement.mozfetchasstream() internal method used to create a new
input stream that, when ready, would provide the contents of the canvas as image data.
... syntax void canvas.mozfetchasstream(callback, type); parameters callback an nsi
inputstreamcallback.
HTMLDialogElement.returnValue - Web APIs
nu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if (dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } function handleuser
input(returnvalue) { if (returnvalue === 'cancel' || returnvalue == null) { // user canceled the dialog, do nothing } else if (returnvalue === 'confirm') { // user chose a favorite animal, do something with it } } // “update details” button opens the <dialog> modally updatebutton.addeventlistener('click', function() { dialog.sho...
...wmodal(); opencheck(dialog); handleuser
input(dialog.returnvalue); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLElement.click() - Web APIs
when click() is used with supported elements (such as an <
input>), it fires the element's click event.
... syntax element.click() example simulate a mouse-click when moving the mouse pointer over a checkbox: html <form> <
input type="checkbox" id="mycheck" onmouseover="myfunction()" onclick="alert('click event occured')"> </form> javascript // on mouse-over, execute myfunction function myfunction() { document.getelementbyid("mycheck").click(); } specification specification status comment html living standard living standard document object model (dom) level 2 html specification obsolete initial definition.
HTMLElement.dir - Web APIs
browsers might allow users to change the directionality of <
input> and <textarea>s in order to assist with authoring content.
... chrome and safari provide a directionality option in the contextual menu of
input fields while internet explorer and edge use the key combinations ctrl + left shift and ctrl + right shift.
HTMLFormElement.enctype - Web APIs
multipart/form-data: the type that allows file <
input> element(s) to upload file data.
... this value can be overridden by a formenctype attribute on a <button> or <
input> element.
HTMLObjectElement.setCustomValidity - Web APIs
examples in this example, we pass the id of an
input element, and set different error messages depending on whether the value is missing, too low or too high.
... function validate(
inputid) { var
input = document.getelementbyid(
inputid); var validitystate_object =
input.validity; if (validitystate_object.valuemissing) {
input.setcustomvalidity('you gotta fill this out, yo!');
input.reportvalidity(); } else if (
input.rangeunderflow) {
input.setcustomvalidity('we need a higher number!');
input.reportvalidity(); } else if (
input.rangeoverflow) {
input.setcustomvalidity('thats too high!');
input.reportvalidity(); } else {
input.setcustomvalidity('');
input.reportvalidity(); } } it's vital to set the message to an empty string if there are no errors.
ImageCapture.getPhotoCapabilities() - Web APIs
example the following example, extracted from chrome's image capture / photo resolution sample, uses the results from getphotocapabilities() to modify the size of an
input range.
... const
input = document.queryselector('
input[type="range"]'); var imagecapture; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings();
input.min = photocapabilities.imagewidth.min;
input.max = photocapabilities.imagewidth.max;
input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => {
input.value = pho...
ImageCapture.getPhotoSettings() - Web APIs
example the following example, extracted from chrome's image capture / photo resolution sample, uses the results from getphotosettings() to modify the size of an
input range.
... const
input = document.queryselector('
input[type="range"]'); var imagecapture; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings();
input.min = photocapabilities.imagewidth.min;
input.max = photocapabilities.imagewidth.max;
input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => {
input.value = phot...
firesTouchEvents - Web APIs
the
inputdevicecapabilities.firestouchevents read-only property returns a boolean that indicates whether the device dispatches touch events.
... syntax var boolean =
inputdevicecapabilities.firestouchevents returns a boolean example mybutton.addeventlistener('mousedown', function(e) { if (!e.sourcecapabilities.firestouchevents) mybutton.classlist.add("pressed"); }); specifications specification status comment
inputdevicecapabilitiesthe definition of 'firetouchevents' in that specification.
Intersection Observer API - Web APIs
the callback receives as
input an array of all of intersectionobserverentry objects, one for each threshold which was crossed, and a reference to the intersectionobserver object itself.
...objects of this type can only be obtained in two ways: as an
input to your intersectionobserver callback, or by calling intersectionobserver.takerecords().
KeyboardEvent.charCode - Web APIs
example html <p>type anything into the
input box below to log a <code>charcode</code>.</p> <
input type="text" /> <p id="log"></p> javascript let
input = document.queryselector('
input'); let log = document.queryselector('#log');
input.addeventlistener('keypress', function(e) { log.innertext = `key pressed: ${string.fromcharcode(e.charcode)}\ncharcode: ${e.charcode}`; }); result notes in a keypress event, the unicode value of the ...
...actually with the chinese ime i'm using, entering the ime results in a keypress event with keycode = 229 and no other key events fire until the ime exits (which may happen after multiple characters are
inputted).
MSCandidateWindowShow - Web APIs
mscandidatewindowshow fires immediately after the
input method editor (ime) candidate window is set to appear, but before it renders.
... example in ie11, developers can detect the opening of the ime candidate window by listening to mscandidatewindowshow event, then call getcandidatewindowclientrect() function to find out where the candidate window is and position the suggestion ui away from it: var context = document.getelementbyid("mysearchbox").msget
inputcontext(); context.addeventlistener("mscandidatewindowshow", candidatewindowshowhandler); function candidatewindowshowhandler(e) { var imerect = context.getcandidatewindowclientrect(); var suggestionrect = document.getelementbyid("mysuggestionlist").getboundingclientrect(); // check if the two rects intersect, and position them away from each other.
MediaElementAudioSourceNode - Web APIs
a mediaelementsourcenode has no
inputs and exactly one output, and is created using the audiocontext.createmediaelementsource() method.
... 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.
MediaRecorder.start() - Web APIs
then, each time that amount of media has been recorded, an event will be delivered to let you act upon the recorded media, while a new blob is created to record the next slice of the media assuming the mediarecorder's state is inactive, start() sets the state to recording, then begins capturing media from the
input stream.
...this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an
input device.
MediaSession.setActionHandler() - Web APIs
the callback receives no
input parameters, and should not return a value.
... the action handler receives as
input a single parameter: an object conforming to the mediasessionactiondetails dictionary, which provides both the action type (so the same function can handle multiple action types), as well as data needed in order to perform the action.
MediaSettingsRange - Web APIs
example the following example, extracted from chrome's image capture / photo resolution sample, uses the results from getphotocapabilities().imagewidth to modify the size of an
input range.
... const
input = document.queryselector('
input[type="range"]'); var imagecapture; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings();
input.min = photocapabilities.imagewidth.min;
input.max = photocapabilities.imagewidth.max;
input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => {
input.value = photosettings.imagewidth; }) .catch(error => console.log('argh!', error.name || error)); specifications specification ...
MediaStreamTrack.readyState - Web APIs
syntax const state = track.readystate value it takes one of the following values: "live" which indicates that an
input is connected and does its best-effort in providing real-time data.
... "ended" which indicates that the
input is not giving any more data and will never provide new data.
MediaStreamTrack - Web APIs
this will be one of the following values: "live" which indicates that an
input is connected and does its best-effort in providing real-time data.
... "ended" which indicates that the
input is not giving any more data and will never provide new data.
MediaTrackSettings.echoCancellation - Web APIs
echo cancellation is a feature which attempts to prevent echo effects on a two-way audio connection by attempting to reduce or eliminate crosstalk between the user's output device and their
input device.
... for example, it might apply a filter that negates the sound being produced on the speakers from being included in the
input track generated from the microphone.
MediaTrackSettings.noiseSuppression - Web APIs
this feature is typically used on microphones, although it is technically possible it could be provided by other
input sources as well.
... syntax var noisesuppression = mediatracksettings.noisesuppression; value a boolean value which is true if the
input track has noise suppression enabled or false if agc is disabled.
MouseEvent - Web APIs
mouseevent.moz
inputsource read only the type of device that generated the event (one of the moz_source_* constants listed below).
... html <p><label><
input type="checkbox" id="checkbox"> checked</label> <p><button id="button">click me</button> javascript function simulateclick() { var evt = new mouseevent("click", { bubbles: true, cancelable: true, view: window }); var cb = document.getelementbyid("checkbox"); //element to click on var canceled = !cb.dispatchevent(evt); if(canceled) { // a handler called preventdefault ...
Navigator.getUserMedia() - Web APIs
the deprecated navigator.getusermedia() method prompts the user for permission to use up to one video
input device (such as a camera or shared screen) and up to one audio
input device (such as a microphone) as the source for a mediastream.
... if permission is denied, no compatible
input devices exist, or any other error condition occurs, the error callback is executed with a mediastreamerror object describing what went wrong.
NodeList - Web APIs
for...of loops will loop over nodelist objects correctly: const list = document.queryselectorall('
input[type=checkbox]'); for (let checkbox of list) { checkbox.checked = true; } recent browsers also support iterator methods (foreach()) as well as entries(), values(), and keys().
... there is also an internet explorer-compatible way to use array.prototype.foreach for iteration: const list = document.queryselectorall('
input[type=checkbox]'); array.prototype.foreach.call(list, function (checkbox) { checkbox.checked = true; }); specifications specification status comment domthe definition of 'nodelist' in that specification.
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.
PasswordCredential - Web APIs
htmlformelement a reference to an htmlformelement with appropriate
input fields.
... <form id="form" method="post"> <
input type="text" name="id" autocomplete="username" /> <
input type="password" name="password" autocomplete="current-password" /> <
input type="hidden" name="csrf_token" value="*****" /> </form> then, a reference to this form element, using it to create a passwordcredential object, and storing it in the browser's password system.
Payment Request API - Web APIs
accessibility: as the browser controls the
input elements of the payment sheet, it can assure consistent keyboard and screen reader accessibility on every website without developers needing to do anything.
...the paymentrequest allows the web page to exchange information with the user agent while the user provides
input to complete the transaction.
PhotoCapabilities - Web APIs
example the following example, extracted from chrome's image capture / photo resolution sample, uses the results from getphotocapabilities() to modify the size of an
input range.
... const
input = document.queryselector('
input[type="range"]'); var imagecapture; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings();
input.min = photocapabilities.imagewidth.min;
input.max = photocapabilities.imagewidth.max;
input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => {
input.value = pho...
PointerEvent.isPrimary - Web APIs
a pointer representing pen
input is considered the primary pen
input if its pointerdown event was dispatched when no other active pointers representing pen
input existed.
... a pointer representing touch
input is considered the primary touch
input if its pointerdown event was dispatched when no other active pointers representing touch
input existed.
PointerEvent.pressure - Web APIs
the pressure read-only property of the pointerevent interface indicates the normalized pressure of the pointer
input.
... syntax var pressure = pointerevent.pressure; return value pressure the normalized pressure of the pointer
input in the range of 0 to 1, inclusive, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively.
PointerEvent.tangentialPressure - Web APIs
the tangentialpressure read-only property of the pointerevent interface represents the normalized tangential pressure of the pointer
input (also known as barrel pressure or cylinder stress).
... syntax var tanpressure = pointerevent.tangentialpressure; return value a float representing the normalized tangential pressure of the pointer
input in the range -1 to 1, inclusive, where 0 is the neutral position of the control.
Pointer Lock API - Web APIs
the pointer lock api (formerly called mouse lock api) provides
input methods based on the movement of the mouse over time (i.e., deltas), not just the absolute position of the mouse cursor in the viewport.
... more than that, the api is useful for any applications that require significant mouse
input to control movements, rotate objects, and change entries, for example allowing users to control the viewing angle simply by moving the mouse around without any button clicking.
Using Pointer Events - Web APIs
this example is based on the one in the touch events overview, except it uses the pointer events
input event model.
... another difference is that because pointer events are pointer device agnostic, the application accepts coordinate-based
inputs from a mouse, a pen, or a fingertip using the same code.
PublicKeyCredentialCreationOptions.extensions - Web APIs
extensions, an optional property of the publickeycredentialcreationoptions dictionary, is an object providing the client extensions and their
input values.
...the client must not use any authenticator with false acceptance rate (far) and false rejection rate (frr) below the
inputs.
RTCDataChannel: close event - Web APIs
dc.addeventlistener("close", ev => { message
inputbox.disabled = true; sendbutton.disabled = true; connectbutton.disabled = false; disconnectbutton.disabled = true; }, false); all this code does in response to receiving the close event is to disable an
input box and its "send" button, and to enable the button used to start a call (while disabling the one that ends a call).
... you can also use the onclose event handler property to set a handler for close events: dc.onclose = ev => { message
inputbox.disabled = true; sendbutton.disabled = true; connectbutton.disabled = false; disconnectbutton.disabled = true; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'close' in that specification.
RTCDataChannel.onerror - Web APIs
when an error occurs on the data channel, the function receives as
input an errorevent object describing the error which occurred.
...this function receives as its only
input an errorevent object describing the event which was received.
RTCPeerConnection.addTrack() - Web APIs
for example, consider this function that an application might use to begin streaming a device's camera and microphone
input over an rtcpeerconnection to a remote peer: async opencall(pc) { const gumstream = await navigator.mediadevices.getusermedia( {video: true, audio: true}); for (const track of gumstream.gettracks()) { pc.addtrack(track, gumstream); } } the remote peer might then use a track event handler that looks like this: pc.ontrack = ({streams: [stream]} => videoelem.src...
...this track's kind is set to match the kind of the track provided as an
input parameter.
RTCPeerConnection.getStats() - Web APIs
the function receives as
input a single parameter: an rtcstatsreport with the collected statistics.
...the callback receives as
input the exception (a domexception object describing the error which occurred.
RTCPeerConnection.onsignalingstatechange - Web APIs
the function receives as
input the event object of type event; this event is sent when the peer connection's signalingstate changes, which may happen either because of a call to setlocaldescription() or to setremotedescription().
... syntax rtcpeerconnection.onsignalingstatechange = errorhandler; value set this to a function which you provide that receives an event object as
input; this contains the signalingstatechange event.
RTCPeerConnection.ontrack - Web APIs
the function receives as
input the event object, of type rtctrackevent; this event is sent when a new incoming mediastreamtrack has been created and associated with an rtcrtpreceiver object which has been added to the set of receivers on connection.
... syntax rtcpeerconnection.ontrack = eventhandler; value set ontrack to be a function you provide that accepts as
input a rtctrackevent object describing the new track and how it's being used.
RTCPeerConnection.setLocalDescription() - Web APIs
the promise's fulfillment handler receives no
input parameters.
... successcallback a javascript function which accepts no
input parameters to be be called once the description has been successfully set.
RTCPeerConnection.setRemoteDescription() - Web APIs
the promise fulfillment handler receives no
input parameters.
... pc.setremotedescription(sessiondescription, successcallback, errorcallback); parameters successcallback a javascript function which accepts no
input parameters to be be called once the description has been successfully set.
RTCSessionDescription() - Web APIs
this constructor has been deprecated because rtcpeerconnection.setlocaldescription() and other methods which take sdp as
input now directly accept an object conforming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself.
... this is no longer necessary, however; rtcpeerconnection.setlocaldescription() and other methods which take sdp as
input now directly accept an object conforming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself.
RadioNodeList.value - Web APIs
on setting the value property, the first radio button
input element whose value property is equal to the new value will be set to checked.
... syntax value = radionodelist.value; radionodelist.value = string; example html <form> <label><
input type="radio" name="color" value="blue">blue</label> <label><
input type="radio" name="color" value="red">red</label> </form> javascript // get the form const form = document.forms[0]; // get the form's radio buttons const radios = form.elements['color']; // choose the "red" option radios.value = 'red'; result specifications specification status comments html living standardthe definition of 'radionodelist.value' in that specification.
Selection.setBaseAndExtent() - Web APIs
next, we have two form
inputs that allow you to set the anchoroffset and focusoffset — they both have a default value of 0.
... <h1>setbaseandextent example</h1> <div> <p class="one"><span>fish</span><span>dog</span><span>cat</span><span>bird</span></p> <p>middle</p> <p class="two"><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.queryselec...
SpeechRecognitionError.error - Web APIs
aborted speech
input was aborted in some manner, perhaps by some user-agent-specific behavior like a button the user can press to cancel speech
input.
... not-allowed the user agent disallowed any speech
input from occurring for reasons of security, privacy or user preference.
SpeechRecognitionErrorEvent.error - Web APIs
aborted speech
input was aborted in some manner, perhaps by some user-agent-specific behavior like a button the user can press to cancel speech
input.
... not-allowed the user agent disallowed any speech
input from occurring for reasons of security, privacy or user preference.
SpeechSynthesisErrorEvent.error - Web APIs
examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onerror = function(event) { console.error('an error has occurred with the speech synthesis: ' + event.error); }
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'error' in that specification.
SpeechSynthesisErrorEvent - Web APIs
examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onerror = function(event) { console.log('an error has occurred with the speech synthesis: ' + event.error); }
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'speechsynthesiserrorevent' in that specification.
SpeechSynthesisUtterance.SpeechSynthesisUtterance() - Web APIs
var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis);
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'speechsynthesisutterance()' in that specification.
SpeechSynthesisUtterance.lang - Web APIs
examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.lang = 'en-us'; synth.speak(utterthis);
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'lang' in that specification.
SpeechSynthesisUtterance.onboundary - Web APIs
}; examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onboundary = function(event) { console.log(event.name + ' boundary reached after ' + event.elapsedtime + ' milliseconds.'); }
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'onboundary' in that specification.
SpeechSynthesisUtterance.onend - Web APIs
}; examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onend = function(event) { console.log('utterance has finished being spoken after ' + event.elapsedtime + ' milliseconds.'); }
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'onend' in that specification.
SpeechSynthesisUtterance.onerror - Web APIs
}; examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onerror = function(event) { console.log('an error has occurred with the speech synthesis: ' + event.error); }
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'onerror' in that specification.
SpeechSynthesisUtterance.onmark - Web APIs
}; examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onmark = function(event) { console.log('a mark was reached: ' + event.name); }
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'onmark' in that specification.
SpeechSynthesisUtterance.onpause - Web APIs
}; examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onpause = function(event) { console.log('speech paused after ' + event.elapsedtime + ' milliseconds.'); }
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'onpause' in that specification.
SpeechSynthesisUtterance.onresume - Web APIs
}; examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onresume = function(event) { console.log('speech resumed after ' + event.elapsedtime + ' milliseconds.'); }
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'onresume' in that specification.
SpeechSynthesisUtterance.onstart - Web APIs
}; examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onstart = function(event) { console.log('we have started uttering this speech: ' + event.utterance.text); }
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'onstart' in that specification.
SpeechSynthesisUtterance.pitch - Web APIs
examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.pitch = 1.5; synth.speak(utterthis);
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'pitch' in that specification.
SpeechSynthesisUtterance.rate - Web APIs
examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.rate = 1.5; synth.speak(utterthis);
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'rate' in that specification.
SpeechSynthesisUtterance.text - Web APIs
examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } console.log(utterthis.text); synth.speak(utterthis);
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'text' in that specification.
SpeechSynthesisUtterance.voice - Web APIs
examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis);
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'voice' in that specification.
SpeechSynthesisUtterance.volume - Web APIs
examples var synth = window.speechsynthesis; var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ...
...
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.volume = 0.5; synth.speak(utterthis);
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'volume' in that specification.
SpeechSynthesisUtterance - Web APIs
inside the
inputform.onsubmit handler, we stop the form submitting with preventdefault(), use the constructor to create a new utterance instance containing the text from the text <
input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
... var synth = window.speechsynthesis; var voices = synth.getvoices(); var
inputform = document.queryselector('form'); var
inputtxt = document.queryselector('
input'); var voiceselect = document.queryselector('select'); for(var i = 0; i < voices.length; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; option.value = i; voiceselect.appendchild(option); }
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); utterthis.voice = voices[voiceselect.value]; synth.speak(utterthis);
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'speechsynthesisutterance' in that specifi...
SpeechSynthesisVoice - Web APIs
.name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } } populatevoicelist(); if (speechsynthesis.onvoiceschanged !== undefined) { speechsynthesis.onvoiceschanged = populatevoicelist; }
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(
inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.pitch = pitch.value; utterthis.rate = rate.value; ...
... synth.speak(utterthis); utterthis.onpause = function(event) { var char = event.utterance.text.charat(event.charindex); console.log('speech paused at character ' + event.charindex + ' of "' + event.utterance.text + '", which is "' + char + '".'); }
inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'speechsynthesisvoice' in that specification.
SubtleCrypto.deriveBits() - Web APIs
basekey is a cryptokey representing the
input to the derivation algorithm.
... let salt; /* get some key material to use as
input to the derivebits method.
TextEncoder - Web APIs
textencoder takes a stream of code points as
input and emits a stream of utf-8 bytes.
... textencoder.prototype.encode() takes a usvstring as
input, and returns a uint8array containing utf-8 encoded text.
UIEvent() - Web APIs
sourcecapabilities: an instance of the
inputdevicecapabilities interface which provides information about the physical device responsible for generating a touch event.
... specifications specification status comment
inputdevicecapabilities draft added sourcecapabilities property.
ValidityState.rangeOverflow - Web APIs
the read-only rangeoverflow property of a validitystate object indicates if the value of an <
input>, after having been edited by the user, does not conform to the constraints set by the element's max attribute.
... given the following: <
input type="number" min="20" max="40" step="2"/> if value > 40, rangeoverflow will be true.
ValidityState.rangeUnderflow - Web APIs
the read-only rangeunderflow property of a validitystate object indicates if the value of an <
input>, after having been edited by the user, does not conform to the constraints set by the element's min attribute.
... given the following: <
input type="number" min="20" max="40" step="2"/> if value < 20, rangeunderflow will be true.
ValidityState.stepMismatch - Web APIs
the read-only stepmismatch property of a validitystate object indicates if the value of an <
input>, after having been edited by the user, does not conform to the constraints set by the element's step attribute.
... given the following: <
input type="number" min="20" max="40" step="2"/> if (value - min) / 2 != 0, stepmismatch will be true.
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.
A basic 2D WebGL animation example - Web APIs
compiling and linking the shader program constructing and linking the program the buildshaderprogram() function accepts as
input an array of objects describing a set of shader functions to be compiled and linked into the shader program and returns the shader program after it's been built and linked.
... our requestanimationframe() callback receives as
input a single parameter, currenttime, which specifies the time at which the frame drawing began.
Hello vertex attributes - Web APIs
« previousnext » this webgl example demonstrates how to combine shader programming and user interaction by sending user
input to the shader using vertex attributes.
... hello world program in glsl how to send
input to a shader program by saving data in gpu memory.
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
it accepts as
input a mediastream containing the audio to play while the call is on hold.
... remote peer on the remote peer, when we receive an sdp offer with the directionality set to "sendonly", we handle it using the holdrequested() method, which accepts as
input an sdp offer string.
Signaling and video calling - Web APIs
it receives, as
input, a mediastream object representing the stream with audio from the user's microphone and video from their webcam.
... note: we could restrict the set of permitted media
inputs to a specific device or set of devices by calling navigator.mediadevices.enumeratedevices() to get a list of devices, filtering the resulting list based on our desired criteria, then using the selected devices' deviceid values in the deviceid field of the the mediaconstraints object passed into getusermedia().
Taking still photos with WebRTC - Web APIs
(function() { var width = 320; // we will scale the photo width to this var height = 0; // this will be computed based on the
input stream var streaming = false; var video = null; var canvas = null; var photo = null; var startbutton = null; those variables are: width whatever size the incoming video is, we're going to scale the resulting image to be 320 pixels wide.
... the success callback receives a stream object as
input.
Using DTMF with WebRTC - Web APIs
adding the audio to the connection as mentioned above, when the audio
input from the microphone is obtained, gotstream() is called.
...ate(event.candidate)) .catch(err => log("error adding candidate to receiver: " + err)); } else { log("caller is out of candidates."); } } if the icecandidate event has a non-null candidate property, we create a new rtcicecandidate object from the event.candidate string and "transmit" it to the receiver by calling receiverpc.addicecandidate(), providing the new rtcicecandidate as its
input.
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
when the browser needs you to render the scene, it invokes the callback, providing as
input parameters the current time and an xrframe encapsulating the data needed to render the correct frame.
...iewport.x, viewport.y, viewport.width, viewport.height); checkglerror(`setting viewport for eye: ${view.eye}`); myrenderscene(gl, view, scenedata, deltatime); } } } the callback begins by calling a custom function, applypositionoffsets(), which takes a reference space and applies to its transform matrix any changes that need to be made to take into account things such as user
inputs from devices not controlled by webxr, such as the keyboard and mouse.
Geometry and reference spaces in WebXR - Web APIs
this is a reference space which is provided to your app when
input events occur.
...it's particularly useful when determining the distance between the viewer and an
input, or when working with offset spaces.
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
but webxr goes beyond that by adding the ability to track the location, orientation, and motion of the
input devices which generate data used to determine the position and movement of individual parts of the viewer's body (with appropriate equipment).
... for example, if you wish to draw a hand controller's representation using the controller's gripspace, you can get the pose needed like this: let controlpose = frame.getpose(worldrefspace,
inputsource.gripspace); this converts the position and orientation of the
input's grip space to use the world's coordinate system, then generates the corresponding xrpose, storing it in controlpose.
Web Speech API - Web APIs
there are two components to this api: speech recognition is accessed via the speechrecognition interface, which provides the ability to recognize voice context from an audio
input (normally via the device's default speech recognition service) and respond appropriately.
... generally you'll use the interface's constructor to create a new speechrecognition object, which has a number of event handlers available for detecting when speech is
input through the device's microphone.
Window.getSelection() - Web APIs
it is worth noting that currently getselection() doesn't work on the content of <textarea> and <
input> elements in firefox, edge (legacy) and internet explorer.
... html
inputelement.setselectionrange() or the selectionstart and selectionend properties could be used to work around this.
Window - Web APIs
globaleventhandlers.on
input called when the value of an <
input> element changes globaleventhandlers.onkeydown called when you begin pressing any key.
...if the resource fully fits in the window, then this event cannot be invoked globaleventhandlers.onwheel called when the mouse wheel is rotated around any axis globaleventhandlers.onselect called after text in an
input field is selected globaleventhandlers.onselectionchange is an eventhandler representing the code to be called when the selectionchange event is raised.
Sending and Receiving Binary Data - Web APIs
you can also send binary content by passing an instance of the nsifile
inputstream to send().
...var stream = components.classes["@mozilla.org/network/file-
input-stream;1"] .createinstance(components.interfaces.nsifile
inputstream); stream.init(file, 0x04 | 0x08, 0644, 0x04); // file is an nsifile instance // try to determine the mime type of the file var mimetype = "text\/plain"; try { var mimeservice = components.classes["@mozilla.org/mime;1"] .getservice(components.interfaces.nsimimeservice); mimetype = mimeservice.gettypefromfile(file); // file is an nsifile instance } catch (oevent) { /* eat it; just use text/plain */ } // send var req = components.classes["@mozilla.org/xmlextras/xmlht...
XMLSerializer - Web APIs
var inp = document.createelement('
input'); var xmls = new xmlserializer(); var inp_xmls = xmls.serializetostring(inp); // first convert dom node into a string // insert the newly created node into the document's body document.body.insertadjacenthtml('afterbegin', inp_xmls); the code creates a new <
input> element by calling document.createelement(), then serializes it into xml using serializetostring().
... once that's done, insertadjacenthtml() is used to insert the <
input> element into the dom.
XRPose.transform - Web APIs
it determines the targeted object by passing the event frame's pose into a function called findtargetusingray(), then dispatches the event differently depending on the user's handedness; this is done by comparing the value of the xr
inputsource property handedness to a value in the variable user.handedness.
... xrsession.addeventlistener("select", event => { let source = event.
inputsource; let frame = event.frame; let targetraypose = frame.getpose(source.targetrayspace, myrefspace); let targetobject = findtargetusingray(targetray.transform.matrix); if (source.targetraymode == "tracked-pointer") { if (source.handedness == user.handedness) { targetobject.primaryaction(); } else { targetobject.offhandaction(); } } }); specifications specification status comment webxr device apithe definition of 'xrpose.transform' in that specification.
XRReferenceSpace - Web APIs
it's particularly useful when determining the distance between the viewer and an
input, or when working with offset spaces.
...*/ }); the other situation in which you may need to acquire a new reference space is if you need to move the origin to a new position; this is commonly done, for example, when your project allows the user to move through the environment using
input devices such as the keyboard, mouse, touchpad, or game controls that are not connected through the xr device.
XRSession.onsqueezeend - Web APIs
to learn more about how the sequence of squeeze events works, see primary squeeze actions in
inputs and
input sources.
... xrsession.onsqueezeend = event => { if (event.
inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.
inputsource.targetrayspace, myrefspace; if (user.heldobject) { cancelobjectdrag(user.heldobject); } } }; this code presumes that if the user actually intentionally completed the drag, user.heldobject will be null here.
Using the aria-labelledby attribute - Accessibility
this idea is similar to how the "for" attribute is used to link a label to an
input.
... examples example 1: multiple labels in the example below, each
input field is labelled by both its own individual label and by the label for the group: <div id="mybillingid">billing</div> <div> <div id="mynameid">name</div> <
input type="text" aria-labelledby="mybillingid mynameid"/> </div> <div> <div id="myaddressid">address</div> <
input type="text" aria-labelledby="mybillingid myaddressid"/> </div> example 2: associating headings with regions ...
Using the aria-required attribute - Accessibility
description the aria-required attribute is used to indicate that user
input is required on an element before a form can be submitted.
... examples example 1: a simple form <form action="post"> <label for="firstname">first name:</label> <
input id="firstname" type="text" aria-required="true" /> <br/> <label for="lastname">last name:</label> <
input id="lastname" type="text" aria-required="true" /> <br/> <label for="streetaddress">street address:</label> <
input id="streetaddress" type="text" /> </form> working examples: tooltip example (includes the use of the aria-required attribute) notes used in ari...
Keyboard-navigable JavaScript widgets - Accessibility
non-native controls native html elements that are interactive, like <a>, <
input> and <select>, are already accessible by keyboards, so to use one of them is the fastest path to make components work with keyboards.
... ensure that keyboard and mouse produce the same experience to ensure that the user experience is consistent regardless of
input device, keyboard and mouse event handlers should share code where appropriate.
Keyboard - Accessibility
this includes users of screen readers, but can also include users who have trouble operating a pointing device such as a mouse or trackball, or whose mouse is not working at the moment, or who simply prefer to use a keyboard for
input whenever possible.
... standard focusable elements such as links and
input fields are given special styling by the browser by default, so you might not need to specify focus styling for such elements, unless you want the focus styling to be more distinctive.
Perceivable - Accessibility
understanding orientation 1.3.5 identify
input purpose (aa) added in 2.1 follow the list of 53
input fields to programmatically identify the purpose of a field.
... understanding identify
input purpose 1.3.6 identify purpose (aaa) added in 2.1 in content implemented using markup languages, the purpose of user interface components, icons, and regions can be programmatically determined.
-moz-user-focus - CSS: Cascading Style Sheets
instead, xbl creates an anonymous html <
input> element inside the textbox, and that element is what receives focus.
... formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax ignore | normal | select-after | select-before | select-menu | select-same | select-all | none examples html <
input class="ignored" value="the user cannot focus on this element."> css .ignored { -moz-user-focus: ignore; } specifications not part of any standard.
::-moz-focus-inner - CSS: Cascading Style Sheets
the ::-moz-focus-inner css pseudo-element is a mozilla extension that represents an inner focus ring of the <button> element as well as the button, submit, reset, and color types of the <
input> element.
... examples html <
input type="submit" value="
input"/> <button type="submit">button</button> css button::-moz-focus-inner,
input[type="color"]::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner { padding-block-start: 0px; padding-inline-end: 2px; padding-block-end: 0px; padding-inline-start: 2px; border: 1px dotted red; } result specifications not part of any standard.
::-webkit-file-upload-button - CSS: Cascading Style Sheets
the ::-webkit-file-upload-button css pseudo-element represents the button of an <
input> of type="file".
... syntax selector::-webkit-file-upload-button examples html <form> <label for="fileupload">upload file</label><br> <
input type="file" id="fileupload"> </form> css
input, label { display: block; }
input[type=file]::-webkit-file-upload-button { border: 1px solid grey; background: #fffaaa; } below is the example for you to try.
::-webkit-search-cancel-button - CSS: Cascading Style Sheets
the ::-webkit-search-cancel-button css pseudo-element represents a button (the "cancel button") at the edge of an <
input> of type="search" which clears away the current value of the <
input> element.
...the clear button is only shown on non-empty search <
input> elements.
::-webkit-search-results-button - CSS: Cascading Style Sheets
the ::-webkit-search-results-button css pseudo-element represents a button (the "search results button") at the left edge of an <
input> of type="search" which when clicked displays a menu which allows the user to choose from previous recent search queries.
...the search results button is only shown on search <
input> elements that have a results attribute.
:enabled - CSS: Cascading Style Sheets
/* selects any enabled <
input> */
input:enabled { color: blue; } syntax :enabled examples the following example makes the color of text and button <
input>s green when enabled, and gray when disabled.
... html <form action="url_of_form"> <label for="firstfield">first field (enabled):</label> <
input type="text" id="firstfield" value="lorem"><br> <label for="secondfield">second field (disabled):</label> <
input type="text" id="secondfield" value="ipsum" disabled="disabled"><br> <
input type="button" value="submit"> </form> css
input:enabled { color: #2b2; }
input:disabled { color: #aaa; } result specifications specification status comment html living standardthe definition of ':enabled' in that specification.
:indeterminate - CSS: Cascading Style Sheets
/* selects any <
input> whose state is indeterminate */
input:indeterminate { background: lime; } elements targeted by this selector are: <
input type="checkbox"> elements whose indeterminate property is set to true by javascript <
input type="radio"> elements, when all radio buttons with the same name value in the form are unchecked <progress> elements in an indeterminate state syntax :indeterminate examples checkbox & radio button this example applies special styles to the labels associate...
... html <div> <
input type="checkbox" id="checkbox"> <label for="checkbox">this label starts out lime.</label> </div> <div> <
input type="radio" id="radio"> <label for="radio">this label starts out lime.</label> </div> css
input:indeterminate + label { background: lime; } javascript var
inputs = document.getelementsbytagname("
input"); for (var i = 0; i <
inputs.length; i++) {
inputs[i].indeterminate = true; } progress bar html <progress> css progress { margin: 4px; } progress:indeterminate { opacity: 0.5; background-color: lightgray; box-shadow: 0 0 2px 1px red; } result specifications specification status comment html living standardthe definition of ':indeterminate' in that specification.
aspect-ratio - CSS: Cascading Style Sheets
round: #9af; /* blue */ } } /* maximum aspect ratio */ @media (max-aspect-ratio: 3/2) { div { background: #9ff; /* cyan */ } } /* exact aspect ratio, put it at the bottom to avoid override*/ @media (aspect-ratio: 1/1) { div { background: #f9a; /* red */ } } _example used iframe and dataurl to enable this iframe could resize html <label id="wf" for="w">width:165</label> <
input id="w" name="w" type="range" min="100" max="250" step="5" value="165"> <label id="hf" for="w">height:165</label> <
input id="h" name="h" type="range" min="100" max="250" step="5" value="165"> <iframe id="outer" src="data:text/html,<style> @media (min-aspect-ratio: 8/5) { div { background: %239af; } } @media (max-aspect-ratio: 3/2) { div { background: %239ff; } } @media (aspect-ratio: 1/1) { div {...
... background: %23f9a; } }</style><div id='inner'> watch this element as you resize your viewport's width and height.</div>"> </iframe> css iframe{ display:block; } javascript outer.style.width=outer.style.height="165px" w.onchange=w.on
input=function(){ outer.style.width=w.value+"px" wf.textcontent="width:"+w.value } h.onchange=h.on
input=function(){ outer.style.height=h.value+"px" hf.textcontent="height:"+h.value } result specifications specification status comment media queries level 4the definition of 'aspect-ratio' in that specification.
Replaced elements - CSS: Cascading Style Sheets
replaced elements typical replaced elements are: <iframe> <video> <embed> <img> some elements are treated as replaced elements only in specific cases: <option> <audio> <canvas> <object> <applet> html spec also says that an <
input> element can be replaced, because <
input> elements of the "image" type are replaced elements similar to <img>.
... however, other form controls, including other types of <
input> elements, are explicitly listed as non-replaced elements (the spec describes their default platform-specific rendering with the term "widgets").
Cubic Bezier Generator - CSS: Cascading Style Sheets
<html> <canvas id="bezier" width="336" height="336"> </canvas> <form> <label for="x1">x1 = </label><
input onchange="updatecanvas();" type="text" maxlength=6 id="x1" value="0.79" class='field'> <label for="y1">y1 = </label><
input onchange="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 = ...
... > 0.9)) { ctx.moveto(lx(i), 2 * basic_scale_size + cy(0)); ctx.filltext(math.round(i * 10) / 10, cx(i), 4 * basic_scale_size + cy(0)); // limitation the constant 4 should be dependant of the font size } ctx.lineto(lx(i), cy(0)); } // draw the x axis label ctx.textalign = "left"; ctx.filltext("
input (time duration ratio)", cx(0), 4 * basic_scale_size + cy(0)); // limitation the constant 4 should be dependant of the font size ctx.stroke(); ctx.closepath(); // draw the bézier curve ctx.beginpath(); ctx.moveto(cx(0), cy(0)); ctx.strokestyle = 'blue'; ctx.beziercurveto(cx(x1), cy(y1), cx(x2), cy(y2), cx(1), cy(1)); ctx.str...
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
150px; height: 70px; display: inline-block; } .three { color: white; background-color: brown; margin: 10px; width: 75px; } .four { color: white; background-color: brown; margin: 10px; width: 100px; } .five { background-color: brown; } we'll apply it to this html: <div> <div class="one">1:</div> <div class="two">2: text <span class="five">5 - more text</span></div> <
input class="three"> <textarea class="four">4: lorem ipsum</textarea> </div> ...
...: 70px; display: inline-block; } .three { color: white; background-color: var(--main-bg-color); margin: 10px; width: 75px; } .four { color: white; background-color: var(--main-bg-color); margin: 10px; width: 100px; } .five { background-color: var(--main-bg-color); } <div> <div class="one"></div> <div class="two">text <span class="five">- more text</span></div> <
input class="three"> <textarea class="four">lorem ipsum</textarea> </div> this leads to the same result as the previous example, yet allows for one canonical declaration of the desired property value; very useful if you want to change the value across the entire page later.
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
} <div>lorem</div> firefox checkmenuitem div { color: black; height: 20px; -moz-appearance: checkmenuitem; -webkit-appearance: checkmenuitem; } <div>lorem</div> firefox color-well div{ color: black; -moz-appearance: color-well; -webkit-appearance: color-well; } <div>lorem</div> safari
input type=color continuous-capacity-level-indicator div{ color: black; -moz-appearance: continuous-capacity-level-indicator; -webkit-appearance: continuous-capacity-level-indicator; } <div>lorem</div> safari default-button div{ color: black; -moz-appearance: default-button; -webkit-appearance: default-button; } <div>lorem</div>...
... number-
input div { color: black; -moz-appearance: number-
input; -webkit-appearance: number-
input; } <div>lorem</div> firefox progress-bar-value div{ color: black; -webkit-appearance: progress-bar-value; } <div>lorem</div> chrome safari progressbar div { color: black; -moz-appearance: progressbar; -webkit-...
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-w...
...image-repeat: round; } li { display: flex; place-content: center; } javascript const widthslider = document.getelementbyid('width'); const sliceslider = document.getelementbyid('slice'); const widthoutput = document.getelementbyid('width-output'); const sliceoutput = document.getelementbyid('slice-output'); const divelem = document.queryselector('div > div'); widthslider.addeventlistener('
input', () => { const newvalue = widthslider.value + 'px'; divelem.style.borderwidth = newvalue; widthoutput.textcontent = newvalue; }) sliceslider.addeventlistener('
input', () => { const newvalue = sliceslider.value; divelem.style.borderimageslice = newvalue; sliceoutput.textcontent = newvalue; }) result specifications specification status comment css back...
box-shadow - CSS: Cascading Style Sheets
for each shadow, if both
input shadows are or are not inset, then the interpolated shadow must match the
input shadows in that regard.
... if any pair of
input shadows has one inset and the other not inset, the entire shadow list is uninterpolable.
brightness() - CSS: Cascading Style Sheets
the brightness() css function applies a linear multiplier to the
input image, making it appear brighter or darker.
...a value of 0% will create an image that is completely black, while a value of 100% leaves the
input unchanged.
contrast() - CSS: Cascading Style Sheets
the contrast() css function adjusts the contrast of the
input image.
...a value of 0% will create an image that is completely gray, while a value of 100% leaves the
input unchanged.
drop-shadow() - CSS: Cascading Style Sheets
the drop-shadow() css function applies a drop shadow effect to the
input image.
... a drop shadow is effectively a blurred, offset version of the
input image's alpha mask, drawn in a specific color and composited below the image.
invert() - CSS: Cascading Style Sheets
the invert() css function inverts the color samples in the
input image.
...a value of 100% is completely inverted, while a value of 0% leaves the
input unchanged.
opacity() - CSS: Cascading Style Sheets
the opacity() css function applies transparency to the samples in the
input image.
...a value of 0% is completely transparent, while a value of 100% leaves the
input unchanged.
saturate() - CSS: Cascading Style Sheets
the saturate() css function super-saturates or desaturates the
input image.
...a value of 0% is completely unsaturated, while a value of 100% leaves the
input unchanged.
sepia() - CSS: Cascading Style Sheets
the sepia() css function converts the
input image to sepia, giving it a warmer, more yellow/brown appearance.
...a value of 100% is completely sepia, while a value of 0% leaves the
input unchanged.
font-kerning - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | normal | none examples enabling and disabling kerning html <div id="kern"></div> <div id="nokern"></div> <textarea id="
input">av t.
... ij</textarea> css div { font-size: 2rem; font-family: serif; } #nokern { font-kerning: none; } #kern { font-kerning: normal; } javascript let
input = document.getelementbyid('
input'); let kern = document.getelementbyid('kern'); let nokern = document.getelementbyid('nokern');
input.addeventlistener('keyup', function() { kern.textcontent =
input.value; /* update content */ nokern.textcontent =
input.value; }); kern.textcontent =
input.value; /* initialize content */ nokern.textcontent =
input.value; specifications specification status comment css fonts module level 3the definition of 'font-kerning' in that specification.
font-style - CSS: Cascading Style Sheets
html <header> <
input type="range" id="slant" name="slant" min="-90" max="90" /> <label for="slant">slant</label> </header> <div class="container"> <p class="sample">...it would not be wonderful to meet a megalosaurus, forty feet long or so, waddling like an elephantine lizard up holborn hill.</p> </div> css /* amstelvaralpha-vf is created by david berlow (https://github.com/typenetwork/amstelvar) and is us...
...sample { font: 2rem 'amstelvaralpha', sans-serif; } html, body { max-height: 100vh; max-width: 100vw; overflow: hidden; } body { display: flex; flex-direction: column; } header { margin-bottom: 1.5rem; } .container { flex-grow: 1; } .container > p { margin-top: 0; margin-bottom: 0; } javascript let slantlabel = document.queryselector('label[for="slant"]'); let slant
input = document.queryselector('#slant'); let sampletext = document.queryselector('.sample'); function update() { let slant = `oblique ${slant
input.value}deg`; slantlabel.textcontent = `font-style: ${slant};`; sampletext.style.fontstyle = slant; } slant
input.addeventlistener('
input', update); update(); accessibility concerns large sections of text set with a font-style value of italic may ...
font-weight - CSS: Cascading Style Sheets
html <header> <
input type="range" id="weight" name="weight" min="1" max="1000" /> <label for="weight">weight</label> </header> <div class="container"> <p class="sample">...it would not be wonderful to meet a megalosaurus, forty feet long or so, waddling like an elephantine lizard up holborn hill.</p> </div> css /* mutator sans is created by letterror (https://github.com/letterror/mutatorsans) and is used h...
...ercase; font: 1.5rem 'mutatorsans', sans-serif; } html, body { max-height: 100vh; max-width: 100vw; overflow: hidden; } body { display: flex; flex-direction: column; } header { margin-bottom: 1.5rem; } .container { flex-grow: 1; } .container > p { margin-top: 0; margin-bottom: 0; } javascript let weightlabel = document.queryselector('label[for="weight"]'); let weight
input = document.queryselector('#weight'); let sampletext = document.queryselector('.sample'); function update() { weightlabel.textcontent = `font-weight: ${weight
input.value};`; sampletext.style.fontweight = weight
input.value; } weight
input.addeventlistener('
input', update); update(); accessibility concerns people experiencing low vision conditions may have difficulty reading text set with ...
Web Audio playbackRate explained - Developer guides
ate is a multiplier applied to the original rate.) a complete example let's create a <video> element first, and set up video and playback rate controls in html: <video id="myvideo" controls> <source src="https://udn.realityripple.com/samples/6f/08625b424a.m4v" type='video/mp4' /> <source src="https://udn.realityripple.com/samples/5b/8cd6da9c65.webm" type='video/webm' /> </video> <form> <
input id="pbr" type="range" value="1" min="0.5" max="4" step="0.1" > <p>playback rate <span id="currentpbr">1</span></p> </form> and apply some javascript to it: window.onload = function () { var v = document.getelementbyid("myvideo"); var p = document.getelementbyid("pbr"); var c = document.getelementbyid("currentpbr"); p.addeventlistener('
input',function(){ c.innerhtml = p.value; ...
... v.playbackrate = p.value; },false); }; finally, we listen for the
input event firing on the <
input> element, allowing us to react to the playback rate control being changed.
Rich-Text Editing in Mozilla - Developer guides
ht: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sourcetext { padding: 0; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </head> <body onload="initdoc();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}return false;"> <
input type="hidden" name="mydoc"> <div id="toolbar1"> <select onchange="formatdoc('formatblock',this[this.selectedindex].value);this.selectedindex=0;"> <option selected>- formatting -</option> <option value="h1">title 1 <h1></option> <option value="h2">title 2 <h2></option> <option value="h3">title 3 <h3></option> <option value="h4">title 4 <h4></option> <option value="h5">title...
...xsa0cb/i1+3yitha7prkiphvbups+/fvrvv8/f///////////////////////////////////////////////yh5baeaab8alaaaaaawabyaaawn4ceozgmeakqubgsuspvbsyfjjvds6njlb0khr4akbcmfscgbqaocwjf5gwquvyksfbwze+awibv0ghfog2ewidchjwriqo9e2fx4xd5r+b0ddaenbxbhbhn2dgwdaqfjjyvhcqyrfgoidgiqjawtcqmriwwmfgicnvcaaamoak+blaortluyt7i5uiuhads=" /> </div> <div id="textbox" contenteditable="true"><p>lorem ipsum</p></div> <p id="editmode"><
input type="checkbox" name="switchmode" id="switchbox" onchange="setdocmode(this.checked);" /> <label for="switchbox">show html</label></p> <p><
input type="submit" value="send" /></p> </form> </body> </html> note: if you want to see how to standardize the creation and the insertion of your editor in your page, please see our more complete rich-text editor example.
Making content editable - Developer guides
ht: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sourcetext { padding: 0; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </head> <body onload="initdoc();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}return false;"> <
input type="hidden" name="mydoc"> <div id="toolbar1"> <select onchange="formatdoc('formatblock',this[this.selectedindex].value);this.selectedindex=0;"> <option selected>- formatting -</option> <option value="h1">title 1 <h1></option> <option value="h2">title 2 <h2></option> <option value="h3">title 3 <h3></option> <option value="h4">title 4 <h4></option> <option value="h5">title...
...xsa0cb/i1+3yitha7prkiphvbups+/fvrvv8/f///////////////////////////////////////////////yh5baeaab8alaaaaaawabyaaawn4ceozgmeakqubgsuspvbsyfjjvds6njlb0khr4akbcmfscgbqaocwjf5gwquvyksfbwze+awibv0ghfog2ewidchjwriqo9e2fx4xd5r+b0ddaenbxbhbhn2dgwdaqfjjyvhcqyrfgoidgiqjawtcqmriwwmfgicnvcaaamoak+blaortluyt7i5uiuhads=" /> </div> <div id="textbox" contenteditable="true"><p>lorem ipsum</p></div> <p id="editmode"><
input type="checkbox" name="switchmode" id="switchbox" onchange="setdocmode(this.checked);" /> <label for="switchbox">show html</label></p> <p><
input type="submit" value="send" /></p> </form> </body> </html> note: if you want to see how to standardize the creation and the insertion of your editor in your page, please see our more complete rich-text editor example.
Index - Developer guides
42 user
input and controls screen orientation, contenteditable, drag and drop, fullscreen, keyboard, mouse, pointer lock, touch, user
input modern web user
input goes beyond simple mouse and keyboard: think of touchscreens for example.
... this article provides recommendations for managing user
input and implementing controls in open web apps, along with faqs, real-world examples, and links to further information for anyone needing more detailed information on the underlying technologies.
Developer guides
user
input and controls modern web user
input goes beyond simple mouse and keyboard: think of touchscreens for example.
... this article provides recommendations for managing user
input and implementing controls in open web apps, along with faqs, real-world examples, and links to further information for anyone needing more detailed information on the underlying technologies.
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
<form action="#"> <fieldset> <legend>simple fieldset</legend> <
input type="radio" id="radio"> <label for="radio">spirit of radio</label> </fieldset> </form> disabled fieldset this example shows a disabled <fieldset> with two controls inside it.
... <form action="#"> <fieldset disabled> <legend>disabled fieldset</legend> <div> <label for="name">name: </label> <
input type="text" id="name" value="chris"> </div> <div> <label for="pwd">archetype: </label> <
input type="password" id="pwd" value="wookie"> </div> </fieldset> </form> technical summary content categories flow content, sectioning root, listed, form-associated element, palpable content.
<menuitem> - HTML: Hypertext Markup Language
(menu items for indirect commands gain checkboxes or radio buttons when defined against elements <
input type="checkbox"> and <
input type="radio">.) content categories none.
... default this boolean attribute indicates use of the same command as the menu's subject element (such as a button or
input).
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
<form>, <
input>, <textarea>, <select>, and <option> html version 2 strict level 1 this is like regular level 1 but it also excludes these depreciated elements, along with such constructs as nesting a header (<h*> element) within a link (<a> element) html version 2 level 2 this is the default and includes and permits all html level 2 functions and elements and attributes html version 2 strict level 2 this ...
...excludes these depreciated elements and also forbids such constructs as nesting a header (<h*> element) within a link (<a> element), or having a forms <
input> element which is not within a block level element such as <p> html version 3.2 <nextid> has vanished altogether, never to be heard from again.
<samp>: The Sample Output element - HTML: Hypertext Markup Language
found <em>n</em> results.</samp> you can then proceed to the next step.</p> the resulting output looks like this: sample output including user
input you can nest the <kbd> element within a <samp> block to present an example that includes text entered by the user.
... css the css that achieves the appearance we want is: .prompt { color: #b00; } samp > kbd { font-weight: bold; } .cursor { color: #00b; } this simply gives the prompt and cursor fairly subtle colorization and emboldens the keyboard
input within the sample text.
HTML elements reference - HTML: Hypertext Markup Language
<kbd> the html keyboard
input element (<kbd>) represents a span of inline text denoting textual user
input from a keyboard, voice
input, or any other text entry device.
... <
input> the html <
input> element is used to create interactive controls for web-based forms in order to accept data from the user; a wide variety of types of
input data and control widgets are available, depending on the device and user agent.
Content-Location - HTTP
<
input type="text" name="recipient"> </label> </p> <p> <label>how much?
... <
input type="number" name="amount"> </label> </p> <button type="submit">send money</button> </form> when the form is submitted, the site generates a receipt for the transaction.
Feature-Policy - HTTP
camera controls whether the current document is allowed to use video
input devices.
... microphone controls whether the current document is allowed to use audio
input devices.
Index - HTTP
65 feature-policy: camera directive, feature policy, feature-policy, http, reference, camera the http feature-policy header camera directive controls whether the current document is allowed to use video
input devices.
... 69 feature-policy: microphone feature policy, feature-policy, http, header, microphone the http feature-policy header microphone directive controls whether the current document is allowed to use audio
input devices.
A re-introduction to JavaScript (JS tutorial) - JavaScript
unlike most programming languages, the javascript language has no concept of
input or output.
...} var
input; do {
input = get_
input(); } while (
inputisnotvalid(
input)); javascript's for loop is the same as that in c and java: it lets you provide the control information for your loop on a single line.
Closures - JavaScript
<p id="help">helpful notes will appear here</p> <p>e-mail: <
input type="text" id="email" name="email"></p> <p>name: <
input type="text" id="name" name="name"></p> <p>age: <
input type="text" id="age" name="age"></p> function showhelp(help) { document.getelementbyid('help').innerhtml = help; } function setuphelp() { var helptext = [ {'id': 'email', 'help': 'your e-mail address'}, {'id': 'name', 'help': 'your full name'}, {'id': 'age', 'hel...
... the helptext array defines three helpful hints, each associated with the id of an
input field in the document.
Concurrency model and the event loop - JavaScript
to do so, the message is removed from the queue and its corresponding function is called with the message as an
input parameter.
...handling i/o is typically performed via events and callbacks, so when the application is waiting for an indexeddb query to return or an xhr request to return, it can still process other things like user
input.
Array.prototype.reduce() - JavaScript
value > 0) { const doubled = currentvalue * 2; accumulator.push(doubled); } return accumulator; }, []); console.log(doubledpositivenumbers); // [12, 4] running promises in sequence /** * runs promises from array of functions that can return promises * in chained manner * * @param {array} arr - promise arr * @return {object} promise object */ function runpromiseinsequence(arr,
input) { return arr.reduce( (promisechain, currentfunction) => promisechain.then(currentfunction), promise.resolve(
input) ) } // promise function 1 function p1(a) { return new promise((resolve, reject) => { resolve(a * 5) }) } // promise function 2 function p2(a) { return new promise((resolve, reject) => { resolve(a * 2) }) } // function 3 - will be wrapped in a resolved...
...resolve, reject) => { resolve(a * 4) }) } const promisearr = [p1, p2, f3, p4] runpromiseinsequence(promisearr, 10) .then(console.log) // 1200 function composition enabling piping // building-blocks to use for composition const double = x => x + x const triple = x => 3 * x const quadruple = x => 4 * x // function composition enabling pipe functionality const pipe = (...functions) =>
input => functions.reduce( (acc, fn) => fn(acc),
input ) // composed functions for multiplication of specific values const multiply6 = pipe(double, triple) const multiply9 = pipe(triple, triple) const multiply16 = pipe(quadruple, quadruple) const multiply24 = pipe(double, triple, quadruple) // usage multiply6(6) // 36 multiply9(9) // 81 multiply16(16) // 256 multiply24(10) // 240 write...
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.
...in other words, it allows you to map many items to many items (by handling each
input item separately), rather than always one-to-one.
RegExp() constructor - JavaScript
in other words, match the beginning or end of each line (delimited by \n or \r), not only the very beginning or end of the whole
input string.
...use the constructor function when you know the regular expression pattern will be changing, or you don't know the pattern and are getting it from another source, such as user
input.
RegExp.prototype.exec() - JavaScript
return value if the match succeeds, the exec() method returns an array (with extra properties index and
input; see below) and updates the lastindex property of the regular expression object.
... 4
input the original string that was matched against.
RegExpInstance.lastIndex - JavaScript
if lastindex is equal to or less than the length of the string and if the regular expression matches the empty string, then the regular expression matches
input starting from lastindex.
... if lastindex is equal to the length of the string and if the regular expression does not match the empty string, then the regular expression mismatches
input, and lastindex is reset to 0.
RegExp - JavaScript
use the constructor function when you know the regular expression pattern will be changing, or you don't know the pattern and obtain it from another source, such as user
input.
...g) regex.lastindex // 0 (reset after match failure) the difference between the sticky flag and the global flag with the sticky flag y, the next match has to happen at the lastindex position, while with the global flag g, the match can happen at the lastindex position or later: re = /\d/y; while (r = re.exec("123 456")) console.log(r, "and re.lastindex", re.lastindex); // [ '1', index: 0,
input: '123 456', groups: undefined ] and re.lastindex 1 // [ '2', index: 1,
input: '123 456', groups: undefined ] and re.lastindex 2 // [ '3', index: 2,
input: '123 456', groups: undefined ] and re.lastindex 3 // ...
Lexical grammar - JavaScript
the source text of ecmascript scripts gets scanned from left to right and is converted into a sequence of
input elements which are tokens, control characters, line terminators, comments or white space.
...a semicolon is inserted at the end, when the end of the
input stream of tokens is detected and the parser is unable to parse the single
input stream as a complete program.
OpenSearch description format
<opensearchdescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/"> <shortname>[snk]</shortname> <description>[search engine full name and summary]</description> <
inputencoding>[utf-8]</
inputencoding> <image width="16" height="16" type="image/x-icon">[https://example.com/favicon.ico]</image> <url type="text/html" template="[searchurl]"> <param name="[key name]" value="{searchterms}"/> <!-- other params if you need them… --> <param name="[other key name]" value="[parameter value]"/> </url> <url type="application/x-suggestions+json" template=...
...
inputencoding the character encoding to use when submitting
input to the search engine.
Recommended Web Performance Timings: How long is too long? - Web Performance
there are no clear set rules as to what constitutes a slow pace when loading pages, but there are specific guidelines for indicating content will load (1 second), idling (50ms), animating (16.7s) and responding to user
input (50 to 200ms).
...if the thread is busy doing complex javascript execution, the main thread will not be available to react to user
input, such as pressing a button.
Web Performance
to understand how to improve performance and perceived performance, it helps to understand how the browser works.recommended web performance timings: how long is too long?there are no clear set rules as to what constitutes a slow pace when loading pages, but there are specific guidelines for indicating content will load (1 second), idling (50ms), animating (16.7s) and responding to user
input (50 to 200ms).the business case for web performanceyou know web performance is important, but how do you convince clients and management to invest in performance and make it a priority.
... glossary terms beacon brotli compression client hints code splitting cssom domain sharding effective connection type first contentful paint first cpu idle first
input delay first interactive first meaningful paint first paint http http/2 jank latency lazy load long task lossless compression lossy compression main thread minification network throttling packet page load time page prediction parse perceived performance prefetch prerender quic rail real user monitoring resource timing round trip time (rtt) server timing speculative pars...
begin - SVG: Scalable Vector Graphics
those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, wheel, before
input,
input, keydown, keyup, compositionstart, compositionupdate, compositionend, load, unload, abort, error, select, resize, scroll, beginevent, endevent, and repeatevent.
... a valid accesskey-value consists of the function accesskey() with the character to be
input as parameter.
end - SVG: Scalable Vector Graphics
those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, wheel, before
input,
input, keydown, keyup, compositionstart, compositionupdate, compositionend, load, unload, abort, error, select, resize, scroll, beginevent, endevent, and repeatevent .
... a valid accesskey-value consists of the function accesskey() with the character to be
input as parameter.
targetX - SVG: Scalable Vector Graphics
the targetx attribute determines the positioning in horizontal direction of the convolution matrix relative to a given target pixel in the
input image.
... only one element is using this attribute: <feconvolvematrix> usage notes value <integer> default value floor(orderx / 2) animatable yes <integer> this value indicates the positioning in horizontal direction of the convolution matrix relative to a given target pixel in the
input image.
targetY - SVG: Scalable Vector Graphics
the targety attribute determines the positioning in vertical direction of the convolution matrix relative to a given target pixel in the
input image.
... only one element is using this attribute: <feconvolvematrix> usage notes value <integer> default value floor(ordery / 2) animatable yes <integer> this value indicates the positioning in vertical direction of the convolution matrix relative to a given target pixel in the
input image.
<feComposite> - SVG: Scalable Vector Graphics
the <fecomposite> svg filter primitive performs the combination of two
input images pixel-wise in image space using one of the porter-duff compositing operations: over, in, atop, out, xor, and lighter.
...if the arithmetic operation is chosen, each result pixel is computed using the following formula: result = k1*i1*i2 + k2*i1 + k3*i2 + k4 where: i1 and i2 indicate the corresponding pixel channel values of the
input image, which map to in and in2 respectively k1, k2, k3 and k4 indicate the values of the attributes with the same name usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes » presentation attributes » filter primitive attributes » class style specific attri...
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
of the pseudo-
inputs, sourcegraphic, sourcealpha, fillpaint and strokepaint are implemented.
... use of an unimplemented pseudo-
input or filter element will cause the filter to be ignored and the referring graphic to be drawn without any filter.
SVG Filters Tutorial - SVG: Scalable Vector Graphics
the keyword sourcealpha identifies the
input for this primitive, is in this case
input 'in'.
...<femerge> primitive contains the nodes <femergenode> taking as
input the result offsetblur , this will allow it to appear below the sourcegraphic implementation of more primitives <defs> <filter id="drop-shadow"> <fegaussianblur in="sourcealpha" stddeviation="3" result="blur"/> <feoffset in="blur" dx="4" dy="4" result="offsetblur"/> </filter> <femerge> <femergenode in="offsetblur"/> <femergenode in="sourcegraphic"/> </femerge> </defs> ...
<xsl:stylesheet> - XSLT: Extensible Stylesheet Language Transformations
input-type-annotations specifies whether type annotations are stripped from the element so the same results are produced whether the source documents have been validated against a schema or not.
... xslt 2.0 added the attributes xpath-default-namespace, default-validation, default-collation, and
input-type-annotations and made all attributes except version optional.
Compiling an Existing C Module to WebAssembly - WebAssembly
the function takes a pointer to the
input image and its dimensions, as well as a quality option between 0 and 100.
... 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.
Communicating With Other Scripts - Archive of obsolete content
= require("sdk/page-mod"); var self = require("sdk/self"); var pageurl = self.data.url("page.html") var pagemod = mod.pagemod({ include: pageurl, contentscriptfile: self.data.url("content-script.js"), contentscriptwhen: "ready" }) tabs.open(pageurl); the target web page "page.html" includes a button and a page script: <html> <head> <meta charset="utf-8"> </head> <body> <
input id="message" type="button" value="send a message"/> <script type="text/javascript" src="page-script.js"></script> </body> </html> the content script "content-script.js" adds an event listener to the button, that sends a custom event containing a message: var messenger = document.getelementbyid("message"); messenger.addeventlistener("click", sendcustomevent, false); function sendcustomeve...
console - Archive of obsolete content
console.log(object[, object, ...]) logs the arguments to the console, preceded by "info:" and the name of your add-on: console.log("this is an informational message"); info: my-addon: this is an informational message console.time(name) starts a timer with a name specified as an
input parameter.
Canvas code snippets - Archive of obsolete content
pt; image.onerror = reject; }).then(accept => { canvas.width = this.width; canvas.height = this.height; ctxt.clearrect(0, 0, this.width, this.height); ctxt.drawimage(this, 0, 0); accept(canvas.todataurl()); }); } usage: loadimagefile('myimage.jpg').then(string64 => { alert(string64); }); if you want to get instead the base64 content of a local file using the file <
input> element, you must use the filereader object.
Downloading Files - Archive of obsolete content
url(url) { var ioserv = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var channel = ioserv.newchannel(url, 0, null); var stream = channel.open(); if (channel instanceof components.interfaces.nsihttpchannel && channel.responsestatus != 200) { return ""; } var bstream = components.classes["@mozilla.org/binary
inputstream;1"] .createinstance(components.interfaces.nsibinary
inputstream); bstream.set
inputstream(stream); var size = 0; var file_data = ""; while(size = bstream.available()) { file_data += bstream.readbytes(size); } return file_data; } see also nsidownloadprogresslistener saving an arbitrary url to a local file customizing the download progress bar appearance...
Forms related code snippets - Archive of obsolete content
zdp-increase-month, span.zdp-increase-year { float: right; margin-left: 2px; } td.zdp-active-cell { padding: 1px 3px; cursor: pointer; color: #000000; text-align: center; vertical-align: middle; } td.zdp-active-cell:hover { background-color: #999999; cursor: pointer; } td.zdp-empty-cell { cursor: not-allowed; } </style> </head> <body> <form name="myform"> <p> from: <
input type="text" readonly class="date-picker" name="date-from" /> to: <
input type="text" readonly class="date-picker" name="date-to" /> </p> </form> </body> </html> note: the current implementation of const (constant statement) is not part of ecmascript 5.
Modules - Archive of obsolete content
the use of eval() will probably not be of concern because it is only being used on the exported_symbols array which should not depend on user
input.
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
(see xpcom:arrays.) nscomptr<nsisupportsarray> array; - rv = ns_newisupportsarray(getter_addrefs(array)); + array = do_createinstance(ns_supportsarray_contractid); - nscomptr<nsi
inputstream> rawstream;- rv = ns_newbyte
inputstream(getter_addrefs(rawstream),- (const char*)data, length); + nscomptr<nsistring
inputstream> rawstream =+ do_createinstance(ns_string
inputstream_contractid, &rv);+ ns_ensure_success(rv, rv);++ rv = rawstream->setdata((const char*)data, length); ns_ensure_success(rv, rv); nsistring
inputstream is not frozen (and thus, not av...
Connecting to Remote Content - Archive of obsolete content
let domparser = components.classes["@mozilla.org/xmlextras/domparser;1"] .createinstance(components.interfaces.nsidomparser); let filestream = components.classes["@mozilla.org/network/file-
input-stream;1"] .createinstance(components.interfaces.nsifile
inputstream); let xsltprocessor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); let xsldocument; filestream.init(somexslfile, -1, 0x01, 0444); // read only // parse from the xslt stylesheet file stream xsldocument = domparser.pars...
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
the demo of this is seen at jsfiddle :: jsontodom example var json = ['html:div', {style:'background-color:springgreen'}, ['html:form', {id:'myfirstform'}, ['html:
input', {type:'text', value:'my field'}], ['html:button', {id:'mybtn'}, 'button text content'] ], ['html:form', {id:'mysecondform'}, ['html:
input', {type:'text', value:'my field for second form'}], ['html:div', {}, 'sub div with textcontent and siblings', ['html:br', {}], ['html:
input', {type:'checkbox', id:'myc...
Windows Media in Netscape - Archive of obsolete content
here, for example, is a code snippet that works equally well on both netscape 7.1 and ie: <object id="player" height="0" width="0" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6"> <param name="autostart" value="true"> </object> <
input type="button" name="playmedia" value="play" onclick="startmediaup()"> <
input type="button" name="stopmedia" value="stop" onclick="shutmediadown()"> <p>this example shows a minimally-functional player <script> <!-- function startmediaup () { document.player.url = "preludesteel.wma"; document.player.controls.play(); } function shutmediadown () { document.player.controls.stop(); } --> </s...
Building up a basic demo with the PlayCanvas engine - Game development
built for modern browsers, playcanvas is a fully-featured 3d game engine with resource loading, an entity and component system, advanced graphics manipulation, collision and physics engine (built with ammo.js), audio, and facilities to handle control
inputs from various devices (including gamepads).
Building up a basic demo with PlayCanvas - Game development
playcanvas engine built for modern browsers, playcanvas is a fully-featured 3d game engine with resource loading, an entity and component system, advanced graphics manipulation, collision and physics engine (built with ammo.js), audio, and facilities to handle control
inputs from various devices (including gamepads).
Efficient animation for web games - Game development
modern console games, for example, tend to prioritise framerate during player movement and combat, but may prioritise image quality or physics detail when compromise to framerate and
input response would be less noticeable.
Buttons - Game development
to do that, adjust the update() function like so: function update() { game.physics.arcade.collide(ball, paddle, ballhitpaddle); game.physics.arcade.collide(ball, bricks, ballhitbrick); if(playing) { paddle.x = game.
input.x || game.world.width*0.5; } } that way the paddle is immovable after everything is loaded and prepared, but before the start of the actual game.
Collision detection - Game development
first, add a new line inside your update() function that checks for collision detection between ball and bricks, as shown below: function update() { game.physics.arcade.collide(ball, paddle); game.physics.arcade.collide(ball, bricks, ballhitbrick); paddle.x = game.
input.x || game.world.width*0.5; } the ball's position is calculated against the positions of all the bricks in the group.
Visual-js game engine - Game development
1) click create application 2) enter new application name in
input prompt 3) select folder for server part of application (important : www is not secure place) 4) select folder for client part of application ( any path in www) 5) new app name will appear in project list , select and click open application 6) open your server folder : install node.js modules one way - use windows bat-s file (in server root folder with prefix install_ ) second way - open ...
Software accessibility: Where are we today?
some examples of these assistive devices and software include: screen reading software, which speaks text displayed on the screen using hardware or software text-to-speech, and which allows a blind person to use the keyboard to simulate mouse actions alternate
input devices, which allow people with physical disabilities to use alternatives to a keyboard and mouse voice recognition software, which allows a person to simulate typing on a keyboard or selecting with a mouse by speaking into the computer screen magnification software, which allows a low-vision computer user to more easily read portions of the screen comprehension software, which allows a dy...
Creating a Login Manager storage module
oginmanager: " + 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(a
inputfile, aoutputfile) { 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); }, removealllogi...
Debugging Frame Reflow
scroll scroll caption tablecaption cell tablecell bccell bctablecell col tablecol colg tablecolgroup tbl table tblo tableouter rowg tablerowgroup row tablerow textctl text
input text text vp viewport once the problem is reduced to a single frame level, placing a breakpoint at displayreflowenterprint in nsframe.cpp is a very efficient way to step through the reflow tree.
Error codes returned by Mozilla APIs
ns_error_plugins_pluginsnotchanged (0x804c03e8) ns_error_plugin_disabled (0x804c03e9) ns_error_uconv_noconv (0x80500001) ns_error_udec_illegal
input (0x8050000e) ns_imagelib_error_failure (0x80540005) ns_imagelib_error_no_decoder (0x80540006) ns_imagelib_error_not_finished (0x80540007) ns_imagelib_error_load_aborted (0x80540008) ns_error_wont_handle_content (0x805d0001) moz_error_storage_error (0x80630001) ns_error_schemavalidator_no_schema_loaded (0x80640001) ns_error_schemavalidator_no_dom_node_specified (0x8...
Limitations of frame scripts
examples of apis add-on authors should avoid in frame scripts: nsifile
inputstream nsifileoutputstream constructing a file from a string or nsifile (but file objects can be sent via message manager) html
inputelement.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.
Limitations of frame scripts
for example: nsifile
inputstream nsifileoutputstream constructing a file from a string or nsifile (but file objects can be sent via message manager) html
inputelement.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.
Security best practices for Firefox front-end engineers
we use our built-in sanitizer with the following flags: sanitizerallowstyle sanitizerallowcomments sanitizerdropforms sanitizerlogremovals the sanitizer removes all scripts (script tags, event handlers) and form elements (form,
input, keygen, option, optgroup, select, button, datalist).
Gecko Keypress Event
e.g., ctrl+shift+'2' on persian keyboard layout
inputs a zwnj, though shift+'2'
inputs '@', and so, if gecko were to replace the charcode in this case, users would not be able to
input zwnj (bug 414130).
HTTP Cache
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.
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
; updateappenders(); and the methods mentioned below: logger methods loggerrepository(); length: 0 keys of prototype: getlogger(); rootlogger storagestreamappender(); length: 1 keys of prototype: doappend(); get
inputstream(); newoutputstream(); outputstream reset(); structuredformatter(); length: 0 keys of prototype: format(); method overview enumerateinterfaces(); length: 0 enumerateproperties(); length: 2 member fields ...
PR_GetSocketOption
on
input, the option field of this structure must be set to indicate which socket option to retrieve for the socket represented by the fd parameter.
PR_Interrupt
unfortunately the standard
input, output, and error streams are treated as files by nspr, so a pr_read call on pr_stdin cannot be interrupted even though it may block indefinitely.
PR NewProcessAttr
the new prprocessattr structure is initialized with these default attributes: the standard i/o streams (standard
input, standard output, and standard error) are not redirected.
PR_NormalizeTime
for example, if the
input argument time is in time zone a and the
input argument params represents time zone b, when pr_normalizetime() returns, time will be in time zone b.
PR_SetSocketOption
description on
input, the caller must set both the option and value fields of the prsocketoptiondata object pointed to by the data parameter.
PR_StringToNetAddr
description for ipv4 addresses, the
input string represents numbers in the internet standard "." notation.
PR_dtoa
if the
input parameter d is+infinity,-infinity ornan, *decpt is set to 9999.
An overview of NSS Internals
create a context handle while providing all the parameters required for the operation, then call an “update” function multiple times to pass subsets of the
input to nss.
NSS 3.12.5 release_notes
see the following struct in nss.h for details: nssinitparametersstr other new functions in secmod.h: secmod_getskipfirstflag secmod_getdefaultmoddbflag in prlink.h nss_securememcmp port_loadlibraryfromorigin modified functions sgn_update (see cryptohi.h) the parameter "
input" of this function is changed from unsigned char * to const unsigned char *.
NSS 3.12.6 release notes
: support for tls compression rfc 3749 bug 494603: update nss's copy of sqlite3 to 3.6.22 to get numerous bug fixes bug 496993: add accessor functions for ssl_implementedciphers bug 515279: cert_pkixverifycert considers a certificate revoked if cert_processocspresponse fails for any reason bug 515870: gcc compiler warnings in nss 3.12.4 bug 518255: the
input buffer for sgn_update should be declared const bug 519550: allow the specification of an alternate library for sqlite bug 524167: crash in [[@ find_objects_by_template - nsstoken_findcertificatebyissuerandserialnumber] bug 526910: maxresponselength (initialized to pkix_default_max_response_length) is too small for downloading some crls.
NSS 3.12.9 release notes
bug 609068: implement j-pake in freebl bug 607058: crash [@ nss_cms_decoder_work_data] bug 613394: november/december 2010 batch of nss root ca changes bug 610843: need way to recover softoken in child after fork() bug 617492: add pk11_keygenwithtemplate function to pk11wrap (for firefox sync) bug 610162: sha-512 and sha-384 hashes are incorrect for
inputs of 512mb or larger when running under windows and other 32-bit platforms (fx 3.6.12 and 4.0b6) bug 518551: vfychain crashes in pkits tests.
NSS 3.15.5 release notes
notable changes in nss 3.15.5 bug 950129: improve the ocsp fetching policy when verifying ocsp responses bug 949060: validate the iov
input argument (an array of priovec structures) of ssl_writev (called via pr_writev).
NSS 3.36.8 release notes
bugs fixed in nss 3.36.8 1554336 - optimize away unneeded loop in mpi.c 1515342 - more thorough
input checking (cve-2019-11729) 1540541 - don't unnecessarily strip leading 0's from key material during pkcs11 import (cve-2019-11719) compatibility nss 3.36.8 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.44.1 release notes
new in nss 3.44.1 new functionality 1546229 - add ipsec ike support to softoken many new fips test cases (note: this has increased the source archive by approximately 50 megabytes for this release.) bugs fixed in nss 3.44.1 1554336 - optimize away unneeded loop in mpi.c 1515342 - more thorough
input checking (cve-2019-11729) 1540541 - don't unnecessarily strip leading 0's from key material during pkcs11 import (cve-2019-11719) 1515236 - add a sslkeylogfile enable/disable flag at build.sh 1473806 - fix seckey_converttopublickey handling of non-rsa keys 1546477 - updates to testing for fips validation 1552208 - prohibit use of rsassa-pkcs1-v1_5 algorithms in tls 1...
NSS 3.45 release notes
certificate authority changes the following ca certificates were removed: bug 1552374 - cn = certinomis - root ca sha-256 fingerprint: 2a99f5bc1174b73cbb1d620884e01c34e51ccb3978da125f0e33268883bf4158 bugs fixed in nss 3.45 bug 1540541 - don't unnecessarily strip leading 0's from key material during pkcs11 import (cve-2019-11719) bug 1515342 - more thorough
input checking (cve-2019-11729) bug 1552208 - prohibit use of rsassa-pkcs1-v1_5 algorithms in tls 1.3 (cve-2019-11727) bug 1227090 - fix a potential divide-by-zero in makepfromqandseed from lib/freebl/pqg.c (static analysis) bug 1227096 - fix a potential divide-by-zero in pqg_verifyparams from lib/freebl/pqg.c (static analysis) bug 1509432 - de-duplicate code between mp_set_long and mp_set_ul...
NSS API Guidelines
functions which act like filters should have a consistent signature: secstatus pk11_digestop(pk11context *context, unsigned char *inbuf, secbufferleninlen) functions like these which have different properties, for example, additional parameters, callbacks, etc., should insert their additional parameters between the context (first parameter) and the
input buffer.
Overview of NSS
the nss libraries passed the niscc tls/ssl and s/mime test suites (1.6 million test cases of invalid
input data).
FC_GetMechanismInfo
syntax ck_rv fc_getmechanisminfo( ck_slot_id slotid, ck_mechanism_type type, ck_mechanism_info_ptr pinfo ); parameters fc_getmechanisminfo takes three parameters: slotid [
input] type [
input] .
FC_GetMechanismList
syntax ck_rv fc_getmechanismlist( ck_slot_id slotid, ck_mechanism_type_ptr pmechanismlist, ck_ulong_ptr puscount ); parameters fc_getmechanismlist takes three parameters: slotid [
input] pinfo [output] the address of a variable that will receive a pointer to the list of function pointers.
FC_WaitForSlotEvent
syntax ck_rv fc_waitforslotevent(ck_flags flags, ck_slot_id_ptr pslot ck_void_ptr preserved); parameters fc_waitforslotevent takes three parameters: [
input] flags [
input] pslot.
NSS tools : pk12util
bs patch error o 23 - get default cert db error o 24 - find cert by nickname error o 25 - create export context error o 26 - pkcs12 add password itegrity error o 27 - cert and key safes creation error o 28 - pkcs12 add cert and key error o 29 - pkcs12 encode error examples importing keys and certificates the most basic usage of pk12util for importing a certificate or key is the pkcs#12
input file (-i) and some way to specify the security database being accessed (either -d for a directory or -h for a token).
NSS_3.12.3_release_notes.html
bug 464406: fix signtool regressions bug 465270: uninitialised value in devutil.c::create_object() bug 465273: dead assignment in devutil.c::nssslotarray_clone() bug 465926: during import of pkcs #12 files bug 466180: ssl_configmpserversidcache with default parameters fails on {net bug 466194: cert_decodetruststring should take a const char *
input trusts string.
NSS Tools certutil
arguments -a use ascii format or allow the use of ascii format for
input or output.
NSS tools : pk12util
t db error o 24 - find cert by nickname error o 25 - create export context error o 26 - pkcs12 add password itegrity error o 27 - cert and key safes creation error o 28 - pkcs12 add cert and key error o 29 - pkcs12 encode error examples importing keys and certificates the most basic usage of pk12util for importing a certificate or key is the pkcs#12
input file (-i) and some way to specify the security database being accessed (either -d for a directory or -h for a token).
Necko Interfaces Overview
gecko own all channels used to load a particular page (until the channels complete) all channels owned by a load group can be canceled at once via the load group's nsirequest::cancel method nsitransport represents a physical connection, such as a file descriptor or a socket used directly by protocol handler implementations (as well as by mailnews and chatzilla) synchronous i/o methods: open
inputstream, openoutputstream asynchronous i/o methods: asyncread, asyncwrite nsitransport::asyncread takes a nsistreamlistener parameter original document information author(s): darin fisher last updated date: december 10, 2001 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | detai...
Pork Tools
it takes a list of functions as
input and rewrites the definition and call sites of those functions.
Pork
the
inputs driving the rewriting would normally be provided by a program-analysis system outside of pork.
nsITransferable
return value missing description flavorstransferablecanimport() computes a list of flavors (mime types as nsisupportscstring) that the transferable can accept into it, either through intrinsic knowledge or
input data converters.
nsIURIFixup
fixup_flags_make_alternate_uri 2 tell the fixup to make an alternate uri from the
input uri, for example to turn foo into www.foo.com.
nsIXMLHttpRequest
you only want this if your url is to a zip file or some file you want to download and make a nsiarraybuffer
inputstream out of it or something xhr.send(null); } xhr('https://www.gravatar.com/avatar/eb9895ade1bd6627e054429d1e18b576?s=24&d=identicon&r=pg&f=1', data => { services.prompt.alert(null, 'xhr success', data); var file = os.path.join(os.constants.path.desktopdir, "test.png"); var promised = os.file.writeatomic(file, new uint8array(data)); promised.then( function() { ...
nsIXmlRpcClient
supported arguments are: nsisupportspruint8, nsisupportspruint16, nsisupportsprint16, nsisupportsprint32: i4, nsisupportsprbool: boolean, nsisupportschar, nsisupportscstring: string, nsisupportsfloat, nsisupportsdouble: double, nsisupportsprtime: datetime.iso8601, nsi
inputstream: base64, nsisupportsarray: array, nsidictionary: struct note that both nsisupportsarray and nsidictionary can only hold any of the supported
input types.
Storage
both of these methods have similar signatures that accept an object as
input that receives notifications the execution of the statement(s).
Getting Started Guide
if you were to use a raw pointer instead, your function couldn't know what ownership relationship the caller had to the
input value, and hence, couldn't know whether to release it or not before assigning in the new value.
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 ...
XUL Overlays
the following snippet shows a dialog with custom ui elements at the top and a reference to the overlay's ok and cancel buttons at the bottom: <box align="horizontal" id="bx1" flex="100%" style="margin-bottom: 1em; width: 100%;"> <html:
input type="checkbox" id="dialog.newwindow"/> <html:label for="dialog.newwindow">&openwin.label;</html:label> <spring flex="100%"/> </box> <box id="okcancelbuttons"/> for more detail, see the ok and cancel button definitions being referenced here in the global component file platformdialogoverlay.xul.
The libmime module
there is a class for each mime type, and each class is responsible for parsing itself, and/or handing the
input data off to one of its child objects.
Access Thunderbird Window Areas
var foldertree = getfoldertree(); var search
input = getsearch
input(); var messagepane = getmessagepane(); var messagepaneframe = getmessagepaneframe(); var mailtoolbox = getmailtoolbox(); var currentmsgfolder = getloadedmsgfolder(); see the msgmail3panewindow.js for other helper methods ...
libmime content type handlers
pizzarro <rhp@netscape.com> contents overview api's plugin location/installation sample content type handler plugin overview the libmime module implements a general-purpose mime parser and one of the primary methods provided by the parser is the ability to emit an html representation of an
input stream.
Using tab-modal prompts
/prompter;1'].getservice(components.interfaces.nsipromptfactory); var prompt = promptfact.getprompt(window, components.interfaces.nsiprompt); var promptbag = prompt.queryinterface(components.interfaces.nsiwritablepropertybag2); promptbag.setpropertyasbool('allowtabmodal', true); var check = {value: false}; //initial state of checkbox, however if no text is supplied the checkbox is not shown var
input = {value: 'pre filled value'}; var ok = prompt.prompt.apply(null, ['title - but not shown in tab modal', 'text goes here',
input, 'check text, if no text, checkbox is not shown', check]); //this here is just an alert, showing the values of the prompt prompt.alert.apply(null, ['title not shown in modal', 'user clicked ok: ' + ok + '\n' + 'checked: ' + check.value + '\n
input value: ' +
input.value...
Declaring types
this method accepts as
input the name of the structure and an array of field descriptors, each describing one field in the structure.
Using js-ctypes
ctypes.uint32_t, /* alert param */ ctypes.int16_t); /* item hit */ var hit = 0; var msgerr = makestr("carbon says..."); var msgexp = makestr("we just called the standardalert carbon function from javascript!"); var err = stdalert(1, msgerr, msgexp, 0, hit); carbon.close(); the makestr() function is a utility routine that takes as
input a standard javascript string and returns a carbon-style "pascal" string, which is a length byte followed by the characters of the string itself.
Accessibility Inspector - Firefox Developer Tools
this can mean different things depending on the type of the item; for example, a form
input (role: entry) would have a value of whatever is entered in the
input, whereas a link's value would be the url in the corresponding <a> element's href.
AnalyserNode.getFloatFrequencyData() - Web APIs
microphone
input const audioele = new audio(); audioele.src = 'my-audio.mp3';//insert file name here audioele.autoplay = true; audioele.preload = 'auto'; const audiosourcenode = audioctx.createmediaelementsource(audioele); //create analyser node const analysernode = audioctx.createanalyser(); analysernode.fftsize = 256; const bufferlength = analysernode.frequencybincount; const dataarray = new float32array(buffe...
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.
Animation.updatePlaybackRate() - Web APIs
examples a speed selector component would benefit from smooth updating of updateplaybackrate(), as demonstrated below: speedselector.addeventlistener('
input', evt => { cartoon.updateplaybackrate(parsefloat(evt.target.value)); cartoon.ready.then(() => { console.log(`playback rate set to ${cartoon.playbackrate}`); }); }); specifications specification status comment web animationsthe definition of 'updateplaybackrate()' in that specification.
AudioBuffer.copyFromChannel() - Web APIs
exceptions indexsizeerror one of the
input parameters has a value that is outside the accepted range: the value of channelnumber specifies a channel number which doesn't exist (that is, it's greater than or equal to the value of numberofchannels on the channel).
AudioBufferSourceNode.loopEnd - Web APIs
loopstartcontrol.on
input = function() { source.loopstart = loopstartcontrol.value; loopstartvalue.innerhtml = loopstartcontrol.value; } loopendcontrol.on
input = function() { source.loopend = loopendcontrol.value; loopendvalue.innerhtml = loopendcontrol.value; } specifications specification status comment web audio apithe definition of 'loopend' in that specification.
AudioBufferSourceNode.loopStart - Web APIs
loopstartcontrol.on
input = function() { source.loopstart = loopstartcontrol.value; loopstartvalue.innerhtml = loopstartcontrol.value; } loopendcontrol.on
input = function() { source.loopend = loopendcontrol.value; loopendvalue.innerhtml = loopendcontrol.value; } specifications specification status comment web audio apithe definition of 'loopstart' in that specification.
AudioNode.channelCount - Web APIs
the channelcount property of the audionode interface represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any
inputs to the node.
AudioNode.channelCountMode - Web APIs
the channelcountmode property of the audionode interface represents an enumerated value describing the way channels must be matched between the node's
inputs and outputs.
AudioParamDescriptor - Web APIs
// 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 ?
AudioTrackList.onaddtrack - Web APIs
syntax audiotracklist.onaddtrack = eventhandler; value set onaddtrack to a function that accepts as
input a trackevent object which indicates in its track property which audio track has been added to the media.
AudioTrackList.onremovetrack - Web APIs
syntax audiotracklist.onremovetrack = eventhandler; value set onremovetrack to a function that accepts as
input a trackevent object which indicates in its track property which audio track has been removed from the media element.
AudioWorkletGlobalScope.registerProcessor - Web APIs
// 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.
AudioWorkletGlobalScope - Web APIs
stprocessor 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 arraybuffer with a wavetable const usefulvariable = 42 console.log(usefulvariable)...
AudioWorkletNode() - Web APIs
available properties are as follows: numberof
inputs optional the value to initialize the numberof
inputs property to.
AudioWorkletNode.parameters - Web APIs
// 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
// 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.
AudioWorkletNode - Web APIs
// 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 o...
AudioWorkletProcessor.parameterDescriptors (static getter) - Web APIs
// 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
// 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.
BaseAudioContext.createAnalyser() - Web APIs
example the following example shows basic usage of an audiocontext to create an analyser node, then use requestanimationframe() to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio
input.
BaseAudioContext.createDelay() - Web APIs
var delay1; rangesynth.on
input = function() { delay1 = rangesynth.value; synthdelay.delaytime.setvalueattime(delay1, audioctx.currenttime); } specifications specification status comment web audio apithe definition of 'createdelay()' in that specification.
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.
Blob.type - Web APIs
var i, file
input, files, allowedfiletypes; // file
input is a html
inputelement: <
input type="file" multiple id="myfile
input"> file
input = document.getelementbyid("myfile
input"); // files is a filelist object (simliar to nodelist) files = file
input.files; // our application only allows gif, png, and jpeg images allowedfiletypes = ["image/png", "image/jpeg", "image/gif"]; for (i = 0; i < files.length; i++) { // test if file.type is an al...
Body.arrayBuffer() - Web APIs
function readfile(file) { return new response(file).arraybuffer(); } <
input type="file" onchange="readfile(this.files[0])"> specifications specification status comment fetchthe definition of 'arraybuffer()' in that specification.
CSSStyleSheet.insertRule() - Web APIs
' !important' : '') + ';\n'; } // insert css rule stylesheet.insertrule(selector + '{' + propstr + '}', stylesheet.cssrules.length); } } polyfill the below polyfill will correct the
input of the arguments of insertrule() to standardize them in internet explorer 5–8.
CSS Painting API - Web APIs
we create our paintworklet called 'hollowhighlights' using the registerpaint() function: registerpaint('hollowhighlights', class { static get
inputproperties() { return ['--boxcolor']; } static get
inputarguments() { return ['*','<length>']; } static get contextoptions() { return {alpha: true}; } paint(ctx, size, props, args) { const x = 0; const y = size.height * 0.3; const blockwidth = size.width * 0.33; const blockheight = size.height * 0.85; const thecolor = props.get( '--boxcolor' ); const stroketype = args[0].tost...
A basic ray-caster - Web APIs
input.js | level.js | player.js | raycaster.html | raycaster.js | trace.css | trace.js see also canvas tutorial ...
Hit regions and accessibility - Web APIs
math.pi, false); ctx.fill(); ctx.addhitregion({id: 'circle'}); canvas.addeventlistener('mousemove', function(event) { if (event.region) { alert('hit region: ' + event.region); } }); </script> the addhitregion() method also takes a control option to route events to an element (that is a descendant of the canvas): ctx.addhitregion({control: element}); this can be useful for routing to <
input> elements, for example.
Optimizing canvas - Web APIs
the ui would change only upon user
input, the gameplay layer would change with every new frame, and the background would remain generally unchanged.
Clipboard - Web APIs
a typical application accesses clipboard functionality by mapping user
input such as keybindings, menu selections, etc.
CompositionEvent.data - Web APIs
the data read-only property of the compositionevent interface returns the characters generated by the
input method that raised the event; its exact nature varies depending on the type of event that generated the compositionevent object.
console - Web APIs
console.time() starts a timer with a name specified as an
input parameter.
ConstantSourceNode.offset - Web APIs
example this example shows how to set up a constantsourcenode so its offset is used as the
input to a pair of gainnodes; this snippet is derived from the complete example you can find in controlling multiple parameters with constantsourcenode.
DOMException - Web APIs
notreadableerror the
input/output read operation failed (no legacy code value and constant name).
DOMPointInit.w - Web APIs
there are two methods which use dompointinit: the static function dompointreadonly.frompoint() takes an object that complies with dompointinit as its sole
input parameter, to specify the coordinates and perspective value of the new point to be created.
DOMPointInit.x - Web APIs
dompointinit is used as an
input when calling either dompointreadonly.frompoint() or dompoint.frompoint(), and is returned by the dompointreadonly.tojson() and dompoint.tojson() methods.
DOMPointInit.y - Web APIs
there are two methods which use dompointinit: the static function dompointreadonly.frompoint() takes an object that complies with dompointinit as its sole
input parameter, to specify the coordinates and perspective value of the new point to be created.
DOMPointInit.z - Web APIs
there are two methods which use dompointinit: the static function dompointreadonly.frompoint() takes an object that complies with dompointinit as its sole
input parameter, to specify the coordinates and perspective value of the new point to be created.
Using the W3C DOM Level 1 Core - Web APIs
the following script would do the job: html content <body> <
input type="button" value="change this document." onclick="change()"> <h2>header</h2> <p>paragraph</p> </body> javascript content function change() { // document.getelementsbytagname("h2") returns a nodelist of the <h2> // elements in the document, and the first is number 0: var header = document.getelementsbytagname("h2").item(0); // the firstchild of the header is a text node: ...
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.
Element.attributes - Web APIs
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 name and value" onclick="listattributes();"> <
input id="result" type="text" value=""> </p> </form> </body> </html> specifications specification status comment domthe definition of 'element.attributes' in that specification.
Element: auxclick event - Web APIs
when listening for auxclick events originating on elements that do not support
input or navigation, you will often want to explicitly prevent other default actions mapped to the down action of the middle mouse button.
Element: click event - Web APIs
safari mobile considers the following elements to be typically interactive (and thus they aren't affected by this bug): <a> (but it must have an href) <area> (but it must have an href) <button> <img> <
input> <label> (but it must be associated with a form control) <textarea> this list is incomplete; you can help mdn by doing further testing/research and expanding it.
Element: focusin event - Web APIs
bubbles yes cancelable no interface focusevent event handler property onfocusin sync / async sync composed yes examples live example html <form id="form"> <
input type="text" placeholder="text
input"> <
input type="password" placeholder="password"> </form> javascript const form = document.getelementbyid('form'); form.addeventlistener('focusin', (event) => { event.target.style.background = 'pink'; }); form.addeventlistener('focusout', (event) => { event.target.style.background = ''; }); result specifications specification status ...
Element: focusout event - Web APIs
bubbles yes cancelable no interface focusevent event handler property onfocusout sync / async sync composed yes examples live example html <form id="form"> <
input type="text" placeholder="text
input"> <
input type="password" placeholder="password"> </form> javascript const form = document.getelementbyid('form'); form.addeventlistener('focusin', (event) => { event.target.style.background = 'pink'; }); form.addeventlistener('focusout', (event) => { event.target.style.background = ''; }); result specifications specification status ...
Element.insertAdjacentHTML() - Web APIs
example // <div id="one">one</div> var d1 = document.getelementbyid('one'); d1.insertadjacenthtml('afterend', '<div id="two">two</div>'); // at this point, the new structure is: // <div id="one">one</div><div id="two">two</div> notes security considerations when inserting html into a page by using insertadjacenthtml(), be careful not to use user
input that hasn't been escaped.
Element.insertAdjacentText() - Web APIs
example beforebtn.addeventlistener('click', function() { para.insertadjacenttext('afterbegin',text
input.value); }); afterbtn.addeventlistener('click', function() { para.insertadjacenttext('beforeend',text
input.value); }); have a look at our insertadjacenttext.html demo on github (see the source code too.) here we have a simple paragraph.
Element.onfullscreenerror - Web APIs
since full-screen mode changes are only permitted in response to a user
input, this causes an error to occur, which triggers the delivery of the fullscreenerror event to the error handler, let elem = document.queryselector("video")}} elem.onfullscreenerror = function ( event ) { displaywarning("unable to switch into full-screen mode."); }; //....
Element: overflow event - Web APIs
bubbles yes cancelable yes interface uievent event handler property unknown examples <div id="wrapper"> <div id="child"></div> </div> <br/> <label><
input type="checkbox" id="toggle" checked/> overflow</label> <style> #wrapper { width: 20px; height: 20px; background: #000; padding: 5px; overflow: hidden; } #child { width: 40px; height: 40px; border: 2px solid grey; background: #ccc; } </style> <script> var wrapper = document.getelementbyid("wrapper"), child = document.getelementbyid("child"), ...
Element.scrollHeight - Web APIs
</textarea> </p> <p> <
input type="checkbox" id="agree" name="accept" /> <label for="agree">i agree</label> <
input type="submit" id="nextstep" value="next" /> </p> </form> css #notice { display: inline-block; margin-bottom: 12px; border-radius: 5px; width: 600px; padding: 5px; border: 2px #7fdf55 solid; } #rules { width: 600px; height: 130px; padding: 5px; border: #2a9f00 solid 2px; border-...
Element: scroll event - Web APIs
note, however, that
input events and animation frames are fired at about the same rate, and therefore the optimization below is often unnecessary.
Element.tabStop - Web APIs
the tabstop property of the element interface returns a boolean indicating if the element can receive
input focus via the tab key.
Element: underflow event - Web APIs
bubbles yes cancelable yes interface uievent event handler property unknown examples <div id="wrapper"> <div id="child"></div> </div> <br/> <label><
input type="checkbox" id="toggle" checked/> overflow</label> <style> #wrapper { width: 20px; height: 20px; background: #000; padding: 5px; overflow: hidden; } #child { width: 40px; height: 40px; border: 2px solid grey; background: #ccc; } </style> <script> var wrapper = document.getelementbyid("wrapper"), child = document.getelementbyid("child"), ...
Event.eventPhase - Web APIs
example html <h4>event propagation chain</h4> <ul> <li>click 'd1'</li> <li>analyse event propagation chain</li> <li>click next div and repeat the experience</li> <li>change capturing mode</li> <li>repeat the experience</li> </ul> <
input type="checkbox" id="chcapture" /> <label for="chcapture">use capturing</label> <div id="d1">d1 <div id="d2">d2 <div id="d3">d3 <div id="d4">d4</div> </div> </div> </div> <div id="divinfo"></div> css div { margin: 20px; padding: 4px; border: thin black solid; } #divinfo { margin: 18px; padding: 8px; background-color:white; font-size:80%; } javascr...
Event - Web APIs
animationevent audioprocessingevent before
inputevent beforeunloadevent blobevent clipboardevent closeevent compositionevent cssfontfaceloadevent customevent devicelightevent devicemotionevent deviceorientationevent deviceproximityevent domtransactionevent dragevent editingbefore
inputevent errorevent fetchevent focusevent gamepadevent hashchangeevent idbversionchangeevent
inputevent keyboardevent mediastreamevent message...
File.getAsBinary() - Web APIs
example // file
input is an html
inputelement: <
input type="file" id="myfile
input" multiple> var file
input = document.getelementbyid("myfile
input"); // files is a filelist object (similar to nodelist) var files = file
input.files; // object for allowed media types var accept = { binary : ["image/png", "image/jpeg"], text : ["text/plain", "text/css", "application/xml", "text/html"] }; var file; for (var i = 0; ...
File.getAsDataURL() - Web APIs
syntax var url = instanceoffile.getasdataurl(); returns a string representing a data: url example // file
input is a html
inputelement: <
input type="file" id="myfile
input" multiple> var file
input = document.getelementbyid("myfile
input"); // files is a filelist object (similar to nodelist) var files = file
input.files; // array with acceptable file types var accept = ["image/png"]; // img is a htmlimgelement: <img id="myimg"> var img = document.getelementbyid("myimg"); // if we accept the first selected file type if (accept.indexof(files[0].mediatype) > -1) { // display the image // s...
File.getAsText() - Web APIs
example // file
input is a html
inputelement: <
input type="file" id="myfile
input" multiple> var file
input = document.getelementbyid("myfile
input"); // files is a filelist object (similar to nodelist) var files = file
input.files; // object for allowed media types var accept = { binary : ["image/png", "image/jpeg"], text : ["text/plain", "text/css", "application/xml", "text/html"] }; var file; for (var i = 0; i...
File.lastModified - Web APIs
example reading from file
input <
input type="file" multiple id="file
input"> const file
input = document.queryselector('#file
input'); file
input.addeventlistener('change', (event) => { // files is a filelist object (similar to nodelist) const files = event.target.files; for (let file of files) { const date = new date(file.lastmodified); console.log(`${file.name} has a last modified date of ${date}`); } }); try th...
File.lastModifiedDate - Web APIs
example // file
input is a html
inputelement: <
input type="file" multiple id="myfile
input"> var file
input = document.getelementbyid("myfile
input"); // files is a filelist object (simliar to nodelist) var files = file
input.files; for (var i = 0; i < files.length; i++) { alert(files[i].name + " has a last modified date of " + files[i].lastmodifieddate); } reduced time precision to offer protection against timing attacks and fingerprinting, the precision of somefile.lastmodifieddate.gettime() migh...
File.name - Web APIs
example <
input type="file" multiple onchange="processselectedfiles(this)"> function processselectedfiles(file
input) { var files = file
input.files; for (var i = 0; i < files.length; i++) { alert("filename " + files[i].name); } } try the results out below: specifications specification status comment file apithe definition of 'name' in that specification.
File.type - Web APIs
syntax var name = file.type; value a string, containing the media type(mime) indicating the type of the file, for example "image/png" for png images example <
input type="file" multiple onchange="showtype(this)"> function showtype(file
input) { var files = file
input.files; for (var i = 0; i < files.length; i++) { var name = files[i].name; var type = files[i].type; alert("filename: " + name + " , type: " + type); } } note: based on the current implementation, browsers won't actually read the bytestream of a file to determine its media type.
File - Web APIs
file objects are generally retrieved from a filelist object returned as a result of a user selecting files using the <
input> element, from a drag and drop operation's datatransfer object, or from the mozgetasfile() api on an htmlcanvaselement.
onerror - Web APIs
the filereader onerror handler receives an event object, not an error object, as a parameter, but an error can be accessed from the filereader object, as instanceoffilereader.error // callback from a <
input type="file" onchange="onchange(event)"> function onchange(event) { var file = event.target.files[0]; var reader = new filereader(); reader.onerror = function(event) { alert("failed to read file!\n\n" + reader.error); reader.abort(); // (...does this do anything useful in an onerror handler?) }; reader.readastext(file); } ...
FileReader.onload - Web APIs
example // callback from a <
input type="file" onchange="onchange(event)"> function onchange(event) { var file = event.target.files[0]; var reader = new filereader(); reader.onload = function(e) { // the file's text will be printed here console.log(e.target.result) }; reader.readastext(file); } ...
HTMLButtonElement - Web APIs
htmlbuttonelement.autofocus is a boolean indicating whether or not the control should have
input focus when the page loads, unless the user overrides it, for example by typing in a different control.
HTMLFormControlsCollection.namedItem() - Web APIs
example html <form> <
input id="my-form-control" type="textarea"> </form> javascript // returns the html
inputelement representing #my-form-control elem1 = document.forms[0]['my-form-control']; specifications specification status comment html living standardthe definition of 'htmlformcontrolscollection.nameditem()' in that specification.
HTMLFormElement.acceptCharset - Web APIs
syntax var string = form.acceptcharset; form.acceptcharset = string; example
inputs = document.forms['myform'].acceptcharset; specifications specification status comment html living standardthe definition of 'htmlformelement: acceptcharset' in that specification.
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: reset event - Web APIs
html <form id="form"> <label>test field: <
input type="text"></label> <br><br> <button type="reset">reset form</button> </form> <p id="log"></p> javascript function logreset(event) { log.textcontent = `form reset!
HTMLFormElement.submit() - Web APIs
<
input> with attribute type="submit" will not be submitted with the form when using htmlformelement.submit(), but it would be submitted when you do it with original html form submit.
HTMLKeygenElement - Web APIs
properties autofocus is a boolean that reflects the autofocus html attribute, indicating that the form control should have
input focus when the page loads.
HTMLMediaElement.play() - Web APIs
exceptions the promise's rejection handler is called with an exception name passed in as its sole
input parameter (as opposed to a traditional exception being thrown).
HTMLElement.blur() - Web APIs
syntax element.blur(); examples remove focus from a text
input html <
input type="text" id="mytext" value="sample text"> <br><br> <button type="button" onclick="focus
input()">click me to gain focus</button> <button type="button" onclick="blur
input()">click me to lose focus</button> javascript function focus
input() { document.getelementbyid('mytext').focus(); } function blur
input() { document.getelementbyid('mytext').blur(); } result specification specification status comment html living standardthe definition of 'blur' in that specification.
HTMLElement.focus() - Web APIs
examples focus on a text field javascript focusmethod = function getfocus() { document.getelementbyid("mytextfield").focus(); } html <
input type="text" id="mytextfield" value="text field."> <p></p> <button type="button" onclick="focusmethod()">click me to focus on the text field!</button> result focus on a button javascript focusmethod = function getfocus() { document.getelementbyid("mybutton").focus(); } html <button type="button" id="mybutton">click me!</button> <p></p> <button type="button" onclick="focusmeth...
HTMLSelectElement.autofocus - Web APIs
the htmlselectelement.autofocus property is a boolean that reflects the autofocus html attribute, which indicates whether the associated <select> element will get
input focus when the page loads, unless the user overrides it.
HTMLSelectElement.disabled - Web APIs
<
input id="allow-drinks" type="checkbox"/> </label> <label for="drink-select">drink selection:</label> <select id="drink-select" disabled> <option value="1">water</option> <option value="2">beer</option> <option value="3">pepsi</option> <option value="4">whisky</option> </select> javascript var allowdrinkscheckbox = document.getelementbyid("allow-drinks"); var drinkselect = document.getelementbyid("drink-select"); allowdrinkscheckbox.addeventlistener("change", func...
HTMLSelectElement.form - Web APIs
syntax edit aform = aselectelement.form.selectname; example html <form action="http://www.google.com/search" method="get"> <label>google: <
input type="search" name="q"></label> <
input type="submit" value="search..."> </form> javascript a property available on all form elements, "type" returns the type of the calling form element.
MediaTrackSettings - Web APIs
for instance, the audio
input and output devices for the speaker and microphone built into a phone would share the same group id, since they're part of the same physical device.
Using the Media Capabilities API - Web APIs
label> <select id="framerate"> <option>60</option> <option>50</option> <option>30</option> <option>24</option> <option selected>15</option> </select> </li> <li> <label for="bitrate">select a bitrate</label> <select id="bitrate"> <option>4000</option> <option>2500</option> <option>800</option> </select> </li> </ul> <p><
input type="button" value="test this video configuration" id="tryit"></p> </form> <ul id="results"></ul> javascript let mc = { videoconfiguration : new object(), tryit: function () { mc.createconfiguration(); mc.testit(); }, createconfiguration: function () { var size = document.getelementbyid('size').value.split('x'); mc.videoconfiguration = { type: 'file', video...
MessagePort.close() - Web APIs
channel.port1.addeventlistener('message', handlemessage, false); function handlemessage(e) { para.innerhtml = e.data; text
input.value = ''; } channel.port1.start(); you could stop messages being sent at any time using channel.port1.close(); specifications specification status comment html living standardthe definition of 'close()' in that specification.
MessagePort.start() - Web APIs
sage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } another option would be to do this using eventtarget.addeventlistener, however, when this method is used, you need to explicitly call start() to begin the flow of messages to this document: channel.port1.addeventlistener('message', handlemessage, false); function handlemessage(e) { para.innerhtml = e.data; text
input.value = ''; } channel.port1.start(); specifications specification status comment html living standardthe definition of 'start()' in that specification.
MouseEvent.button - Web APIs
some pointing devices only have one button and use keyboard or other
input mechanisms to indicate main, secondary, auxilary, etc.
MouseEvent.buttons - Web APIs
the mouseevent.buttons read-only property indicates which buttons are pressed on the mouse (or other
input device) when a mouse event is triggered.
MouseEvent.initMouseEvent() - Web APIs
example html <div style="background:red; width:180px; padding:10px;"> <div id="out"></div> <
input type="text"> </div> javascript document.body.onclick = function(){ e = arguments[0]; var dt = e.target,stag = dt.tagname.tolowercase(); document.getelementbyid("out").innerhtml = stag; }; var simulateclick = function(){ var evt = document.createevent("mouseevents"); evt.initmouseevent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); document.body...
MouseScrollEvent - Web APIs
the mousescrollevent interface represents events that occur due to the user moving a mouse wheel or similar
input device.
msSetMediaProtectionManager - Web APIs
the mediaprotectionmanager class can be passed as an
input to a media playback api or the mediaprotectionmanager property inside the tag's video or audio.
Navigator.mediaDevices - Web APIs
the navigator.mediadevices read-only property returns a mediadevices object, which provides access to connected media
input devices like cameras and microphones, as well as screen sharing.
Navigator.requestMediaKeySystemAccess() - Web APIs
the fulfillment handler receives as
input just one parameter: mediakeysystemaccess a mediakeysystemaccess object representing the media key system configuration described by keysystem and supportedconfigurations exceptions in case of an error, the returned promise is rejected with a domexception whose name indicates what kind of error occurred.
Node.nodeName - Web APIs
enttype the value of documenttype.name element the value of element.tagname entity the entity name entityreference the name of entity reference notation the notation name processinginstruction the value of processinginstruction.target text "#text" example given the following markup: <div id="d1">hello world</div> <
input type="text" id="t"> and the following script: var div1 = document.getelementbyid("d1"); var text_field = document.getelementbyid("t"); text_field.value = div1.nodename; in xhtml (or any other xml format), text_field's value would read "div".
NotificationAction - Web APIs
notificationaction.action read only the name of the action, which can be used to identify the clicked action similar to
input names.
RTCPeerConnection.ondatachannel - Web APIs
syntax rtcpeerconnection.ondatachannel = function; value set this property to be a function you provide which receives as
input a single parameter: an rtcdatachannelevent which provides in its channel property the rtcdatachannel which has been created.
RTCPeerConnection.onicecandidate - Web APIs
syntax rtcpeerconnection.onicecandidate = eventhandler; value this should be set to a function which you provide that accepts as
input an rtcpeerconnectioniceevent object representing the icecandidate event.
RTCPeerConnection.oniceconnectionstatechange - Web APIs
syntax rtcpeerconnection.oniceconnectionstatechange = eventhandler; value this event handler can be set to function which is passed a single
input parameter: an event object describing the iceconnectionstatechange event which occurred.
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
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.
RadioNodeList - Web APIs
on setting the value property, the first radio button
input element whose value property is equal to the new value will be set to checked.
Request() - Web APIs
syntax var myrequest = new request(
input[, init]); parameters
input defines the resource that you wish to fetch.
ResizeObserver - Web APIs
the javascript looks like so: const h1elem = document.queryselector('h1'); const pelem = document.queryselector('p'); const divelem = document.queryselector('body > div'); const slider = document.queryselector('
input[type="range"]'); const checkbox = document.queryselector('
input[type="checkbox"]'); divelem.style.width = '600px'; slider.addeventlistener('
input', () => { divelem.style.width = slider.value + 'px'; }) const resizeobserver = new resizeobserver(entries => { for (const entry of entries) { if (entry.contentboxsize) { h1elem.style.fontsize = math.max(1.5, entry.contentboxsize.inlines...
SVGGraphicsElement: copy event - Web APIs
example html <?xml version="1.0" encoding="utf-8"?> <svg viewbox="0 0 100 30" width="600" height="320" xmlns="http://www.w3.org/2000/svg"> <text x="5" y="10" id="text-to-copy">copy this text</text> <foreignobject x="5" y="20" width="90" height="20"> <
input xmlns="http://www.w3.org/1999/xhtml" placeholder="paste it here"/> </foreignobject> </svg> css
input { font-size: 10px; width: 100%; height: 90%; box-sizing: border-box; border: 1px solid black; } javascript document.getelementsbytagname("text")[0].addeventlistener("copy", evt => { evt.clipboarddata.setdata('text/plain', document.getselection().tostring().touppercase()); ev...
SVGGraphicsElement: paste event - Web APIs
example html <?xml version="1.0" encoding="utf-8"?> <svg viewbox="0 0 140 30" width="600" height="320" xmlns="http://www.w3.org/2000/svg"> <foreignobject x="5" y="-10" width="90" height="20"> <
input xmlns="http://www.w3.org/1999/xhtml" value="copy this text"/> </foreignobject> <text x="5" y="30" id="element-to-paste-text" tabindex="1">paste it here</text> </svg> css
input { font-size: 10px; width: 100%; height: 90%; box-sizing: border-box; border: 1px solid black; } javascript document.getelementbyid("element-to-paste-text").addeventlistener("paste", evt => { evt.targ...
Using the Screen Capture API - Web APIs
example of a window allowing the user to select a display surface to capture you can then use the captured stream, capturestream, for anything that accepts a stream as
input.
Screen Wake Lock API - Web APIs
there are plenty of use cases for keeping a screen on, including reading an ebook, map navigation, following a recipe, presenting to an audience, scanning a qr/barcode or applications that use voice or gesture control, rather than tactile
input (the default way to keep a screen awake).
ScrollToOptions.behavior - Web APIs
when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: left
input.value, top: top
input.value, behavior: scroll
input.checked ?
ScrollToOptions.left - Web APIs
when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: left
input.value, top: top
input.value, behavior: scroll
input.checked ?
ScrollToOptions.top - Web APIs
when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: left
input.value, top: top
input.value, behavior: scroll
input.checked ?
UIEvent.layerX - Web APIs
note the pagex\pagey properties still return the absolute position in the document, including page scrolling.</span> </div> <div id="d3"> <form name="form_coords" id="form1"> parent element id: <
input type="text" name="parentid" size="7" /><br /> pagex:<
input type="text" name="pagexcoords" size="7" /> pagey:<
input type="text" name="pageycoords" size="7" /><br /> layerx:<
input type="text" name="layerxcoords" size="7" /> layery:<
input type="text" name="layerycoords" size="7" /> </form> </div> </body> </html> specifications this property is not part of any specification.
UIEvent.layerY - Web APIs
note the pagex\pagey properties still return the absolute position in the document, including page scrolling.</span> </div> <div id="d3"> <form name="form_coords" id="form1"> parent element id: <
input type="text" name="parentid" size="7" /><br /> pagex:<
input type="text" name="pagexcoords" size="7" /> pagey:<
input type="text" name="pageycoords" size="7" /><br /> layerx:<
input type="text" name="layerxcoords" size="7" /> layery:<
input type="text" name="layerycoords" size="7" /> </form> </div> </body> </html> specifications this property is not part of any specification.
UIEvent.pageY - Web APIs
note the pagex\pagey properties still return the absolute position in the document, including page scrolling.</span> </div> <div id="d3"> <form name="form_coords"> parent element id: <
input type="text" name="parentid" size="7" /><br /> pagex:<
input type="text" name="pagexcoords" size="7" /> pagey:<
input type="text" name="pageycoords" size="7" /><br /> layerx:<
input type="text" name="layerxcoords" size="7" /> layery:<
input type="text" name="layerycoords" size="7" /> </form> </div> </body> </html> specifications this property is not part of any specification.
URLSearchParams.set() - Web APIs
'use strict' function genurl(rexp, atext, bdebug=false){ let theurl theurl= new url('https://regexr.com') theurl.searchparams.set( 'expression', rexp.tostring() ) theurl.searchparams.set( 'tool', 'replace' ) theurl.searchparams.set( '
input', '\u2911\u20dc' )// ⤑⃜ theurl.searchparams.set( 'text', atext.join('\n') ) if( bdebug ){ // display the key/value pairs for(var pair of theurl.searchparams.entries()) { console.debug(pair[0] + ' = \'' + pair[1] + '\''); } console.debug(theurl) } return theurl } var url = genurl( /(^\s*\/\/|\s*[^:]\/\/).*\s*$|\s*\/\*(.|\n)+?\*\/\s*$/gm // single/multi-line comments // /(^\s*\...
URL API - Web APIs
the filltablewithparameters() function below takes as
input a htmltableelement object representing a <table>.
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.tooLong - Web APIs
the read-only toolong property of a validitystate object indicates if the value of an <
input> or <textarea>, after having been edited by the user, exceeds the maximum code-unit length established by the element's maxlength attribute.
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.
VideoTrackList.onaddtrack - Web APIs
syntax videotracklist.onaddtrack = eventhandler; value set onaddtrack to a function that accepts as
input a trackevent object which indicates in its track property which video track has been added to the media.
VideoTrackList.onremovetrack - Web APIs
syntax videotracklist.onremovetrack = eventhandler; value set onremovetrack to a function that accepts as
input a trackevent object which indicates in its track property which video track has been removed from the media element.
WebGLRenderingContext.getParameter() - Web APIs
int gl.max_combined_fragment_uniform_components glint64 gl.max_combined_uniform_blocks glint gl.max_combined_vertex_uniform_components glint64 gl.max_draw_buffers glint gl.max_element_index glint64 gl.max_elements_indices glint gl.max_elements_vertices glint gl.max_fragment_
input_components glint gl.max_fragment_uniform_blocks glint gl.max_fragment_uniform_components glint gl.max_program_texel_offset glint gl.max_samples glint gl.max_server_wait_timeout glint64 gl.max_texture_lod_bias glfloat gl.max_transform_feedback_interleaved_components glint ...
WebGLRenderingContext.getUniformLocation() - Web APIs
once you have the uniform's location, you can access the uniform itself using one of the other uniform access methods, passing in the uniform location as one of the
inputs: getuniform() returns the value of the uniform at the given location.
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.
WebGL constants - Web APIs
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.
WebRTC Statistics API - Web APIs
{ if (report.type === "inbound-rtp" && report.kind === "video") { object.keys(report).foreach(statname => { statsoutput += `<strong>${statname}:</strong> ${report[statname]}<br>\n`; }); } }); document.queryselector(".stats-box").innerhtml = statsoutput; }); } when the promise returned by getstats() is fulfilled, the resolution handler receives as
input an rtcstatsreport object containing the statistics information.
Web Animations API Concepts - Web APIs
this means we can use it to create and manipulate css-like animations that go from one pre-defined state to another, or we can use variables, loops, and callbacks to create interactive animations that adapt and react to changing
inputs.
Web Audio API best practices - Web APIs
as you work with a lot of changing values within the web audio api and will want to provide users with control over these, the range
input is often a good choice of control to use.
Migrating from webkitAudioContext - Web APIs
those values have since been changed to use the web idl based enumerated values, which should be familiar because they are similar to things like the the html
inputelement property type.
Visualizations with Web Audio API - Web APIs
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 Web Workers - Web APIs
when you want to send a message to the worker, you post messages to it like this (main.js): first.onchange = function() { myworker.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.postmessage([first.value,second.value]); console.log('message posted to worker'); } so here we have two <
input> elements represented by the variables first and second; when the value of either is changed, myworker.postmessage([first.value,second.value]) is used to send the value inside both to the worker, as an array.
WheelEvent - Web APIs
the wheelevent interface represents events that occur due to the user moving a mouse wheel or similar
input device.
Window.onmozbeforepaint - Web APIs
the event handler receives as an
input parameter an event whose timestamp property is the time, in milliseconds since epoch, that is the "current time" for the current animation frame.
Window: popstate event - Web APIs
the entry is now said to have "persisted user state." this information the browser might add to the history session entry may include, for instance, the document's scroll position, the values of form
inputs, and other such data.
window.requestIdleCallback() - Web APIs
this enables developers to perform background and low priority work on the main event loop, without impacting latency-critical events such as animation and
input response.
WindowClient.focus() - Web APIs
the focus() method of the windowclient interface gives user
input focus to the current client and returns a promise that resolves to the existing windowclient.
Worker.prototype.postMessage() - Web APIs
when either of two form
inputs (first and second) have their values changed, change events invoke postmessage() to send the value of both
inputs to the current worker.
Worker - Web APIs
example the following code snippet creates a worker object using the worker() constructor, then uses the worker object: var myworker = new worker('/worker.js'); var first = document.queryselector('
input#number1'); var second = document.queryselector('
input#number2'); first.onchange = function() { myworker.postmessage([first.value, second.value]); console.log('message posted to worker'); } for a full example, see ourbasic dedicated worker example (run dedicated worker).
XMLHttpRequest: abort event - Web APIs
bubbles no cancelable no interface progressevent event handler property onabort examples live example html <div class="controls"> <
input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <
input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <
input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; }
input { width: 11rem; ...
XMLHttpRequest: error event - Web APIs
bubbles no cancelable no interface progressevent event handler property onerror examples live example html <div class="controls"> <
input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <
input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <
input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; }
input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document...
XMLHttpRequest: load event - Web APIs
bubbles no cancelable no interface progressevent event handler property onload examples live example html <div class="controls"> <
input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <
input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <
input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; }
input { width: 11rem; margin: .5rem; } js const xhrbutton...
XMLHttpRequest: loadend event - Web APIs
bubbles no cancelable no interface progressevent event handler property onloadend examples live example html <div class="controls"> <
input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <
input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <
input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; }
input { widt...
XMLHttpRequest: loadstart event - Web APIs
bubbles no cancelable no interface progressevent event handler property onloadstart examples live example html <div class="controls"> <
input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <
input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <
input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; }
input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess ...
XMLHttpRequest: progress event - Web APIs
bubbles no cancelable no interface progressevent event handler property onprogress examples live example html <div class="controls"> <
input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <
input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <
input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; }
input { width: 11rem; margin: .5rem; } js const xhrbuttonsuc...
XRPose - Web APIs
node to provide the desired viewing position and angle: viewerpose = xrframe.getviewerpose(adjreferencespace); here, adjreferencespace is a reference space which has been updated using the base frame of reference for the frame and any adjustments needed to position the viewer based on movement or rotation which is being supplied from a source other than the xr device, such as keyboard or mouse
inputs.
XRReferenceSpaceType - Web APIs
it's particularly useful when determining the distance between the viewer and an
input, or when working with offset spaces.
XRView - Web APIs
the createteleporttransform() function returns the transform needed to move and rotate an object whose current situation is described by the reference space refspace to a new position and orientation which is computed using previously recorded mouse and keyboard
input data which has generated offsets for yaw, pitch, and position along all three axes.
XRViewerPose - Web APIs
by calling viewport() on the webgl context, specifying the xrview as
input, you can get the viewport to use when rendering in order to draw the frame for that eye into the correct part of the drawing surface.
XRWebGLLayer - Web APIs
that function receives as
input an xrframe which encapsulates the data needed to render the frame.
Generating HTML - Web APIs
the second example will transform the
input document (example2.xml), which again contains information about an article, into an html document.
Introduction - Web APIs
each template matches (using xpath) a certain fragment of the
input xml document and then applies the substitution part on that fragment to create the new resulting document.
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...
ARIA: timer role - Accessibility
required javascript features keypress used to handle keyboard
input and control the focus click, touch handle as appropriate for your widget as well changing attribute values aria-activedescendant is used to manage the focus inside the application container.
ARIA: document role - Accessibility
assistive technologies should switch context back to document mode, possibly intercepting from controls rewired for the parent's dynamic context, re-enabling the standard
input events, such as up or down arrow keyboard events, to control the reading cursor.
ARIA: checkbox role - Accessibility
instead use the native html checkbox of <
input type="checkbox">, which natively provides all the functionality required: <
input type="checkbox" id="chk1-label"> <label for="chk1-label">remember my preferences</label> description the native html checkbox form control can only have two checked states ("checked" or "not checked"), with an indeterminate state settable via javascript.
ARIA: dialog role - Accessibility
examples a dialog containing a form <div role="dialog" aria-labelledby="dialog1title" aria-describedby="dialog1desc"> <h2 id="dialog1title">subscription form</h2> <p id="dialog1desc">we will not share this information with third parties.</p> <form> <p> <label for="firstname">first name</label> <
input id="firstname" type="text" /> </p> <p> <label for="lastname">last name</label> <
input id="lastname" type="text"/> </p> <p> <label for="interests">interests</label> <textarea id="interests"></textarea> </p> <p> <
input type="checkbox" id="autologin"/> <label for="autologin">auto-login?</label> </p> <p> <
input...
ARIA - Accessibility
aria for scripted widgets writing keyboard-navigable javascript widgets built-in elements like <
input>, <button> etc have built-in keyboard accessibility.
Accessibility Information for Web Authors - Accessibility
this document tackles such difficulties and shows several interactive desktop-style widgets such as tree views, menu bars and spreadsheets which are accessible both with the keyboard and assistive technologies such as screen readers, screen magnifiers and alternative
input devices.
-moz-orient - CSS: Cascading Style Sheets
formal definition initial valueinlineapplies toany element; it has an effect on progress and meter, but not on <
input type="range"> or other elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax inline | block | horizontal | vertical examples html <p> the following progress meter is horizontal (the default): </p> <progress max="100" value="75"></progress> <p> the following progress meter is vertical: </p> <progress class="vert" max="100" value="75"></progress> css .vert ...
-webkit-text-stroke-color - CSS: Cascading Style Sheets
)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples varying the stroke color html <p>text with stroke</p> <
input type="color" value="#ff0000"> css p { margin: 0; font-size: 4em; -webkit-text-stroke-width: 3px; -webkit-text-stroke-color: #ff0000; /* can be changed in the live sample */ } javascript var colorpicker = document.queryselector("
input"); colorpicker.addeventlistener("change", function(evt) { document.queryselector("p").style.webkittextstrokecolor = evt.target.value; }); results ...
:-moz-focusring - CSS: Cascading Style Sheets
syntax :-moz-focusring examples html <
input /> css
input { margin: 5px; } :-moz-focusring { color: red; outline: 2px dotted green; } result specifications not part of any standard.
:-moz-only-whitespace - CSS: Cascading Style Sheets
width: 100vw; max-height: 100vh; } div { background-color: #ccc; box-sizing: border-box; height: 100vh; min-height: 16px; min-height: 1rem; } div { border: 4px solid red; } :-moz-only-whitespace { border-color: lime; } result specifications briefly defined as :blank in selectors level 4, but then the functionality was merged into :empty and :blank redefined to mean empty <
input>.
Attribute selectors - CSS: Cascading Style Sheets
"] { color: purple; } html <div lang="en-us en-gb en-au en-nz">hello world!</div> <div lang="pt">olá mundo!</div> <div lang="zh-cn">世界您好!</div> <div lang="zh-tw">世界您好!</div> <div data-lang="zh-tw">世界您好!</div> result html ordered lists the html specification requires the type attribute to be matched case-insensitively due to it primarily being used in the <
input> element, trying to use attribute selectors to with the type attribute of an ordered list doesn't work without the case-sensitive modifier.
Mozilla CSS extensions - CSS: Cascading Style Sheets
:-moz-system-metric(mac-graphite-theme) :-moz-system-metric(scrollbar-end-backward) :-moz-system-metric(scrollbar-end-forward) :-moz-system-metric(scrollbar-start-backward) :-moz-system-metric(scrollbar-start-forward) :-moz-system-metric(scrollbar-thumb-proportional) :-moz-system-metric(touch-enabled) :-moz-system-metric(windows-default-theme) -moz-user-focus -moz-user-
input -moz-user-modify -moz-window-dragging -moz-window-shadow formerly proprietary properties that are now standard note: to maximize the compatibility of your css, you should use the unprefixed standard properties instead of the prefixed ones listed below.
WebKit CSS extensions - CSS: Cascading Style Sheets
::-webkit-file-upload-button ::-webkit-inner-spin-button ::-webkit-
input-placeholder ::-webkit-media-controls ::-webkit-media-controls-current-time-display ::-webkit-media-controls-enclosure ::-webkit-media-controls-fullscreen-button ::-webkit-media-controls-mute-button ::-webkit-media-controls-overlay-enclosure ::-webkit-media-controls-panel ::-webkit-media-controls-play-button ::-webkit-media-controls-timeline ::-webkit-media-controls-time-remaining-displa...
aspect-ratio - CSS: Cascading Style Sheets
in firefox, the internal stylesheet rule looks like this: img,
input[type="image"], video, embed, iframe, marquee, object, table { aspect-ratio: attr(width) / attr(height); } specifications specification status comment css box sizing module level 4the definition of 'aspect-ratio' in that specification.
<display-internal> - CSS: Cascading Style Sheets
html <main> <div> <label for="name">name</label> <
input type="text" id="name" name="name"> </div> <div> <label for="age">age</label> <
input type="text" id="age" name="age"> </div> </main> css main { display: table; } div { display: table-row; } label,
input { display: table-cell; margin: 5px; } result specifications specification status css display module level 3the definition of 'display-interna...
grid-auto-flow - CSS: Cascading Style Sheets
nimation typediscrete formal syntax [ row | column ] | dense examples setting grid auto-placement html <div id="grid"> <div id="item1"></div> <div id="item2"></div> <div id="item3"></div> <div id="item4"></div> <div id="item5"></div> </div> <select id="direction" onchange="changegridautoflow()"> <option value="column">column</option> <option value="row">row</option> </select> <
input id="dense" type="checkbox" onchange="changegridautoflow()"> <label for="dense">dense</label> css #grid { height: 200px; width: 200px; display: grid; grid-gap: 10px; grid-template: repeat(4, 1fr) / repeat(2, 1fr); grid-auto-flow: column; /* or 'row', 'row dense', 'column dense' */ } #item1 { background-color: lime; grid-row-start: 3; } #item2 { background-color: yellow; } ...
transform-style - CSS: Cascading Style Sheets
html <section id="example-element"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </section> <div class="checkbox"> <label for="preserve"><code>preserve-3d</code></label> <
input type="checkbox" id="preserve" checked> </div> css #example-element { margin: 50px; width: 100px; height: 100px; transform-style: preserve-3d; transform: rotate3d(1, 1, 1, 30deg); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-visibility: inherit; font-size: 60px; color: #fff; } .front {...
Getting Started - Developer guides
first we'll add a text box to our html so the user can enter their name: <label>your name: <
input type="text" id="ajaxtextbox" /> </label> <span id="ajaxbutton" style="cursor: pointer; text-decoration: underline"> make a request </span> we'll also add a line to our event handler to get the user's data from the text box and send it to the makerequest() function along with the url of our server-side script: document.getelementbyid("ajaxbutton").onclick = function() { var username = ...
Ajax - Developer guides
file objects may be obtained from a filelist object returned as a result of a user selecting files using the <
input> element, from a drag and drop operation's datatransfer object, or from the mozgetasfile() api on an htmlcanvaselement.
Creating and triggering events - Developer guides
bbles: 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 been created yet: <form> <textarea></textarea> </form> const form = document.queryselector('form'); const textarea = document.queryselector('textarea'); form.addeventlistener('awesome', e => console.log(e.detail.text())); textarea.addeventlistener('
input'...
HTML5 Parser - Developer guides
please note that you shouldn't use end tags for void elements that don't have end tags: <area>, <base>, <br>, <col>, <command>, <embed>, <hr>, <img>, <
input>, <keygen>, <link>, <meta>, <param>, <source> and <wbr>.
Writing forward-compatible websites - Developer guides
here's an example that works in browsers without html5 support but breaks in a browser supporting html5: <form action="http://www.example.com"> <
input type="submit" value="submit the form" </form> due to the missing > on the
input tag.
DASH Adaptive Streaming for HTML 5 Video - HTML: Hypertext Markup Language
f webm_dash_manifest -i video_320x180_500k.webm \ -f webm_dash_manifest -i video_640x360_750k.webm \ -f webm_dash_manifest -i video_1280x720_1500k.webm \ -f webm_dash_manifest -i my_audio.webm \ -c copy \ -map 0 -map 1 -map 2 -map 3 -map 4 \ -f webm_dash_manifest \ -adaptation_sets "id=0,streams=0,1,2,3 id=1,streams=4" \ my_video_manifest.mpd the -map arguments correspond to the
input files in the sequence they are given; you should have one for each file.
<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.
<datalist>: The HTML Data List element - HTML: Hypertext Markup Language
examples <label for="mybrowser">choose a browser from this list:</label> <
input list="browsers" id="mybrowser" name="mybrowser" /> <datalist id="browsers"> <option value="chrome"> <option value="firefox"> <option value="internet explorer"> <option value="opera"> <option value="safari"> <option value="microsoft edge"> </datalist> result specifications specification status comment html living standardthe definition of '<datalist>' ...
<dialog>: The Dialog element - HTML: Hypertext Markup Language
ar selectel = document.queryselector('select'); var confirmbtn = document.getelementbyid('confirmbtn'); // "update details" button opens the <dialog> modally updatebutton.addeventlistener('click', function onopen() { if (typeof favdialog.showmodal === "function") { favdialog.showmodal(); } 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 ...
<keygen> - HTML: Hypertext Markup Language
autofocus this boolean attribute lets you specify that the control should have
input focus when the page loads, unless the user overrides it, for example by typing in a different control.
<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>.
title - HTML: Hypertext Markup Language
some typical uses: labeling <iframe> elements for assistive technology providing a programmatically associated label for an <
input> element as a fallback for a real <label> labeling controls in data tables additional semantics are attached to the title attributes of the <link>, <abbr>, <
input>, and <menuitem> elements.
Inline elements - HTML: Hypertext Markup Language
list of "inline" elements the following elements are inline 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...
MIME types (IANA media types) - HTTP
ultipart document as a whole) --aboundarystring content-disposition: form-data; name="myfile"; filename="img.jpg" content-type: image/jpeg (data) --aboundarystring content-disposition: form-data; name="myfield" (data) --aboundarystring (more subparts) --aboundarystring-- the following <form>: <form action="http://localhost:8000/" method="post" enctype="multipart/form-data"> <label>name: <
input name="mytextfield" value="test"></label> <label><
input type="checkbox" name="mycheckbox"> check</label> <label>upload file: <
input type="file" name="myfile" value="test.txt"></label> <button>send the file</button> </form> will send this message: post / http/1.1 host: localhost:8000 user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 accept: text/h...
Browser detection using the user agent - HTTP
if the device is large enough that it's not marked with “mobi”, you should serve your desktop site (which, as a best practice, should support touch
input anyway, as more desktop machines are appearing with touchscreens).
Content-Disposition - HTTP
when dealing with multiple files in the same field (for example, the multiple attribute of an <
input type="file"> element), there can be several subparts with the same name.
CSP: form-action - HTTP
<meta http-equiv="content-security-policy" content="form-action 'none'"> <form action="javascript:alert('foo')" id="form1" method="post"> <
input type="text" name="fieldname" value="fieldvalue"> <
input type="submit" id="submit" value="submit"> </form> // error: refused to send form data because it violates the following // content security policy directive: "form-action 'none'".
CSP: navigate-to - HTTP
<meta http-equiv="content-security-policy" content="navigate-to 'none'"> <form action="javascript:alert('foo')" id="form1" method="post"> <
input type="text" name="fieldname" value="fieldvalue"> <
input type="submit" id="submit" value="submit"> </form> specifications specification status comment content security policy level 3the definition of 'navigate-to' in that specification.
CSP: report-uri - HTTP
$current_domain; http_response_code(204); // http 204 no content $json_data = file_get_contents('php://
input'); // we pretty print the json before adding it to the log file if ($json_data = json_decode($json_data)) { $json_data = json_encode($json_data, json_pretty_print | json_unescaped_slashes); if (!file_exists($log_file)) { // send an email $message = "the following content-security-policy violation occurred on " .
Content-Type - HTTP
<form action="/" method="post" enctype="multipart/form-data"> <
input type="text" name="description" value="some text"> <
input type="file" name="myfile"> <button type="submit">submit</button> </form> the request looks something like this (less interesting headers are omitted here): post /foo http/1.1 content-length: 68137 content-type: multipart/form-data; boundary=---------------------------974767299852498929531610575 -----------------------------974767299...
Feature-Policy: camera - HTTP
the http feature-policy header camera directive controls whether the current document is allowed to use video
input devices.
POST - HTTP
in this case, the content type is selected by putting the adequate string in the enctype attribute of the <form> element or the formenctype attribute of the <
input> or <button> elements: application/x-www-form-urlencoded: the keys and values are encoded in key-value tuples separated by '&', with a '=' between the key and the value.
Expressions and operators - JavaScript
alidates an object's value property, given the object and the high and low values: function validate(obj, lowval, hival) { if ((obj.value < lowval) || (obj.value > hival)) console.log('invalid value!'); } you could call validate in each form element's onchange event handler, using this to pass it to the form element, as in the following example: <p>enter a number between 18 and 99:</p> <
input type="text" name="age" size=3 onchange="validate(this, 18, 99);"> grouping operator the grouping operator ( ) controls the precedence of evaluation in expressions.
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.
Loops and iteration - JavaScript
selectform"> <p> <label for="musictypes">choose some music types, then click the button below:</label> <select id="musictypes" name="musictypes" multiple="multiple"> <option selected="selected">r&b</option> <option>jazz</option> <option>blues</option> <option>new age</option> <option>classical</option> <option>opera</option> </select> </p> <p><
input id="btn" type="button" value="how many are selected?" /></p> </form> <script> function howmany(selectobject) { let numberselected = 0; for (let i = 0; i < selectobject.options.length; i++) { if (selectobject.options[i].selected) { numberselected++; } } return numberselected; } let btn = document.getelementbyid('btn'); btn.addeventlistener('click', function() { alert('num...
Unicode property escapes - JavaScript
// ٢ is the digit 2 in arabic-indic notation // while it is predominantly written within the arabic script // it can also be written in the thaana script "٢".match(/\p{script=thaana}/u); // null as thaana is not the predominant script super() "٢".match(/\p{script_extensions=thaana}/u); // ["٢", index: 0,
input: "٢", groups: undefined] unicode property escapes vs.
Classes - JavaScript
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 ...
URIError: malformed URI sequence - JavaScript
if there isn't such a character, an error will be thrown: decodeuricomponent('%e0%a4%a'); // "urierror: malformed uri sequence" with proper
input, this should usually look like something like this: decodeuricomponent('javascript_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b'); // "javascript_шеллы" ...
Array.prototype.reduceRight() - JavaScript
, x - 2); }; const split = (callback, x) => { settimeout(callback, randint(1000), x, x); }; const add = (callback, x, y) => { settimeout(callback, randint(1000), x + y); }; const div4 = (callback, x) => { settimeout(callback, randint(1000), x / 4); }; const computation = waterfall(add5, mult3, sub2, split, add, div4); computation(console.log, 5) // -> 14 // same as: const computation2 = (
input, callback) => { const f6 = x=> div4(callback, x); const f5 = (x, y) => add(f6, x, y); const f4 = x => split(f5, x); const f3 = x => sub2(f4, x); const f2 = x => mult3(f3, x); add5(f2,
input); } difference between reduce and reduceright var a = ['1', '2', '3', '4', '5']; var left = a.reduce(function(prev, cur) { return prev + cur; }); var right = a.reduceright...
Array.prototype.flat() - JavaScript
flatdeep(val, d - 1) : val), []) : arr.slice(); }; flatdeep(arr, infinity); // [1, 2, 3, 4, 5, 6] use a stack // non recursive flatten deep using a stack // note that depth control is hard/inefficient as we will need to tag each value with its own depth // also possible w/o reversing on shift/unshift, but array ops on the end tends to be faster function flatten(
input) { const stack = [...
input]; const res = []; while(stack.length) { // pop value from stack const next = stack.pop(); if(array.isarray(next)) { // push back array items, won't modify the original
input stack.push(...next); } else { res.push(next); } } // reverse to restore
input order return res.reverse(); } const arr = [1, 2, [3, 4, [5, 6]]]; fla...
Array - JavaScript
properties and elements, see this example and then refer to the table below: // match one d followed by one or more b's followed by one d // remember matched b's and the following d // ignore case const myre = /d(b+)(d)/i const myarray = myre.exec('cdbbdbsbz') the properties and elements returned from this match are as follows: property/element description example
input read only the original string against which the regular expression was matched.
BigInt64Array - JavaScript
bigint64array.prototype.set() stores multiple values in the typed array, reading
input values from a specified array.
BigUint64Array - JavaScript
biguint64array.prototype.set() stores multiple values in the typed array, reading
input values from a specified array.
Error.prototype.fileName - JavaScript
examples using filename var e = new error('could not parse
input'); throw e; // e.filename could look like "file:///c:/example.html" specifications not part of any standard.
Error.prototype.lineNumber - JavaScript
examples using linenumber var e = new error('could not parse
input'); throw e; console.log(e.linenumber) // 2 alternative example using error event window.addeventlistener('error', function(e) { console.log(e.linenumber); // 5 }); var e = new error('could not parse
input'); throw e; this is not a standard feature and lacks widespread support.
Error.prototype.message - JavaScript
examples throwing a custom error var e = new error('could not parse
input'); // e.message is 'could not parse
input' throw e; specifications specification ecmascript (ecma-262)the definition of 'error.prototype.message' in that specification.
Error.prototype.name - JavaScript
examples throwing a custom error var e = new error('malformed
input'); // e.name is 'error' e.name = 'parseerror'; throw e; // e.tostring() would return 'parseerror: malformed
input' specifications specification ecmascript (ecma-262)the definition of 'error.prototype.name' in that specification.
Float32Array - JavaScript
float32array.prototype.set() stores multiple values in the typed array, reading
input values from a specified array.
Math - JavaScript
we use our degtorad() function to convert 60 degrees to radians, as math.tan() expects an
input value in radians.
Number.isNaN() - JavaScript
number.isnan = number.isnan || function isnan(
input) { return typeof
input === 'number' &&
input !==
input; } examples using isnan number.isnan(nan); // true number.isnan(number.nan); // true number.isnan(0 / 0); // true // e.g.
Object.create() - JavaScript
note that such a different order may arise statically via disparate fixed codings such as here, but also dynamically via whatever the order any such property-adding code-branches actually get executed at runtime as depends on
inputs and/or random-variables.
Promise() constructor - JavaScript
the value received by promiseobj.then() is passed to the invocation of handlefulfilled as an
input parameter (see "chained promises" section).
Promise.allSettled() - JavaScript
at that time, the returned promise's handler is passed as
input an array containing the outcome of each promise in the original set of promises.
RegExp.prototype.compile() - JavaScript
flags if specified, flags can have any combination of the following values: g global match i ignore case m multiline; treat beginning and end characters (^ and $) as working over multiple lines (i.e., match the beginning or end of each line (delimited by \n or \r), not only the very beginning or end of the whole
input string) y sticky; matches only from the index indicated by the lastindex property of this regular expression in the target string (and does not attempt to match from any later indexes).
RegExp.prototype.sticky - JavaScript
perhaps because of the bug, the es2015 specification specifically calls out the fact that: when the y flag is used with a pattern, ^ always matches only at the beginning of the
input, or (if multiline is true) at the beginning of a line.
RegExp.prototype.test() - JavaScript
const str = 'hello world!'; const result = /^hello/.test(str); console.log(result); // true the following example logs a message which depends on the success of the test: function test
input(re, str) { let midstring; if (re.test(str)) { midstring = 'contains'; } else { midstring = 'does not contain'; } console.log(`${str} ${midstring} ${re.source}`); } using test() on a regex with the "global" flag when a regex has the global flag set, test() will advance the lastindex of the regex.
String.fromCodePoint() - JavaScript
result + stringfromcharcode.apply(null, codeunits); }; try { // ie 8 only supports `object.defineproperty` on dom elements object.defineproperty(string, "fromcodepoint", { "value": fromcodepoint, "configurable": true, "writable": true }); } catch(e) { string.fromcodepoint = fromcodepoint; } }(string.fromcharcode)); examples using fromcodepoint() valid
input: string.fromcodepoint(42); // "*" string.fromcodepoint(65, 90); // "az" string.fromcodepoint(0x404); // "\u0404" == "Є" string.fromcodepoint(0x2f804); // "\ud87e\udc04" string.fromcodepoint(194564); // "\ud87e\udc04" string.fromcodepoint(0x1d306, 0x61, 0x1d307); // "\ud834\udf06a\ud834\udf07" invalid
input: string.fromcodepoint('_'); // rangeerror string.fromcodepoint(infi...
String.prototype.matchAll() - JavaScript
capture groups are ignored when using match() with the global /g flag: let regexp = /t(e)(st(\d?))/g; let str = 'test1test2'; str.match(regexp); // array ['test1', 'test2'] using matchall, you can access capture groups easily: let array = [...str.matchall(regexp)]; array[0]; // ['test1', 'e', 'st1', '1', index: 0,
input: 'test1test2', length: 4] array[1]; // ['test2', 'e', 'st2', '2', index: 5,
input: 'test1test2', length: 4] specifications specification ecmascript (ecma-262)the definition of 'string.prototype.matchall' in that specification.
String - JavaScript
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.
TypedArray - JavaScript
typedarray.prototype.set() stores multiple values in the typed array, reading
input values from a specified array.
Uint16Array - JavaScript
uint16array.prototype.set() stores multiple values in the typed array, reading
input values from a specified array.
Uint32Array - JavaScript
uint32array.prototype.set() stores multiple values in the typed array, reading
input values from a specified array.
Uint8Array - JavaScript
uint8array.prototype.set() stores multiple values in the typed array, reading
input values from a specified array.
Uint8ClampedArray - JavaScript
uint8clampedarray.prototype.set() stores multiple values in the typed array, reading
input values from a specified array.
switch - JavaScript
it then looks for the first case clause whose expression evaluates to the same value as the result of the
input expression (using the strict comparison, ===) and transfers control to that clause, executing the associated statements.
throw - JavaScript
; } else { throw new userexception('invalidmonthno'); } } try { // statements to try var mymonth = 15; // 15 is out of bound to raise the exception var monthname = getmonthname(mymonth); } catch (e) { monthname = 'unknown'; console.error(e.message, e.name); // pass exception object to err handler } another example of throwing an object the following example tests an
input string for a u.s.
Mapping the width and height attributes of media container elements to their aspect-ratio - Web media technologies
this appears in the browser's internal ua stylesheet, similar to the following: img,
input[type="image"], video, embed, iframe, marquee, object, table { aspect-ratio: attr(width) / attr(height); } this actually affects any element that acts as a container for complex or mixed visual media — <embed>, <iframe>, <marquee>, <object>, <table>, and <video>, in addition to actual images (<img> and <
input type="image">).
Optimizing startup performance - Web Performance
the most important thing to do to try to help with the main code's startup process is to refactor the code into small pieces that can be done in chunks interspersed across multiple calls to your app's main loop, so that the main thread gets to handle
input and the like.
Media - Progressive web apps (PWAs)
place your mouse over the items in this list to see the actual pointer shapes in your browser: selector selects pointer indicating a link wait indicating that the program cannot accept
input progress indicating that the program is working, but can still accept
input default the default (usually an arrow) an outline property creates an outline that is often used to indicate keyboard focus.
SVG Event Attributes - SVG: Scalable Vector Graphics
document event attributes onabort, onerror, onresize, onscroll, onunload document element event attributes oncopy, oncut, onpaste global event attributes oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, on
input, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwa...
bias - SVG: Scalable Vector Graphics
after applying the kernelmatrix of the <feconvolvematrix> element to the
input image to yield a number and applied the divisor attribute, the bias attribute is added to each component.
divisor - SVG: Scalable Vector Graphics
the divisor attribute specifies the value by which the resulting number of applying the kernelmatrix of a <feconvolvematrix> element to the
input image color value is divided to yield the destination color value.
operator - SVG: Scalable Vector Graphics
arithmetic this value indicates that the source graphic defined in the in attribute and the destination graphic defined in the in2 attribute are combined using the following formula: result = k1*i1*i2 + k2*i1 + k3*i2 + k4 where: i1 and i2 indicate the corresponding pixel channel values of the
input image, which map to in and in2 respectively, and k1,k2,k3,and k4 indicate the values of the attributes with the same name.
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.
SVG Attribute reference - SVG: Scalable Vector Graphics
utes animation event attributes onbegin, onend, onrepeat document event attributes onabort, onerror, onresize, onscroll, onunload global event attributes oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, on
input, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwa...